/* Shared look for the account, library, thank-you and info pages (same palette as index.html). */
:root {
  --bg: #07080a; --bg2: #0e1014; --bg3: #15181e; --line: #1d2027; --line2: #2c303a;
  --text: #ece6d8; --soft: #d8d2c4; --dim: #9a9688;
  --cain: #ff7a2e; --julie: #3fd6c6; --bad: #ff8a7a;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--text); font: 400 17px/1.6 Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--white, #fffaf0); }
:focus-visible { outline: 2px solid var(--julie); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }   /* headings we move focus to */
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mono { font: 600 12px/1.4 'IBM Plex Mono', ui-monospace, monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.skip { position: absolute; left: 12px; top: -60px; z-index: 20; background: var(--julie); color: #021412; padding: 10px 14px; border-radius: 8px; font-weight: 700; }
.skip:focus { top: 12px; }

/* header + footer */
.bar { border-bottom: 1px solid var(--line); }
.bar-in { max-width: 1120px; margin: 0 auto; padding: 14px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 64px; }
.brand { font: 600 13px/1.2 'IBM Plex Mono', monospace; letter-spacing: .22em; text-decoration: none; color: var(--text); }
.brand span { color: var(--dim); }
.toplink { font: 600 12px/1 'IBM Plex Mono', monospace; letter-spacing: .12em; text-transform: uppercase; text-decoration: none; padding: 10px 14px; border: 1px solid rgba(236,230,216,.3); border-radius: 999px; white-space: nowrap; transition: opacity .2s; }
.toplink:hover { background: rgba(236,230,216,.08); }
.toplink.pending { opacity: 0; }
.foot { border-top: 1px solid var(--line); color: var(--dim); font-size: 14px; }
.foot-in { max-width: 1120px; margin: 0 auto; padding: 32px 20px 48px; display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.foot nav { display: flex; gap: 18px; }

/* layout + type */
main { flex: 1; width: 100%; }
.wrap { max-width: 960px; margin: 0 auto; padding: 48px 20px 72px; }
.narrow { max-width: 540px; }
h1 { font-weight: 900; font-size: clamp(32px, 7vw, 52px); line-height: 1.04; letter-spacing: -.01em; margin: 12px 0 16px; overflow-wrap: anywhere; }
h2 { font-weight: 900; font-size: clamp(22px, 4vw, 30px); line-height: 1.15; margin: 0 0 10px; }
h3 { font-size: 18px; font-weight: 700; margin: 0 0 6px; }
.fork { width: 160px; height: 2px; background: var(--julie); margin: 0 0 24px; }
p { color: var(--soft); }
p + p { margin-top: 12px; }
.lead { font-size: 18px; }
.dim { color: var(--dim); }
.fine { font-size: 14px; color: var(--dim); margin-top: 16px; }
.section { margin-top: 48px; padding-top: 40px; border-top: 1px solid var(--line); }
.prose h2 { font-size: 22px; margin-top: 36px; }
.prose ul { margin: 10px 0 0 22px; color: var(--soft); }
.prose li + li { margin-top: 6px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 13px 24px; border-radius: 999px;
  font: 700 16px/1.2 Inter, system-ui, sans-serif; text-decoration: none; text-align: center; cursor: pointer;
  background: var(--cain); color: #160a02; border: 1px solid var(--cain); transition: box-shadow .2s, background .2s, transform .15s; }
.btn:hover { color: #160a02; box-shadow: 0 0 28px rgba(255,122,46,.35); }
.btn:active { transform: scale(.97); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .6; cursor: progress; box-shadow: none; transform: none; }
.btn.ghost { background: none; border-color: rgba(236,230,216,.35); color: var(--text); }
.btn.ghost:hover { background: rgba(236,230,216,.08); box-shadow: none; }
.btn.danger { background: none; border-color: rgba(255,138,122,.6); color: var(--bad); }
.btn.danger:hover { background: rgba(255,138,122,.1); box-shadow: none; }
.btn.small { min-height: 40px; padding: 9px 16px; font-size: 15px; }
.btn.wide { width: 100%; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkbtn[aria-disabled="true"], .linkbtn:disabled { opacity: .55; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

/* cards + forms */
.card { border: 1px solid var(--line); border-radius: 16px; background: var(--bg2); padding: 24px; }
.field { display: grid; gap: 6px; margin-bottom: 18px; }
label { font-weight: 600; font-size: 15px; }
.hint { font-size: 14px; color: var(--dim); }
input[type="text"], input[type="email"], input[type="password"] {
  width: 100%; min-height: 48px; padding: 11px 14px; font: 400 17px/1.4 Inter, system-ui, sans-serif; color: var(--text);
  background: var(--bg); border: 1px solid var(--line2); border-radius: 10px; }
input:focus-visible { outline: 2px solid var(--julie); outline-offset: 1px; border-color: var(--julie); }
input[aria-invalid="true"] { border-color: var(--bad); }
/* 6-digit code fields */
.field input.code { max-width: 240px; font: 600 24px/1.2 'IBM Plex Mono', ui-monospace, monospace; letter-spacing: .32em; font-variant-numeric: tabular-nums; }
.row-split { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 16px; margin-top: 10px; font-size: 15px; }
.row-split > * { min-height: 44px; display: inline-flex; align-items: center; }
.sent-to { margin: 0 0 18px; font-size: 15px; overflow-wrap: anywhere; }
.sent-to .linkbtn { min-height: 32px; }
.pw { position: relative; }
.pw input { padding-right: 76px; }
.pw-toggle { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); min-height: 38px; padding: 6px 12px; border-radius: 8px;
  background: var(--bg3); border: 1px solid var(--line2); color: var(--text); font: 600 13px Inter, system-ui, sans-serif; cursor: pointer; }
.row-end { display: flex; justify-content: flex-end; margin: -6px 0 16px; font-size: 15px; }
.msg:empty { display: none; }
.msg { margin: 0 0 16px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line2); font-size: 15px; color: var(--soft); }
.msg[data-kind="err"] { border-color: rgba(255,138,122,.5); background: rgba(255,138,122,.08); color: #ffd6cf; }
.msg[data-kind="ok"] { border-color: rgba(63,214,198,.45); background: rgba(63,214,198,.08); color: #cdf6f0; }
.msg a, .msg .linkbtn { color: inherit; font-weight: 600; }
.msg.flat { margin: 12px 0 0; }

/* tabs */
.tabs { display: flex; gap: 4px; padding: 4px; margin: 28px 0 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg2); }
.tabs [role="tab"] { flex: 1; min-height: 44px; border: 0; border-radius: 999px; background: none; color: var(--dim); font: 700 15px Inter, system-ui, sans-serif; cursor: pointer; }
.tabs [role="tab"][aria-selected="true"] { background: var(--bg3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line2); }

/* banners + toast */
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 0 0 28px; padding: 16px 18px; border-radius: 14px;
  border: 1px solid rgba(255,122,46,.4); background: rgba(255,122,46,.07); }
.banner p { flex: 1 1 260px; color: var(--text); }
.banner .msg { flex-basis: 100%; margin: 0; }
.banner-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.toast { position: fixed; left: 16px; right: 16px; bottom: 20px; z-index: 30; max-width: 520px; margin: 0 auto; padding: 14px 18px; border-radius: 12px;
  background: #1a1d23; border: 1px solid var(--line2); color: var(--text); box-shadow: 0 10px 40px rgba(0,0,0,.5);
  opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: none; pointer-events: auto; }

/* library */
.movie-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 6px 16px; margin-bottom: 16px; }
.player { position: relative; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.player video { width: 100%; height: 100%; display: block; }
.controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.quality { display: inline-flex; border: 1px solid var(--line2); border-radius: 999px; overflow: hidden; }
.quality button { min-height: 40px; padding: 8px 14px; border: 0; background: none; color: var(--dim); font: 600 12px 'IBM Plex Mono', monospace; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.quality button[aria-pressed="true"] { background: var(--bg3); color: var(--text); }
.resume { font-size: 15px; color: var(--dim); }
.downloads { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 22px; }
.downloads .btn small { font-weight: 500; opacity: .75; }
.chapters { margin-top: 22px; border-top: 1px solid var(--line); }
.chapters summary { cursor: pointer; padding: 14px 0; font-weight: 700; }
.chapters ol { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 2px 24px; padding-bottom: 8px; }
.chapters button { width: 100%; display: flex; gap: 12px; padding: 8px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text); font: 400 15px Inter, system-ui, sans-serif; text-align: left; cursor: pointer; }
.chapters button:hover { color: var(--julie); }
.chapters .t { min-width: 46px; color: var(--dim); font: 400 13px/1.9 'IBM Plex Mono', monospace; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 14px 0 20px; }
.facts dt { color: var(--dim); }
.facts dd { overflow-wrap: anywhere; }
.badge { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px; font: 600 11px 'IBM Plex Mono', monospace; letter-spacing: .08em; text-transform: uppercase; vertical-align: 2px; }
.badge.ok { color: var(--julie); border: 1px solid rgba(63,214,198,.45); }
.badge.warn { color: var(--cain); border: 1px solid rgba(255,122,46,.45); }
details.box { border: 1px solid var(--line); border-radius: 14px; background: var(--bg2); margin-top: 12px; }
details.box > summary { cursor: pointer; padding: 16px 20px; font-weight: 700; }
details.box > form, details.box > .inner { padding: 0 20px 20px; }
.loading { color: var(--dim); padding: 24px 0; }
.section-gap { margin-top: 28px; }

@media (max-width: 560px) {
  .wrap { padding-top: 32px; }
  .card { padding: 20px 16px; }
  .brand span { display: none; }
  .controls { align-items: stretch; }
  .quality { width: 100%; }
  .quality button { flex: 1; }
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dd { margin-bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
