:root {
  --bg: #090a0f;
  --bg-soft: #10121a;
  --card: rgba(21, 24, 34, .82);
  --card-strong: #151822;
  --text: #f6f7fb;
  --muted: #9ca3b5;
  --line: rgba(255,255,255,.09);
  --primary: #7c5cff;
  --primary-2: #9c86ff;
  --success: #39d98a;
  --danger: #ff6577;
  --warning: #ffc857;
  --shadow: 0 24px 80px rgba(0,0,0,.34);
  --radius: 22px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 15% 5%, rgba(124,92,255,.16), transparent 28rem),
    radial-gradient(circle at 85% 20%, rgba(59,130,246,.10), transparent 24rem),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 74px;
  padding: 14px clamp(18px, 4vw, 64px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(9,10,15,.78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.brand { display: inline-flex; gap: 12px; align-items: center; }
.brand-mark {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 13px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), #4f9cff);
  box-shadow: 0 12px 32px rgba(124,92,255,.25);
}
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); font-size: .72rem; margin-top: 2px; }
.nav-actions { display: flex; gap: 8px; }

.btn {
  border: 0;
  border-radius: 13px;
  min-height: 44px;
  padding: 0 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 750;
  transition: transform .15s ease, opacity .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn:focus-visible, input:focus-visible, .auth-tab:focus-visible, .icon-btn:focus-visible {
  outline: 3px solid rgba(124,92,255,.45);
  outline-offset: 2px;
}
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--primary), #5b7cff); }
.btn-secondary { color: var(--text); background: #1b1f2b; border: 1px solid var(--line); }
.btn-ghost { color: var(--text); background: transparent; border: 1px solid transparent; }
.btn-large { min-height: 52px; padding: 0 23px; }
.btn-full { width: 100%; }

.hero {
  max-width: 1220px;
  margin: 0 auto;
  padding: clamp(70px, 10vw, 130px) clamp(20px, 5vw, 70px);
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr);
  align-items: center;
  gap: clamp(40px, 7vw, 90px);
}
.eyebrow {
  color: var(--primary-2);
  font-weight: 850;
  letter-spacing: .12em;
  font-size: .76rem;
}
.hero h1 {
  margin: 14px 0 18px;
  max-width: 840px;
  font-size: clamp(2.55rem, 7vw, 5.4rem);
  line-height: .98;
  letter-spacing: -.055em;
}
.hero-copy > p {
  color: var(--muted);
  max-width: 700px;
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.7;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.trust-row {
  margin-top: 26px;
  display: flex; flex-wrap: wrap; gap: 16px;
  color: #c5cad6;
  font-size: .9rem;
}
.hero-panel {
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(27,30,43,.9), rgba(15,17,25,.92));
  box-shadow: var(--shadow);
}
.status-chip {
  display: inline-flex; align-items: center; gap: 8px;
  color: #caefe0; background: rgba(57,217,138,.08);
  border: 1px solid rgba(57,217,138,.18);
  border-radius: 999px; padding: 7px 11px; font-size: .78rem;
}
.status-chip span { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.metric { padding: 30px 2px; }
.metric small, .metric span { display: block; color: var(--muted); }
.metric strong { display: block; font-size: 4.5rem; line-height: 1; letter-spacing: -.05em; margin: 5px 0; }
.mini-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.mini-grid div { background: rgba(255,255,255,.04); border: 1px solid var(--line); padding: 15px; border-radius: 15px; }
.mini-grid strong, .mini-grid span { display: block; }
.mini-grid span { color: var(--muted); font-size: .8rem; margin-top: 4px; }

.section, .dashboard {
  max-width: 1220px;
  margin: 0 auto;
  padding: 85px clamp(20px,5vw,70px);
}
.section-heading { max-width: 680px; margin-bottom: 34px; }
.section-heading h2 { font-size: clamp(2rem,4vw,3.2rem); margin: 10px 0; letter-spacing: -.04em; }
.section-heading p { color: var(--muted); line-height: 1.6; }

.plans-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 14px;
}
.plan-card, .card {
  min-height: 330px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  padding: 22px;
}
.plan-card.featured {
  border-color: rgba(124,92,255,.55);
  box-shadow: 0 20px 60px rgba(124,92,255,.12);
}
.plan-card h3 { font-size: 1.35rem; margin: 8px 0; }
.plan-card .plan-price { font-size: 2.15rem; font-weight: 900; letter-spacing: -.04em; margin: 16px 0 5px; }
.plan-card .plan-price small { font-size: .82rem; color: var(--muted); font-weight: 600; }
.plan-card .plan-limit { color: #d8dbe5; margin: 12px 0 24px; }
.plan-card ul { padding: 0; margin: 0 0 24px; list-style: none; color: var(--muted); display: grid; gap: 9px; font-size: .9rem; }
.plan-card ul li::before { content: "✓"; color: var(--success); margin-right: 8px; }
.plan-card .btn { width: 100%; margin-top: auto; }
.plan-card { display: flex; flex-direction: column; }
.plan-tag { color: var(--primary-2); font-size: .75rem; font-weight: 850; letter-spacing: .08em; }

.skeleton { overflow: hidden; position: relative; }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.055), transparent);
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.dashboard {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.015);
}
.dashboard-heading { max-width: none; }
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 14px;
}
.dashboard-secondary { grid-template-columns: repeat(2,minmax(0,1fr)); margin-top: 14px; }
.panel-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--card-strong);
  min-height: 180px;
}
.panel-title { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .85rem; }
.panel-value { font-size: 2.05rem; margin: 18px 0 8px; display: block; letter-spacing: -.04em; }
.panel-card p { color: var(--muted); margin: 8px 0; }
.badge { color: #dcd6ff; background: rgba(124,92,255,.15); padding: 5px 9px; border-radius: 999px; }
.progress { height: 9px; background: rgba(255,255,255,.07); border-radius: 999px; overflow: hidden; margin: 14px 0; }
.progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg,var(--primary),#4f9cff); transition: width .3s ease; }
.account-card dl { margin: 18px 0 0; }
.account-card dl div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.account-card dt { color: var(--muted); }
.account-card dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.empty-state { color: var(--muted); padding-top: 18px; }
.list-row { display: flex; justify-content: space-between; gap: 15px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row span { color: var(--muted); font-size: .86rem; }
.dashboard-actions { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 10px; }

footer {
  max-width: 1220px; margin: 0 auto;
  padding: 30px clamp(20px,5vw,70px) 50px;
  color: var(--muted); display: flex; justify-content: space-between; gap: 20px; font-size: .85rem;
}

.auth-dialog {
  width: min(92vw, 460px);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 20px;
  background: #11131b;
  color: var(--text);
  box-shadow: var(--shadow);
}
.auth-dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(5px); }
.dialog-close-row { display: flex; justify-content: flex-end; margin: -4px -4px 4px; }
.icon-btn { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; font-size: 1.4rem; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: rgba(255,255,255,.04); padding: 5px; border-radius: 14px; }
.auth-tab { border: 0; border-radius: 10px; min-height: 40px; color: var(--muted); background: transparent; cursor: pointer; font-weight: 750; }
.auth-tab.active { color: var(--text); background: #242838; }
.auth-panel { padding: 20px 2px 4px; }
.auth-panel h2 { margin: 0 0 6px; }
.auth-panel > p { margin: 0 0 20px; color: var(--muted); }
.auth-panel form { display: grid; gap: 14px; }
.auth-panel label { display: grid; gap: 7px; color: #d9dce6; font-size: .9rem; }
.auth-panel input {
  width: 100%; min-height: 48px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 12px; background: #0d0f16; color: var(--text);
}
.resend-box { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); text-align: center; }
.resend-box p { color: var(--muted); font-size: .86rem; }
.notice { margin-top: 15px; padding: 12px 14px; border-radius: 12px; background: rgba(124,92,255,.1); border: 1px solid rgba(124,92,255,.2); color: #e5e1ff; font-size: .9rem; }
.notice.error { background: rgba(255,101,119,.08); border-color: rgba(255,101,119,.22); color: #ffd5da; }

.toast-stack { position: fixed; z-index: 40; right: 18px; bottom: 18px; display: grid; gap: 9px; width: min(380px, calc(100vw - 36px)); }
.toast { padding: 13px 15px; border-radius: 13px; background: #1a1d28; border: 1px solid var(--line); box-shadow: var(--shadow); }
.toast.error { border-color: rgba(255,101,119,.3); }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .hero-panel { max-width: 620px; }
  .plans-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-secondary { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .topbar { padding-inline: 14px; }
  .brand small { display: none; }
  .nav-actions .btn { padding-inline: 12px; }
  .hero, .section, .dashboard { padding-inline: 17px; }
  .hero { padding-top: 60px; }
  .hero h1 { font-size: clamp(2.6rem, 14vw, 4.1rem); }
  .plans-grid { grid-template-columns: 1fr; }
  .mini-grid { grid-template-columns: 1fr 1fr 1fr; }
  footer { padding-inline: 17px; flex-direction: column; }
}
