:root {
  color-scheme: dark;
  --canvas: #07110d;
  --surface: #101f18;
  --surface-raised: #13251d;
  --surface-soft: #172e24;
  --text: #eef7f0;
  --muted: #9caf9f;
  --border: rgba(209, 235, 216, .12);
  --primary: #1fc096;
  --primary-deep: #0b5f4b;
  --gold: #d8b35a;
  --danger: #f08e82;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--font);
  background: var(--canvas);
  color: var(--text);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(ellipse at 82% -14%, rgba(31, 192, 150, .12), transparent 34rem), var(--canvas);
  color: var(--text);
  font: 400 16px/1.5 var(--font);
}
button, select { font: inherit; }
a { color: inherit; }
button:focus-visible, a:focus-visible, select:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
[hidden] { display: none !important; }

.page-shell { width: min(100% - 40px, 1080px); margin: 0 auto; }
.topbar { min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--border); }
.brand { display: inline-flex; gap: 11px; align-items: center; text-decoration: none; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(31,192,150,.25); border-radius: 14px; color: var(--primary); background: rgba(31,192,150,.07); }
.brand-mark svg { width: 30px; height: 30px; }
.brand strong { display: block; font-size: 17px; line-height: 1.1; letter-spacing: -.03em; }
.brand small { display: block; color: var(--muted); font-size: 10px; line-height: 1.2; letter-spacing: .18em; text-transform: uppercase; }
.topnav { display: flex; align-items: center; gap: 26px; }
.topnav a { color: var(--muted); font-size: 14px; text-decoration: none; transition: color .15s ease; }
.topnav a:hover { color: var(--text); }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 19px; border: 1px solid transparent; border-radius: 12px; font-size: 14px; font-weight: 650; text-decoration: none; cursor: pointer; transition: background-color .15s ease, border-color .15s ease, transform .15s ease; }
.button:active { transform: translateY(1px); }
.button-primary { background: var(--primary); color: #05231a; }
.button-primary:hover { background: #49d7ae; }
.button-secondary { border-color: var(--border); background: var(--surface-raised); color: var(--text); }
.button-secondary:hover, .button-quiet:hover { background: var(--surface-soft); }
.button-quiet { background: transparent; color: var(--muted); }
.button-block { width: 100%; }
.button:disabled { opacity: .58; cursor: progress; transform: none; }

main { min-height: calc(100vh - 154px); padding: 54px 0 72px; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 390px); align-items: center; gap: 70px; padding: 30px 0 72px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--primary); font-size: 12px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 660px; margin-bottom: 18px; font-size: clamp(36px, 5.2vw, 58px); line-height: 1.04; letter-spacing: -.055em; font-weight: 650; }
h2 { margin-bottom: 10px; font-size: 28px; line-height: 1.2; letter-spacing: -.035em; }
h3 { margin-bottom: 8px; font-size: 18px; line-height: 1.3; letter-spacing: -.02em; }
.hero-copy { max-width: 590px; margin-bottom: 25px; color: var(--muted); font-size: 17px; }
.value-list { display: flex; flex-wrap: wrap; gap: 9px; padding: 0; margin: 0; list-style: none; }
.value-list li { padding: 8px 12px; border: 1px solid var(--border); border-radius: 999px; background: rgba(16,31,24,.75); color: #c4d5c8; font-size: 12px; }
.panel { border: 1px solid var(--border); border-radius: 20px; background: linear-gradient(155deg, rgba(19,37,29,.97), rgba(16,31,24,.95)); box-shadow: 0 18px 56px rgba(0,0,0,.18); }
.auth-panel { padding: 28px; }
.auth-panel h2 { margin-top: 10px; }
.auth-panel p { margin: 0; color: var(--muted); font-size: 13px; }
.auth-divider { height: 1px; margin: 22px 0; background: var(--border); }
.telegram-slot { min-height: 52px; display: grid; place-items: center; margin: 20px 0 12px; }
.telegram-fallback { width: 100%; min-height: 48px; border: 1px solid rgba(31,192,150,.42); border-radius: 12px; background: rgba(31,192,150,.09); color: var(--text); font-weight: 650; }
.section { padding: 18px 0 52px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.section-heading p { max-width: 500px; margin: 0; color: var(--muted); font-size: 14px; }
.section-kicker { margin-bottom: 6px; color: var(--primary); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.plans-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.plan-card { display: flex; flex-direction: column; min-height: 218px; padding: 22px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); }
.plan-card h3 { margin: 12px 0 5px; }
.plan-card .plan-term, .plan-card .plan-detail { color: var(--muted); font-size: 13px; }
.plan-card .plan-price { margin: auto 0 16px; padding-top: 18px; font-size: 26px; font-weight: 650; letter-spacing: -.04em; }
.plan-card .plan-price small { margin-left: 4px; color: var(--muted); font-size: 13px; font-weight: 450; letter-spacing: 0; }
.plan-tag { width: fit-content; padding: 5px 9px; border: 1px solid rgba(31,192,150,.22); border-radius: 999px; color: var(--primary); font-size: 11px; font-weight: 650; }
.plan-tag.bypass { border-color: rgba(216,179,90,.32); color: var(--gold); }
.dashboard-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.dashboard-head h1 { margin: 8px 0 0; font-size: clamp(30px, 4vw, 42px); }
.dashboard-head p { margin: 0; color: var(--muted); }
.account-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, .8fr); gap: 16px; align-items: start; }
.sub-list { display: grid; gap: 14px; }
.sub-card { padding: 22px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); }
.sub-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 19px; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border-radius: 999px; background: rgba(31,192,150,.11); color: var(--primary); font-size: 11px; font-weight: 700; white-space: nowrap; }
.status-pill::before { width: 6px; height: 6px; content: ""; border-radius: 50%; background: currentColor; }
.status-pill.expired { background: rgba(156,175,159,.10); color: var(--muted); }
.sub-meta { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.meta-item { padding: 12px; border-radius: 12px; background: rgba(7,17,13,.55); }
.meta-item span { display: block; color: var(--muted); font-size: 11px; }
.meta-item strong { display: block; margin-top: 3px; font-size: 14px; font-weight: 600; }
.subscription-link { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: #09140e; }
.subscription-link code { min-width: 0; overflow: hidden; color: #bdd3c3; font: 12px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.subscription-link .button { flex: 0 0 auto; min-height: 36px; padding: 0 12px; font-size: 12px; }
.side-card { padding: 22px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); }
.side-card + .side-card { margin-top: 14px; }
.side-card p { margin: 0; color: var(--muted); font-size: 13px; }
.checkout-panel { margin-top: 24px; padding: 24px; border: 1px solid rgba(31,192,150,.23); border-radius: 18px; background: rgba(16,31,24,.78); }
.checkout-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
.field { display: grid; gap: 7px; }
.field label { color: var(--muted); font-size: 12px; font-weight: 600; }
.field select { width: 100%; min-height: 46px; padding: 0 13px; border: 1px solid var(--border); border-radius: 12px; background: #0a1710; color: var(--text); }
.empty-state { padding: 24px; border: 1px dashed rgba(156,175,159,.3); border-radius: 16px; color: var(--muted); }
.empty-state strong { display: block; margin-bottom: 5px; color: var(--text); }
.payment-status { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; padding: 16px 18px; border: 1px solid rgba(216,179,90,.3); border-radius: 14px; background: rgba(216,179,90,.07); }
.payment-status p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.notice { margin-top: 13px; color: var(--muted); font-size: 12px; }
.client-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.client-actions p { flex-basis: 100%; margin: 0; }
.footer { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--border); color: #789080; font-size: 12px; }
.loading-panel { min-height: 390px; display: grid; align-content: center; justify-items: center; gap: 12px; color: var(--muted); }
.loading-panel p { margin: 0; }
.loader { width: 26px; height: 26px; border: 2px solid rgba(31,192,150,.2); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 20; max-width: min(420px, calc(100vw - 32px)); padding: 13px 16px; border: 1px solid var(--border); border-radius: 13px; background: #13251d; color: var(--text); box-shadow: 0 12px 40px rgba(0,0,0,.3); font-size: 14px; }
.toast.error { border-color: rgba(240,142,130,.4); color: #ffd1ca; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; clip-path: inset(50%); }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  .page-shell { width: min(100% - 28px, 620px); }
  .topbar { min-height: 72px; }
  .topnav { gap: 15px; }
  .hero { grid-template-columns: 1fr; gap: 28px; padding: 35px 0 40px; }
  .hero-copy { font-size: 16px; }
  .auth-panel { max-width: 480px; }
  .plans-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .account-grid { grid-template-columns: 1fr; }
  .checkout-form { grid-template-columns: 1fr 1fr; }
  .checkout-form .button { grid-column: 1 / -1; }
  .section-heading, .dashboard-head { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 480px) {
  .page-shell { width: min(100% - 24px, 440px); }
  .topnav { gap: 10px; }
  .topnav a { font-size: 12px; }
  .topnav .button { min-height: 38px; padding: 0 10px; font-size: 12px; }
  main { padding: 30px 0 45px; }
  .hero { padding-top: 24px; }
  .auth-panel, .sub-card, .side-card { padding: 18px; }
  .plans-grid { grid-template-columns: 1fr; }
  .plan-card { min-height: 195px; }
  .sub-meta { grid-template-columns: 1fr 1fr; }
  .subscription-link { align-items: stretch; flex-direction: column; }
  .subscription-link .button { width: 100%; }
  .client-actions .button { width: 100%; }
  .checkout-form { grid-template-columns: 1fr; }
  .checkout-form .button { grid-column: auto; }
  .payment-status { align-items: flex-start; flex-direction: column; }
  .footer { align-items: flex-start; flex-direction: column; justify-content: center; padding: 15px 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
