/* GLCTv web — same palette and components as the Flutter app
   (lib/app/theme.dart, lib/app/tv_ui.dart). Mobile first. */
:root {
  color-scheme: dark;
  --canvas: #05060a;
  --graphite: #0b0d10;
  --card: #14171c;
  --raised: #11131a;
  --border: #292c36;
  --border-subtle: #1b1d25;
  --text: #f7f8fa;
  --text-2: #b1b4be;
  --muted: #777a86;
  --cyan: #26d9ff;
  --blue: #2588ff;
  --violet: #8657ff;
  --success: #72e6a6;
  --danger: #ff5d72;
  --amber: #ffb51b;
  --gradient: linear-gradient(90deg, var(--cyan), var(--blue), var(--violet));
  --radius: 14px;
  font-family: Roboto, "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }

html, body { margin: 0; background: var(--canvas); color: var(--text); }

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding:
    max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  /* Soft logo-colored glow behind the header, like the app's hero cards. */
  background:
    radial-gradient(60rem 22rem at 50% -8rem, rgba(38, 217, 255, 0.12), transparent 70%),
    radial-gradient(40rem 20rem at 85% -6rem, rgba(134, 87, 255, 0.12), transparent 70%),
    var(--canvas);
  background-repeat: no-repeat;
}

main { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 18px; }

/* ── Brand ── */
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 2px; }
.brand img { width: 36px; height: 36px; }
.wordmark {
  font-size: 22px; font-weight: 800; letter-spacing: 0.3px;
  background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}

h1 { margin: 6px 0 0; font-size: 28px; line-height: 1.12; font-weight: 800; letter-spacing: -0.6px; }
.lead { margin: 6px 0 0; color: var(--text-2); font-size: 16px; line-height: 1.5; }

/* ── Steps (Code · Account · CPF · Subscription) ── */
.steps { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; list-style: none; margin: 0; padding: 0; }
.steps li { display: grid; gap: 7px; font-size: 12px; color: var(--muted); font-weight: 600; text-align: center; }
.steps li::before { content: ""; height: 4px; border-radius: 4px; background: var(--border); }
.steps li.done { color: var(--text-2); }
.steps li.done::before { background: var(--cyan); }
.steps li.current { color: var(--text); }
.steps li.current::before { background: var(--gradient); }

/* ── Card ── */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 20px;
  padding: 20px; display: flex; flex-direction: column; gap: 14px;
}
.card h2 { margin: 0; font-size: 19px; font-weight: 750; }
.card p { margin: 0; color: var(--text-2); font-size: 15px; line-height: 1.5; }
.card form { display: flex; flex-direction: column; gap: 14px; }
.card form h2 + p { margin-top: -8px; }
/* A card holding only the code chip: the chip is the frame. */
.card.bare { background: none; border: 0; padding: 0; }

/* ── Fields ── */
label { display: grid; gap: 8px; font-size: 14px; font-weight: 600; color: var(--text-2); }
input {
  width: 100%; height: 54px; padding: 0 16px; border-radius: 12px;
  border: 1.5px solid var(--border); background: var(--raised); color: var(--text);
  font: inherit; font-size: 18px; /* ≥16px: no zoom on iOS */
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: var(--muted); }
input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(38, 217, 255, 0.16); }
input[aria-invalid="true"] { border-color: var(--danger); }
.code-input::placeholder { letter-spacing: 0.4em; color: #3a3d48; }
.code-input { text-align: center; font-size: 28px; font-weight: 800; letter-spacing: 0.25em; text-transform: uppercase; }
.hint { font-size: 13px; color: var(--muted); font-weight: 500; }
.hint.bad { color: var(--danger); }

/* ── Buttons ── */
button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.btn {
  width: 100%; min-height: 54px; padding: 0 18px; border: 0; border-radius: var(--radius);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 17px; font-weight: 700; transition: transform .08s, filter .15s, opacity .15s;
}
a.btn { text-decoration: none; }
.btn:active { transform: scale(0.985); }
.btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; box-shadow: 0 0 18px rgba(38, 217, 255, 0.45); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--gradient); color: #fff; }
.btn-primary:hover:not([disabled]) { filter: brightness(1.08); }
.btn-google { background: #fff; color: #1f1f1f; }
.btn-ghost { background: transparent; color: var(--text-2); border: 1.5px solid var(--border); }
.btn .spin {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite;
}
.link { background: none; border: 0; padding: 10px 4px; color: var(--cyan); font-weight: 600; font-size: 14px; white-space: nowrap; }

/* ── Code chip (code already in the link) ── */
.chip {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-radius: 12px; background: var(--raised); border: 1px solid var(--border-subtle);
}
.chip small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; }
.chip strong {
  font-size: 22px; letter-spacing: 0.18em;
  background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ── Status line ── */
.status { display: none; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 15px; line-height: 1.45; }
.status:not(:empty) { display: flex; }
.status.info { background: rgba(38, 217, 255, 0.08); color: #bfefff; }
.status.error { background: rgba(255, 93, 114, 0.1); color: #ffc2ca; }
.status.ok { background: rgba(114, 230, 166, 0.1); color: var(--success); }

/* ── Price / trust ── */
.price { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.price b { font-size: 26px; font-weight: 800; }
.price span { color: var(--muted); font-size: 14px; }
.perks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; color: var(--text-2); font-size: 14px; }
.perks li { display: flex; gap: 8px; }
.perks li::before { content: "✓"; color: var(--success); font-weight: 800; }

/* ── Done ── */
.done-mark {
  width: 72px; height: 72px; margin: 4px auto 0; border-radius: 50%; display: grid; place-items: center;
  background: rgba(114, 230, 166, 0.12); color: var(--success); font-size: 38px; font-weight: 800;
}
.center { text-align: center; }

/* ── Footer ── */
.account { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 13px; padding: 0 4px; }
.account span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
footer { color: var(--muted); font-size: 12px; text-align: center; line-height: 1.6; }

[hidden] { display: none !important; }

@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

@media (min-width: 640px) {
  body { justify-content: center; }
  h1 { font-size: 32px; }
}
