/* ==========================================================================
   Zap IPTV checkout (/activate) and payment result (/payment-success)
   Calm, receipt-like: pink is reserved for the one action that takes money.
   ========================================================================== */

:root {
  --ink: #0a0e17;
  --panel: #121826;
  --panel-raised: #172033;
  --line: #243049;
  --line-strong: #34405c;
  --text: #eef2f8;
  --muted: #8e9ab0;
  --pink: #ff2d75;
  --pink-press: #e0185e;
  --green: #3dd68c;
  --amber: #f5b94a;
  --red: #ff6b7a;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
  border-radius: 6px;
}

.checkout {
  max-width: 460px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

/* ---- Top bar ---------------------------------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
}
.topbar img { height: 30px; width: auto; display: block; }
.topbar .secure {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.topbar .secure svg { color: var(--green); }

/* ---- Heading ---------------------------------------------------------- */
.checkout h1 {
  font-size: 30px;
  line-height: 1.15;
  font-weight: 750;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.lede {
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 32px;
}

/* ---- Sections --------------------------------------------------------- */
.block { margin-bottom: 28px; }
.block-title {
  font-size: 15px;
  font-weight: 650;
  margin-bottom: 10px;
}
.hint {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 8px;
}

/* ---- Device code input ------------------------------------------------ */
.code-input {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font: 600 19px/1 var(--font);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: border-color 0.15s ease;
}
.code-input::placeholder { color: #4d5a75; letter-spacing: 0.08em; }
.code-input:focus { outline: none; border-color: var(--muted); }
.code-input[aria-invalid="true"] { border-color: var(--red); }

/* ---- The TV (shows which device you are paying for) ------------------- */
.tv {
  margin-top: 14px;
  display: none;
}
.tv.is-shown { display: block; }
.tv-screen {
  position: relative;
  border: 2px solid var(--line-strong);
  border-radius: 14px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, 0.05), transparent 60%),
    #0d1320;
  padding: 22px 20px 20px;
  text-align: center;
  overflow: hidden;
}
.tv-code {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}
.tv-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
}
.tv-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}
.tv[data-state="trial"] .dot { background: var(--amber); }
.tv[data-state="active"] .dot { background: var(--green); }
.tv[data-state="expired"] .dot,
.tv[data-state="error"] .dot { background: var(--red); }
.tv-stand {
  width: 64px;
  height: 10px;
  margin: 0 auto;
  border: 2px solid var(--line-strong);
  border-top: 0;
  border-radius: 0 0 8px 8px;
}

/* A quiet scan line passes once when a TV is found. */
.tv.is-found .tv-screen::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -40%;
  height: 40%;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  animation: scan 0.9s ease-out 1 forwards;
}
@keyframes scan { to { top: 110%; } }

/* ---- Plans (real radio buttons) --------------------------------------- */
.plans {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--panel);
}
.plan {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.plan + .plan { border-top: 1px solid var(--line); }
.plan:hover { background: var(--panel-raised); }
.plan input {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.plan input::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text);
  transform: scale(0);
  transition: transform 0.15s ease;
}
.plan input:checked { border-color: var(--text); }
.plan input:checked::after { transform: scale(1); }
.plan:has(input:checked) { background: var(--panel-raised); }
.plan-name { font-weight: 650; font-size: 16px; }
.plan-note { font-size: 13.5px; color: var(--muted); }
.plan-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid rgba(61, 214, 140, 0.4);
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
  vertical-align: 2px;
}
.plan-price {
  font-weight: 700;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---- Total + pay ------------------------------------------------------ */
.total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 4px 2px 14px;
  border-bottom: 1px dashed var(--line-strong);
  margin-bottom: 18px;
}
.total-label { color: var(--muted); font-size: 15px; }
.total-amount {
  font-size: 24px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.pay {
  width: 100%;
  height: 56px;
  border: 0;
  border-radius: 12px;
  background: var(--pink);
  color: #fff;
  font: 700 17px/1 var(--font);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.pay:hover { background: var(--pink-press); }
.pay:active { transform: scale(0.99); }
.pay:disabled { background: #3a2230; color: #b58a9b; cursor: not-allowed; transform: none; }
.pay .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
.pay.is-busy .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.pay-methods {
  margin-top: 12px;
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
}
.pay-methods img { height: 16px; vertical-align: -3px; margin: 0 2px; }

.notice {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  display: none;
}
.notice.is-shown { display: block; }
.notice.is-error { background: rgba(255, 107, 122, 0.1); color: #ffb3bb; border: 1px solid rgba(255, 107, 122, 0.3); }
.notice.is-info { background: rgba(142, 154, 176, 0.1); color: var(--text); border: 1px solid var(--line); }

/* ---- Reassurance ------------------------------------------------------ */
.assure {
  list-style: none;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 14px;
}
.assure li {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 12px;
  font-size: 14.5px;
  color: var(--muted);
}
.assure li strong { color: var(--text); font-weight: 600; display: block; }
.assure svg { color: var(--green); margin-top: 2px; }

.legal {
  margin-top: 26px;
  font-size: 12.5px;
  color: #6c7890;
}
.legal a { color: var(--muted); }

.foot {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 13px;
}
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--text); text-decoration: underline; }

/* ---- Payment result page --------------------------------------------- */
.result { padding-top: 8px; }
.result-mark {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border: 2px solid var(--line-strong);
  color: var(--muted);
}
.result[data-state="ok"] .result-mark { border-color: var(--green); color: var(--green); background: rgba(61, 214, 140, 0.08); }
.result[data-state="error"] .result-mark { border-color: var(--red); color: var(--red); background: rgba(255, 107, 122, 0.08); }
.result-mark .spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid var(--line-strong);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.receipt {
  margin: 24px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.receipt-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  font-size: 15px;
}
.receipt-row + .receipt-row { border-top: 1px solid var(--line); }
.receipt-row dt { color: var(--muted); }
.receipt-row dd { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.result[data-state="ok"] .receipt-status { color: var(--green); }
.result[data-state="error"] .receipt-status { color: var(--red); }
.button-quiet {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-weight: 650;
  text-decoration: none;
}
.button-quiet:hover { background: var(--panel-raised); }
.result .pay { text-decoration: none; }

@media (max-width: 380px) {
  .checkout h1 { font-size: 26px; }
  .tv-code { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
