/* KantFlix Web — dark brand theme with a clean, minimal (claude.ai-style) layout. */

:root {
  --bg: #090909;
  --surface: #121212;
  --surface-2: #161616;
  --card: #101010;
  --elev: #1a1a1a;

  --primary: #E51A2E;
  --primary-glow: #FF3347;
  --primary-deep: #930F1C;

  --gold: #FFB800;
  --gold-dim: #C78600;

  --text: #F5F5F5;
  --text-dim: #999999;
  --text-muted: #737373;
  --placeholder: #555555;

  --border: #1C1C1C;
  --outline: #2A2A2A;

  --error: #EF4444;
  --success: #10B981;
  --info: #60A5FA;

  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 460px;

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

a { color: var(--text-dim); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--text); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; margin: 0; }

/* ---- Brand mark ---- */
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-display); font-weight: 700; font-size: 20px;
  letter-spacing: -0.02em; color: var(--text);
}
.brand .dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 14px 1px rgba(229,26,46,.65);
}

/* ============================================================
   AUTH / LANDING — centered narrow column, lots of air
   ============================================================ */
.auth-wrap {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 22px;
}
.auth-card { width: 100%; max-width: var(--maxw); }
.auth-head { text-align: center; margin-bottom: 34px; }
.auth-head .brand { font-size: 26px; }
.auth-title {
  font-family: var(--font-display); font-size: 30px; font-weight: 700;
  letter-spacing: -0.03em; margin: 26px 0 8px;
}
.auth-sub { color: var(--text-dim); font-size: 15px; margin: 0; }

.hero-cta { margin-top: 30px; display: flex; flex-direction: column; gap: 12px; }

/* ---- Form ---- */
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 13px; color: var(--text-dim);
  margin-bottom: 7px; font-weight: 500;
}
.input {
  width: 100%; padding: 13px 14px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--outline); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 15px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: var(--placeholder); }
.input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(229,26,46,.16);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 13px 18px;
  border: none; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 15px; font-weight: 600;
  cursor: pointer; transition: transform .06s ease, background .15s ease, opacity .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-glow); }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--outline); }
.btn-ghost:hover:not(:disabled) { border-color: var(--text-muted); }
.btn-sm { width: auto; padding: 8px 14px; font-size: 13px; }

.link-row { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-muted); }
.link-row a { color: var(--text); font-weight: 600; }

/* ---- Alerts ---- */
.alert {
  padding: 11px 14px; border-radius: var(--radius-sm); font-size: 14px;
  margin-bottom: 18px; border: 1px solid transparent;
}
.alert-error { background: rgba(239,68,68,.10); border-color: rgba(239,68,68,.4); color: #fca5a5; }
.alert-ok { background: rgba(16,185,129,.10); border-color: rgba(16,185,129,.4); color: #6ee7b7; }
.alert-info { background: rgba(96,165,250,.10); border-color: rgba(96,165,250,.35); color: #93c5fd; }

/* ============================================================
   DASHBOARD
   ============================================================ */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  background: rgba(9,9,9,.82); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar .right { display: flex; align-items: center; gap: 12px; }

.container { max-width: 760px; margin: 0 auto; padding: 26px 20px 80px; }

.greet { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.greet-sub { color: var(--text-dim); margin: 4px 0 22px; font-size: 14px; }

.card {
  background: linear-gradient(180deg, var(--surface-2), var(--card));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; margin-bottom: 16px;
}
.card h3 { font-size: 15px; font-weight: 600; margin-bottom: 14px; color: var(--text); }
.card-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-title-row h3 { margin: 0; }

/* ---- Plan badge ---- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 7px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase;
}
.badge-free { background: rgba(160,160,160,.14); color: #c7c7c7; border: 1px solid #333; }
.badge-vip {
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: #1a1400;
}

/* ---- Quota bars ---- */
.quota { margin-bottom: 16px; }
.quota:last-child { margin-bottom: 0; }
.quota-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 7px; }
.quota-head .lbl { color: var(--text-dim); }
.quota-head .val { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.bar { height: 9px; background: #050505; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.bar > span { display: block; height: 100%; border-radius: 6px; transition: width .5s ease; }

/* ---- Cookie pool list ---- */
.cookie-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.cookie-row:last-child { border-bottom: none; }
.cookie-meta { min-width: 0; }
.cookie-email { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cookie-tags { color: var(--text-muted); font-size: 12px; margin-top: 2px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  padding: 6px 11px; border-radius: 20px; font-size: 12px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--outline); color: var(--text-dim);
}
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---- Code / link output ---- */
.codebox {
  display: flex; align-items: center; gap: 10px;
  background: #050505; border: 1px solid var(--outline); border-radius: var(--radius-sm);
  padding: 11px 13px; margin-top: 8px;
}
.codebox code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px;
  color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1;
}
.kv { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; }
.kv .k { color: var(--text-muted); }
.kv .v { color: var(--text); font-weight: 500; }

.timer { color: var(--gold); font-weight: 600; font-variant-numeric: tabular-nums; }
.timer.urgent { color: var(--primary-glow); }

.referral-code {
  font-family: var(--font-display); font-size: 22px; font-weight: 700;
  letter-spacing: .12em; color: var(--gold);
}

.muted { color: var(--text-muted); font-size: 13px; }
.center { text-align: center; }
.spinner {
  width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.25);
  border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Toast ---- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--elev); border: 1px solid var(--outline); color: var(--text);
  padding: 11px 18px; border-radius: 30px; font-size: 14px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 520px) {
  .auth-title { font-size: 26px; }
  .greet { font-size: 22px; }
}
