/* sign-in (animated market background), plans and the admin page */
.page { min-height: 100%; display: flex; flex-direction: column; }
.page-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px max(18px, env(safe-area-inset-right, 0px)) 12px max(18px, env(safe-area-inset-left, 0px)); border-bottom: 1px solid var(--line); background: var(--bar); -webkit-backdrop-filter: var(--glass); backdrop-filter: var(--glass); }
.page-top nav { display: flex; gap: 8px; align-items: center; }
.page-main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 36px 18px 56px; }

/* ---------- sign-in ---------- */
.auth-page { overflow: hidden; height: 100%; background: var(--bg); }
#bg, .bg-video { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.bg-video { object-fit: cover; opacity: 0; transition: opacity 1.2s ease; filter: saturate(1.1) brightness(.75); }
.bg-video.on { opacity: 1; }
.veil { position: fixed; inset: 0; pointer-events: none; background:
  radial-gradient(130% 100% at 55% 45%, rgba(4, 6, 10, 0) 45%, rgba(4, 6, 10, .6) 100%),
  linear-gradient(90deg, rgba(4, 6, 10, .5) 0%, rgba(4, 6, 10, .08) 42%, rgba(4, 6, 10, .3) 100%); }
.auth-shell { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; }
.auth-top { display: flex; align-items: center; justify-content: space-between; padding: 20px max(28px, env(safe-area-inset-right, 0px)) 0 max(28px, env(safe-area-inset-left, 0px)); }
.auth-main { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); gap: 48px; align-items: center; width: 100%; max-width: 1180px; margin: 0 auto; padding: 24px 28px 90px; }
.hero { display: flex; flex-direction: column; gap: 18px; }
.scene-chip { align-self: flex-start; display: inline-flex; align-items: center; gap: 9px; padding: 6px 14px 6px 12px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line2); font-size: 13px; color: var(--soft); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.scene-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--buy); box-shadow: 0 0 10px var(--buy); animation: live-pulse 1.8s ease-in-out infinite; }
@keyframes live-pulse { 50% { opacity: .35; } }
.scene-chip .sw { transition: opacity .4s; }
.hero h1 { margin: 0; font-size: clamp(36px, 5.2vw, 64px); line-height: 1.05; font-weight: 800; letter-spacing: -1.2px; text-shadow: 0 4px 30px rgba(0, 0, 0, .7); }
.hero h1 .grad { display: block; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 6px 30px rgba(245, 150, 40, .25)); }
.hero p { margin: 0; color: var(--soft); font-size: 18px; max-width: 460px; text-shadow: 0 2px 14px rgba(0, 0, 0, .8); }
.hero .feats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.hero .feats span { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; font-size: 13px; color: var(--soft); background: var(--panel2); border: 1px solid var(--line); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.hero .feats i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.auth-card { position: relative; padding: 26px; display: flex; flex-direction: column; gap: 18px; border-radius: 22px; background: rgba(12, 15, 22, .62); border: 1px solid var(--line2); -webkit-backdrop-filter: saturate(160%) blur(24px); backdrop-filter: saturate(160%) blur(24px); box-shadow: 0 30px 80px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .06); }
.auth-card::before { content: ""; position: absolute; inset: -1px; border-radius: 23px; padding: 1px; background: linear-gradient(140deg, rgba(255, 208, 107, .55), rgba(255, 255, 255, .04) 35%, rgba(143, 125, 255, .35)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.auth-card h2 { margin: 0; font-size: 22px; font-weight: 800; }
.tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr 1fr; background: var(--sunken); border: 1px solid var(--line); border-radius: 13px; padding: 4px; }
.tabs button { position: relative; z-index: 1; min-height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; transition: color .2s; }
.tabs button[aria-selected="true"] { color: var(--accent-fg); }
.tabs .thumb { position: absolute; top: 4px; bottom: 4px; width: calc((100% - 8px) / 3); right: 4px; border-radius: 10px; background: var(--accent-grad); box-shadow: 0 4px 16px rgba(245, 150, 40, .35); transition: transform .3s cubic-bezier(.3, .7, .2, 1); }
.tabs[data-mode="register"] .thumb { transform: translateX(-100%); }
.tabs[data-mode="lesson"] .thumb { transform: translateX(-200%); }
.lesson-fields { display: none; flex-direction: column; gap: 14px; }
.auth-card[data-mode="lesson"] .lesson-fields { display: flex; }
.auth-card[data-mode="lesson"] .account-fields { display: none; }
.lesson-fields .code-in { letter-spacing: 2px; text-transform: uppercase; font-family: var(--num); }
.lesson-fields .code-in::placeholder { letter-spacing: 0; text-transform: none; font-family: var(--font); }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.auth-card .input { height: 48px; background: var(--sunken); }
.auth-card .btn.primary { min-height: 50px; font-size: 16px; border-radius: 13px; }
.code-field { overflow: hidden; transition: max-height .35s ease, opacity .3s; max-height: 0; opacity: 0; }
.code-field.open { max-height: 100px; opacity: 1; }
.code-field .input { letter-spacing: 2px; text-transform: uppercase; font-family: var(--num); }
.code-field .input::placeholder { letter-spacing: 0; text-transform: none; font-family: var(--font); }
.auth-card .fine { margin: 0; font-size: 12.5px; color: var(--muted); text-align: center; }
/* a forgotten password (forgot), a new one from the mailed link (reset), the email check (verify): no tabs, only what each needs */
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover, .link-btn:focus-visible { color: var(--accent); }
.forgot-link { align-self: flex-end; margin-top: 2px; }
.auth-card:not([data-mode="login"]) .forgot-link { display: none; }
.back-link { display: none; align-self: center; }
.auth-card[data-mode="forgot"] .back-link, .auth-card[data-mode="reset"] .back-link, .auth-card[data-mode="verify"] .back-link { display: block; }
.auth-card[data-mode="forgot"] .tabs, .auth-card[data-mode="reset"] .tabs, .auth-card[data-mode="verify"] .tabs { display: none; }
.auth-card[data-mode="forgot"] .pass-field, .auth-card[data-mode="reset"] .email-field, .auth-card[data-mode="verify"] .account-fields { display: none; }
.tape { position: fixed; z-index: 2; inset: auto 0 0 0; height: 42px; overflow: hidden; border-top: 1px solid var(--line); background: var(--bar); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); direction: ltr; }
.tape-track { display: flex; gap: 34px; align-items: center; height: 100%; width: max-content; animation: tape 60s linear infinite; padding-left: 34px; }
.tape-track span { display: inline-flex; align-items: center; gap: 8px; font-family: var(--num); font-size: 13px; color: var(--soft); white-space: nowrap; }
.tape-track i { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; }
.tape-track i.u { border-bottom: 7px solid var(--buy); } .tape-track i.d { border-top: 7px solid var(--sell); }
@keyframes tape { to { transform: translateX(-50%); } }

/* ---------- plans ---------- */
.plans-head { text-align: center; margin: 8px auto 36px; max-width: 640px; }
.plans-head h1 { margin: 0 0 10px; font-size: clamp(30px, 4vw, 44px); font-weight: 800; letter-spacing: -.8px; }
.plans-head h1 .grad { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.plans-head p { margin: 0; color: var(--soft); font-size: 16px; }
.plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; gap: 16px; padding: 24px 20px; border-radius: 20px; transition: transform .2s, border-color .2s, box-shadow .2s; }
.plan:hover { transform: translateY(-3px); border-color: var(--line2); }
.plan.featured { border-color: var(--accent-line); background: radial-gradient(400px 220px at 50% -10%, rgba(245, 182, 66, .16), transparent 70%), var(--panel); box-shadow: 0 20px 60px rgba(245, 150, 40, .12); }
.plan.top { border-color: rgba(143, 125, 255, .4); background: radial-gradient(400px 220px at 50% -10%, rgba(143, 125, 255, .18), transparent 70%), var(--panel); }
.plan .badge { position: absolute; top: -11px; right: 20px; font-size: 12px; padding: 3px 12px; border-radius: 999px; background: var(--accent-grad); color: var(--accent-fg); font-weight: 700; }
.plan.top .badge { background: linear-gradient(135deg, #B6A9FF, #8F7DFF); color: #12102A; }
.plan h2 { margin: 0; font-size: 18px; font-weight: 800; }
.plan .price { display: flex; align-items: baseline; gap: 6px; direction: ltr; justify-content: flex-end; }
.plan .price b { font-family: var(--num); font-size: 40px; font-weight: 700; letter-spacing: -1px; }
.plan .price span { color: var(--muted); font-size: 14px; }
.plan ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; color: var(--soft); flex: 1; font-size: 14px; }
.plan li { display: flex; gap: 9px; align-items: baseline; }
.plan li::before { content: "✓"; color: var(--buy-text); font-weight: 800; flex: none; }
.plan li.no { color: var(--faint); }
.plan li.no::before { content: "–"; color: var(--faint); }
.plan li.hi { color: var(--fg); font-weight: 600; }
.plans-note { margin: 32px auto 0; max-width: 720px; color: var(--faint); font-size: 12.5px; line-height: 1.6; text-align: center; }

/* ---------- admin ---------- */
.adm-title { display: flex; align-items: baseline; gap: 12px; margin: 0 0 20px; }
.adm-title h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.5px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat { padding: 16px 18px; border-radius: var(--radius); }
.stat .k { font-size: 12.5px; color: var(--muted); }
.stat .v { font-family: var(--num); font-size: 30px; font-weight: 700; margin-top: 4px; direction: ltr; text-align: right; }
.stat .v.gold { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .sub { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.adm-grid { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
.adm-card { padding: 18px; border-radius: var(--radius); }
.adm-card h2 { margin: 0 0 14px; font-size: 16px; font-weight: 800; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.adm-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.adm-form .full { grid-column: 1 / -1; }
.adm-form .field label { font-size: 12px; }
.adm-form .input { height: 40px; }
.new-code { margin-top: 14px; padding: 14px; border-radius: 14px; border: 1px solid var(--accent-line); background: var(--accent-bg); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.new-code .code { font-family: var(--num); font-size: 22px; font-weight: 700; letter-spacing: 2px; color: var(--accent); direction: ltr; }
.new-code .row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl th { text-align: right; font-size: 11.5px; color: var(--faint); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.tbl tr:hover td { background: var(--panel2); }
.tbl .mono { font-family: var(--num); direction: ltr; text-align: right; }
.tbl .input { height: 34px; padding: 0 9px; font-size: 13px; }
.tbl select.input { padding-left: 28px; background-position: 12px 15px, 17px 15px; min-width: 112px; }
.tbl input[type="date"].input { width: 150px; color-scheme: dark; }
.tbl .note-in { width: 150px; }
.tbl .acts { display: flex; gap: 6px; }
.tbl .email { font-weight: 600; direction: ltr; text-align: right; }
.tbl .small { color: var(--muted); font-size: 12px; }
.tbl tr.dirty td { background: rgba(245, 182, 66, .05); }
.ls-check input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.adm-search { height: 36px; width: 220px; }
.users-card { margin-top: 16px; }

@media (max-width: 1100px) {
  .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; }
  .adm-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .auth-page { overflow: auto; height: auto; min-height: 100%; }
  .auth-shell { height: auto; min-height: 100dvh; }
  .auth-main { grid-template-columns: minmax(0, 1fr); gap: 26px; padding: 18px 16px 80px; align-content: start; }
  .auth-top { padding: 16px 16px 0; }
  .hero { gap: 12px; }
  .hero p { font-size: 16px; }
  .hero .feats { display: none; }
  .auth-card { padding: 20px; }
  .page-main { padding: 22px 16px 44px; }
  .plans { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adm-form { grid-template-columns: minmax(0, 1fr); }
  .adm-search { width: 100%; }
}

/* day mode on the sign-in page: a light veil over the moving chart, no dark text shadows */
:root[data-theme="light"] .veil { background:
  radial-gradient(130% 100% at 55% 45%, rgba(243, 245, 249, 0) 45%, rgba(243, 245, 249, .7) 100%),
  linear-gradient(90deg, rgba(243, 245, 249, .6) 0%, rgba(243, 245, 249, .1) 42%, rgba(243, 245, 249, .35) 100%); }
:root[data-theme="light"] .hero h1, :root[data-theme="light"] .hero p { text-shadow: 0 2px 18px rgba(255, 255, 255, .9); }
:root[data-theme="light"] .auth-card { background: rgba(255, 255, 255, .78); box-shadow: 0 30px 80px rgba(15, 23, 42, .18), inset 0 1px 0 rgba(255, 255, 255, .8); }
