/* Zimax buy-data page. Self-hosted only: the walled garden blocks CDNs. */

:root {
  --bg: #071417;
  --bg-soft: #0e1f24;
  --line: #1b333a;
  --ink: #eaf6f7;
  --ink-dim: #93aeb4;
  --accent: #16b8bd;
  --accent-ink: #04262a;
  --gold: #f5a623;
  --price: #16b8bd;
  --warn: #f0a04b;
  --danger: #ff6b6b;
  --radius: 16px;
  --pad: 20px;
}

/* Light theme: same brand, inverted surfaces. */
[data-theme="light"] {
  --bg: #f4f9fa;
  --bg-soft: #ffffff;
  --line: #d9e6e9;
  --ink: #0d2227;
  --ink-dim: #5b7278;
  --accent: #0e8f96;
  --accent-ink: #ffffff;
  --gold: #b06d06;
  --price: #0b7d84;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background:
    radial-gradient(1200px 600px at 50% -20%, rgba(22, 184, 189, .12) 0%, transparent 60%),
    var(--bg);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}

.shell {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 28px 18px 40px;
}

/* ---------- header ---------- */

.head { margin-bottom: 22px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: .02em;
  font-size: 15px;
  color: var(--ink-dim);
  text-transform: uppercase;
}

.dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(22, 184, 189, .16);
}

.lede {
  margin: 10px 0 2px;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -.02em;
}

.account { margin: 4px 0 0; color: var(--ink-dim); font-size: 14px; }
.account strong { color: var(--ink); font-weight: 600; }

/* ---------- plans ---------- */

.plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* A lone plan in the last row takes the full width instead of a hole. */
.plans .plan:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* Plan chosen inside the Wi-Fi portal: highlighted, not locked. */
.plan.is-preselected {
  border-color: rgba(22, 184, 189, .55);
  box-shadow: 0 0 0 1px rgba(22, 184, 189, .25), 0 10px 30px -18px rgba(22, 184, 189, .7);
  background: linear-gradient(180deg, rgba(22, 184, 189, .07), transparent 60%), var(--bg-soft);
}

.preselect-note { color: var(--accent); }

/* Plan picked but not yet paid for: strong, persistent highlight. */
.plan.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(22, 184, 189, .35), 0 14px 34px -20px rgba(22, 184, 189, .9);
}

.plan.is-selected::after {
  content: "\2713";
  position: absolute;
  bottom: 10px;
  right: 12px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  border-radius: 50%;
  color: var(--accent-ink);
  background: var(--accent);
}

.plan.is-selected .plan-price { padding-right: 26px; }

/* Confirmation step */
.confirm-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.confirm-plan { margin: 0; font-size: 20px; font-weight: 700; }

.confirm-note {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--ink-dim);
  text-align: center;
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  padding: 16px 14px;
  min-height: 118px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: border-color .15s ease, transform .12s ease, background .15s ease;
  -webkit-tap-highlight-color: transparent;
}

.plan:active { transform: scale(.985); }
.plan:hover { border-color: #2b3a4b; }

.plan:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.plan:disabled { opacity: .5; cursor: default; }

/* The plan currently being paid for: different fill, no interaction. */
.plan.is-processing {
  opacity: 1;
  pointer-events: none;
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(22, 184, 189, .22), rgba(22, 184, 189, .07)), var(--bg-soft);
  box-shadow: 0 0 0 2px rgba(22, 184, 189, .38), 0 16px 34px -22px rgba(22, 184, 189, .95);
}

.plan.is-processing .plan-meta { color: var(--ink); }

.linkish {
  margin-top: 6px;
  padding: 0;
  font: inherit;
  font-size: 13.5px;
  color: var(--accent);
  background: none;
  border: 0;
  text-decoration: underline;
  cursor: pointer;
}

.plan-size { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.plan-meta { color: var(--ink-dim); font-size: 12.5px; }
.plan-price {
  margin-top: auto;
  padding-top: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--price);
}

.tag {
  position: absolute;
  top: 10px; right: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(245, 166, 35, .16);
  color: var(--gold);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.hint {
  margin: 16px 2px 0;
  font-size: 13.5px;
  color: var(--ink-dim);
}

/* ---------- cards ---------- */

.card {
  margin-top: 16px;
  padding: var(--pad);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.pay-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.pay-label {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.pay-amount { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.pay-timer { text-align: right; }
.pay-count { margin: 0; font-variant-numeric: tabular-nums; font-size: 20px; font-weight: 700; }
.pay-count.is-low { color: var(--warn); }
.pay-count.is-dead { color: var(--danger); }

.pay-deadline {
  margin: 2px 0 0;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--gold);
}

.acct { padding: 16px 0; }

.acct-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.acct-number {
  flex: 1;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: .06em;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.copy {
  flex: none;
  padding: 9px 13px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}

.copy:active { transform: scale(.97); }
.copy.is-copied { color: var(--accent); border-color: rgba(22, 184, 189, .5); }

.pay-bank { margin: 8px 0 0; color: var(--ink-dim); font-size: 14px; }

/* Deadline warning: the one thing a customer must not get wrong. */
.deadline-note {
  margin: 14px 0 0;
  padding: 11px 13px;
  border-left: 3px solid var(--gold);
  background: rgba(245, 166, 35, .10);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
}

.deadline-note strong {
  display: block;
  margin-bottom: 2px;
  color: var(--gold);
  font-size: 13.5px;
}

.steps {
  margin: 4px 0 0;
  padding-left: 20px;
  color: var(--ink-dim);
  font-size: 14px;
}

.steps li { margin: 8px 0; }
.steps strong { color: var(--ink); }

/* ---------- status ---------- */

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 14px;
}

.spinner {
  width: 14px; height: 14px;
  flex: none;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .18);
  border-top-color: var(--accent);
  animation: spin .9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.status[data-state="paid"] { border-color: rgba(22, 184, 189, .45); }
.status[data-state="paid"] .spinner { border-top-color: var(--accent); }
.status[data-state="failed"] { border-color: rgba(255, 107, 107, .45); }
.status[data-state="failed"] .spinner { display: none; }
.status[data-state="failed"] .status-text { color: #ffc2c2; }
.status[data-state="expired"] .spinner { display: none; }
.status[data-state="expired"] .status-text { color: var(--warn); }

.pay-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.ghost {
  flex: 1;
  min-width: 140px;
  padding: 12px 16px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}

.ghost:hover { border-color: #2b3a4b; }
.ghost:active { transform: scale(.985); }

/* ---------- done ---------- */

.done { text-align: center; }

.done-mark {
  width: 56px; height: 56px;
  margin: 4px auto 14px;
  display: grid;
  place-items: center;
  font-size: 26px;
  border-radius: 50%;
  color: var(--accent-ink);
  background: var(--accent);
  animation: pop .35s ease-out both;
}

@keyframes pop {
  from { transform: scale(.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.done h1 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.01em; }
.done p { margin: 0 0 6px; color: var(--ink-dim); font-size: 14.5px; }
.done-note { font-size: 13px; }

.primary {
  display: inline-block;
  margin-top: 12px;
  padding: 14px 22px;
  width: 100%;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  color: var(--accent-ink);
  background: var(--accent);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}

.primary:active { transform: scale(.99); }

.notice h1 { margin: 0 0 8px; font-size: 19px; }
.notice p { margin: 0; color: var(--ink-dim); font-size: 14.5px; }

/* ---------- misc ---------- */

.form-title { margin: 0 0 8px; font-size: 22px; letter-spacing: -.01em; }
.form-lede { margin: 0 0 18px; color: var(--ink-dim); font-size: 14.5px; }

.field {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.input {
  width: 100%;
  padding: 14px 14px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 14px;
}

.input:focus {
  outline: none;
  border-color: rgba(22, 184, 189, .6);
  box-shadow: 0 0 0 3px rgba(22, 184, 189, .12);
}

.form-msg { min-height: 20px; margin: 12px 0 0; font-size: 14px; color: var(--ink-dim); }
.form-msg.is-error { color: #ffc2c2; }

.demo-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 9px 16px;
  background: var(--warn);
  color: #241403;
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
}

.demo-bar code { font-size: 12px; }

.foot {
  margin-top: 28px;
  text-align: center;
  color: var(--ink-dim);
  font-size: 12px;
}

.noscript {
  margin: 24px 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink-dim);
  font-size: 14px;
}

[hidden] { display: none !important; }

/* ---------- brand header ---------- */

.head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.logo {
  display: block;
  width: auto;
  height: auto;
  max-height: 52px;
  max-width: min(72%, 260px);
  object-fit: contain;
}

.theme-toggle {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  font-size: 17px;
  line-height: 1;
  color: var(--ink);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  transition: border-color .15s ease, transform .12s ease;
}

.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle:active { transform: scale(.94); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- confirmation extras ---------- */

.confirm-duration {
  margin: 4px 0 0;
  font-size: 13.5px;
  color: var(--ink-dim);
}

.foot-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(22, 184, 189, .35);
}

.foot-link:hover { border-bottom-color: var(--accent); }

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