/* System fonts only: phones on a hotspot can't load web fonts before they have paid. */
:root {
  color-scheme: dark;
  --paper: #0a1017;
  --surface: #111b25;
  --surface-2: #162331;
  --ink: #e9eff4;
  --ink-2: #93a5b4;
  --line: #22344a;
  --teal: #22c55e;          /* brand green */
  --teal-ink: #03200e;
  --teal-soft: #12301f;
  --sun: #f5b52e;
  --ok: #4ade80;
  --ok-soft: #123221;
  --warn: #f5b52e;
  --warn-soft: #33270b;
  --err: #ff8a80;
  --err-soft: #3a1714;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--font); font-size: 16px; line-height: 1.5;
  background-color: var(--paper); color: var(--ink);
}
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 8px; letter-spacing: -0.01em; }
h1 { font-size: clamp(28px, 7vw, 40px); font-weight: 800; }
h2 { font-size: 22px; } h3 { font-size: 17px; }
p { margin: 0 0 12px; }

/* ---- Frame ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 800; font-size: 18px; color: var(--ink); letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.topbar nav { display: flex; gap: 16px; align-items: center; font-size: 15px; }
.topbar nav a { color: var(--ink-2); }
.container { width: 100%; max-width: 980px; margin: 0 auto; padding: 20px 16px 56px; flex: 1; }
.container.wide { max-width: 1080px; }
.footer { text-align: center; padding: 20px 16px 28px; color: var(--ink-2); font-size: 14px; border-top: 1px solid var(--line); }

:root { --glow: radial-gradient(60% 50% at 50% 0%, rgba(34,197,94,0.16), transparent 70%); }
body { background-image: var(--glow); background-repeat: no-repeat; background-attachment: scroll; }

/* ---- Home ---- */
.hero { padding: 18px 0 6px; text-align: center; }
.hero h1 { margin-bottom: 8px; }
.hero p { color: var(--ink-2); font-size: 17px; max-width: 46ch; margin: 0 auto; }
.logo { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--teal); color: var(--teal-ink); margin-right: 8px; vertical-align: -9px; }
.logo svg { width: 20px; height: 20px; }

.steps { list-style: none; margin: 22px 0 0; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .steps { grid-template-columns: 1fr 1fr; } }
.steps h2 { grid-column: 1 / -1; text-align: center; font-size: 17px; margin: 0; }
.steps li { display: flex; gap: 10px; align-items: center; font-size: 15px; }
.steps li b { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); font-size: 13px; }
.care { grid-column: 1 / -1; text-align: center; color: var(--ink-2); font-size: 15px; }

.section-title { font-size: 22px; margin: 30px 0 2px; text-align: center; }
.section-sub { color: var(--ink-2); font-size: 15px; margin: 0 0 14px; text-align: center; }

.tiles { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--ink); transition: border-color .15s, transform .15s; }
.tile:hover { text-decoration: none; border-color: var(--teal); transform: translateY(-2px); }
.tile:active { transform: scale(0.98); }
.tile-head { background: var(--teal-soft); padding: 12px 10px; text-align: center; font-weight: 700; font-size: 14px; line-height: 1.25; min-height: 52px; display: grid; place-items: center; border-bottom: 1px solid var(--line); }
.tile-body { padding: 14px 10px 14px; text-align: center; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.tile-price { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.tile-price small { font-size: 14px; font-weight: 700; color: var(--ink-2); margin-right: 2px; }
.tile-valid { color: var(--ink-2); font-size: 13px; margin-bottom: 10px; }
.tile-btn { margin-top: auto; background: var(--teal); color: var(--teal-ink); font-weight: 700; padding: 10px; border-radius: 10px; font-size: 15px; }

/* Custom amount: the input is the display */
.calc { background: var(--surface); border: 1px solid var(--teal); border-radius: 18px; padding: 22px 16px; margin: 32px auto 0; max-width: 520px; box-shadow: 0 0 0 4px var(--teal-soft); }
.calc h2 { text-align: center; margin-bottom: 4px; }
.calc .section-sub { margin-bottom: 8px; }
.amount-wrap { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 14px 0 4px; }
.amount-wrap span { font-size: 22px; font-weight: 800; color: var(--ink-2); }
.calc .amount-input { width: 7ch; min-width: 0; text-align: center; font-size: clamp(40px, 12vw, 60px); font-weight: 800; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; padding: 4px 6px; margin: 0; background: transparent; border: 0; border-bottom: 3px solid var(--teal); border-radius: 0; color: var(--ink); font-family: inherit; box-shadow: none; -moz-appearance: textfield; }
.calc .amount-input::-webkit-outer-spin-button, .calc .amount-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.calc .amount-input:focus { outline: none; box-shadow: none; border-color: var(--sun); }
.calc-time { text-align: center; font-size: clamp(22px, 6vw, 30px); font-weight: 800; color: var(--teal); min-height: 1.3em; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }
.chip { min-width: 62px; padding: 9px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface-2); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.chip:hover, .chip[aria-pressed=true] { border-color: var(--teal); color: var(--teal); }
.calc .btn { margin-top: 18px; }
.calc-note { text-align: center; font-size: 14px; color: var(--ink-2); margin: 10px 0 0; }
.calc .field-error { margin-top: 10px; }

.back-grid { display: grid; gap: 14px; grid-template-columns: 1fr; margin-top: 30px; }
@media (min-width: 720px) { .back-grid { grid-template-columns: 1fr 1fr; } }
.back-grid .panel { margin-top: 0; }
.back-grid h2 { font-size: 19px; }
.back-grid .btn { margin-top: 14px; }

/* ---- Panels & forms ---- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-top: 16px; }
.panel.narrow { max-width: 440px; margin-left: auto; margin-right: auto; }
.summary { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 14px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.summary .time { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; }
.summary .price { font-size: 20px; font-weight: 800; color: var(--teal); }
form label { display: block; margin: 16px 0 6px; font-size: 15px; font-weight: 600; }
form input, form select {
  display: block; width: 100%; padding: 13px 14px; margin-top: 6px; font: inherit; font-size: 17px;
  background: var(--paper); color: var(--ink); border: 1.5px solid var(--line); border-radius: 10px;
}
form input:focus, form select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.hint { color: var(--ink-2); font-size: 14px; margin: 6px 0 0; font-weight: 400; }

.btn {
  display: inline-block; width: 100%; margin-top: 18px; padding: 14px 18px; text-align: center;
  background: var(--teal); color: var(--teal-ink); border: 0; border-radius: 12px;
  font: inherit; font-size: 17px; font-weight: 700; cursor: pointer;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn.secondary { background: transparent; color: var(--teal); border: 2px solid var(--teal); }
.btn.small { width: auto; margin: 0; padding: 8px 14px; font-size: 14px; border-radius: 8px; }
.btn[disabled] { opacity: 0.6; cursor: wait; }
.linklike { background: none; border: 0; padding: 0; color: var(--ink-2); font: inherit; cursor: pointer; }
.linklike:hover { color: var(--ink); text-decoration: underline; }
.muted { color: var(--ink-2); font-size: 14px; }
.center { text-align: center; }

.error, .notice {
  padding: 12px 14px; border-radius: 10px; font-size: 15px; margin: 12px 0;
  background: var(--err-soft); color: var(--err); border: 1px solid var(--err);
}
.notice { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.big-phone { font-size: 26px; font-weight: 800; letter-spacing: 0.02em; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }

/* ---- Pay & result screens ---- */
.status { text-align: center; padding: 28px 20px; }
.status h2 { font-size: 26px; }
.badge { width: 68px; height: 68px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center; font-size: 34px; font-weight: 800; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--err-soft); color: var(--err); }
.pulse { width: 68px; height: 68px; margin: 0 auto 14px; border-radius: 50%; background: var(--teal-soft); position: relative; }
.pulse::after { content: ""; position: absolute; inset: 22px; border-radius: 50%; background: var(--teal); animation: beat 1.2s ease-in-out infinite; }
@keyframes beat { 50% { transform: scale(1.5); opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) { .pulse::after { animation: none; } }
.countdown { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; margin: 8px 0; }

.creds { display: grid; gap: 8px; margin: 16px 0; text-align: left; }
.cred { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; }
.cred span { color: var(--ink-2); font-size: 14px; }
.cred b { font-size: 20px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 0.03em; word-break: break-all; }
.details { list-style: none; padding: 0; margin: 12px 0; text-align: left; }
.details li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.details li:last-child { border-bottom: 0; }
.save { margin-top: 14px; padding: 12px 14px; background: var(--warn-soft); color: var(--warn); border-radius: 10px; text-align: left; font-size: 15px; }
code { background: var(--paper); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; font-size: 0.9em; }

/* ---- Lists, tags ---- */
.list { list-style: none; padding: 0; margin: 8px 0; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--paper); color: var(--ink-2); }
.tag.active, .tag.internet { background: var(--ok-soft); color: var(--ok); }
.tag.expired, .tag.failed { background: var(--err-soft); color: var(--err); }
.tag.pending, .tag.paid, .tag.tv_addon { background: var(--warn-soft); color: var(--warn); }

/* ---- Admin ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat b { display: block; font-size: 26px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--ink-2); font-size: 14px; }
.banner { padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 15px; display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.banner-ok { background: var(--ok-soft); color: var(--ok); }
.banner-error { background: var(--err-soft); color: var(--err); }
.banner span { color: var(--ink); }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-top: 10px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { color: var(--ink-2); font-weight: 600; font-size: 13px; background: var(--paper); }
.table tr:last-child td { border-bottom: 0; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; }
.inline-form input { width: 80px; margin: 0; padding: 6px 8px; font-size: 14px; }
.admin-form { display: grid; gap: 4px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); align-items: end; column-gap: 12px; }
.admin-form .btn { margin-top: 0; }
pre.out { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow: auto; font-size: 13px; }
.field-error { padding: 10px 12px; border-radius: 10px; font-size: 14px; background: var(--err-soft); color: var(--err); border: 1px solid var(--err); }
.field-error[hidden] { display: none; }

.container > .panel:not(.narrow) { max-width: 560px; margin-left: auto; margin-right: auto; }
