@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900&family=JetBrains+Mono:wght@400;700&display=swap');

/* ─────────────────────────────────────────────────────────
   Mashinani Connect — Unified Stylesheet
   Mobile-first, captive-portal-optimised
───────────────────────────────────────────────────────── */

:root {
  --leaf:    #2f6b4f;
  --leaf-lt: rgba(47,107,79,.12);
  --sun:     #e2a23a;
  --clay:    #b86a3d;
  --text:    #1c241f;
  --muted:   #60716a;
  --border:  rgba(28,36,31,.12);
  --card-bg: rgba(255,251,243,.92);
  --shadow:  0 8px 32px rgba(0,0,0,.10);
  --surface-1: rgba(255,251,243,.88);
  --surface-2: rgba(255,251,243,.8);
  --radius:  20px;
  --radius-sm: 14px;
}

html[data-theme="dark"] {
  --leaf: #63b186;
  --leaf-lt: rgba(99,177,134,.18);
  --sun: #d6a34b;
  --clay: #d58e66;
  --text: #e7efe9;
  --muted: #a4b3aa;
  --border: rgba(231,239,233,.14);
  --card-bg: rgba(24,30,27,.92);
  --shadow: 0 10px 28px rgba(0,0,0,.35);
  --surface-1: rgba(22,29,26,.9);
  --surface-2: rgba(18,24,22,.86);
}

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

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

body {
  font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  background-color: #f1ede4;
  transition: background-color .2s ease, color .2s ease;
}

html[data-theme="dark"] body { background-color: #101513; }

a { color: var(--leaf); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Portal background ── */
.portal-body {
  background:
    radial-gradient(ellipse 120% 60% at 10% 0%, rgba(226,162,58,.18), transparent 60%),
    radial-gradient(ellipse 100% 60% at 90% 5%,  rgba(47,107,79,.14), transparent 55%),
    radial-gradient(ellipse 120% 80% at 50% 110%, rgba(184,106,61,.15), transparent 60%),
    linear-gradient(170deg, #fdf5e4 0%, #f5ead4 50%, #ede0c4 100%);
}

html[data-theme="dark"] .portal-body {
  background:
    radial-gradient(ellipse 120% 60% at 10% 0%, rgba(214,163,75,.15), transparent 60%),
    radial-gradient(ellipse 100% 60% at 90% 5%,  rgba(99,177,134,.14), transparent 55%),
    radial-gradient(ellipse 120% 80% at 50% 110%, rgba(140,95,70,.2), transparent 60%),
    linear-gradient(170deg, #121916 0%, #161f1a 50%, #101513 100%);
}

/* ── Wrapper ── */
.portal-wrap {
  max-width: 100%;
  margin: 0 auto;
  padding: 12px 14px 48px;
}

/* ── Two-column layout ── */
.portal-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

/* Mobile/tablet: prices first, info content below */
.form-col    { order: -1; }
.content-col { order:  1; }

/* ─── Tablet: single centred column, a bit wider ─────── */
@media (min-width: 600px) {
  .portal-wrap {
    max-width: 680px;
    padding: 16px 20px 60px;
  }
}

/* ─── Desktop: two columns, form sticky on right ──────── */
@media (min-width: 960px) {
  .portal-wrap {
    max-width: 1180px;
    padding: 20px 24px 60px;
  }
  .portal-layout {
    grid-template-columns: 1fr 420px;
    align-items: start;
    gap: 24px;
  }
  .form-col {
    position: sticky;
    top: 20px;
    order: 1;   /* restore right-side position on desktop */
  }
  .content-col { order: 0; }
  /* On desktop the status strip and hero are inside content-col — give them a bit more room */
  .portal-hero { padding: 26px 22px 20px; }
}

/* ─────────────────────────────────────────────
   TOP BAR
───────────────────────────────────────────── */
.portal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0,0,0,.07);
  margin-bottom: 14px;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-name { font-weight: 800; font-size: 15px; letter-spacing: -.015em; }
.brand-sub  { font-size: 11px; color: var(--muted); margin-top: 1px; }

.logo {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center; font-size: 18px; line-height: 1; flex-shrink: 0;
  background: linear-gradient(135deg, #e2a23a, #b86a3d);
  box-shadow: 0 6px 16px rgba(184,106,61,.28);
}

.admin-link {
  font-size: 12px; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle {
  font-size: 12px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.theme-toggle:hover {
  background: var(--leaf-lt);
  color: var(--text);
}

/* ─────────────────────────────────────────────
   HERO
───────────────────────────────────────────── */
.portal-hero {
  text-align: center;
  padding: 20px 16px 16px;
  margin-bottom: 14px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255,251,243,.95), rgba(255,248,235,.85));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

html[data-theme="dark"] .portal-hero {
  background: linear-gradient(160deg, rgba(26,35,31,.95), rgba(19,26,23,.88));
}

/* Animated signal bars */
.hero-signal {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  height: 28px;
  margin-bottom: 10px;
}
.signal-bar {
  width: 6px; border-radius: 3px;
  background: var(--leaf);
  animation: signal-pulse 1.4s ease-in-out infinite;
}
.signal-bar.b1 { height: 8px;  animation-delay: 0s; }
.signal-bar.b2 { height: 14px; animation-delay: 0.15s; }
.signal-bar.b3 { height: 20px; animation-delay: 0.30s; }
.signal-bar.b4 { height: 26px; animation-delay: 0.45s; }

@keyframes signal-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .35; }
}

.hero-title {
  font-size: clamp(22px, 3.5vw, 30px);
  font-weight: 900;
  letter-spacing: -.025em;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--leaf) 0%, #4a9a6e 45%, var(--sun) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub   { font-size: clamp(13px, 1.8vw, 15px); color: var(--muted); line-height: 1.65; }

/* ─────────────────────────────────────────────
   ALERT
───────────────────────────────────────────── */
.portal-alert {
  padding: 11px 14px; border-radius: var(--radius-sm);
  border: 1px solid rgba(184,106,61,.35);
  background: rgba(184,106,61,.1);
  color: var(--text); font-size: 14px;
  margin-bottom: 14px;
}

/* ─────────────────────────────────────────────
   STEP BLOCKS
───────────────────────────────────────────── */
.step-block {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}

.step-hd {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 14px;
}

.step-num {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  font-weight: 900; font-size: 13px; color: white;
  background: linear-gradient(135deg, var(--leaf), #4a9a6e);
}

/* ─────────────────────────────────────────────
   PACKAGE CARDS
───────────────────────────────────────────── */
.pkg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pkg-radio { display: none; } /* hidden, label is the clickable area */

/* Always 2-col for packages regardless of screen width */
@media (min-width: 960px) {
  .pkg-grid { grid-template-columns: 1fr 1fr; }
}

.pkg-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  border-radius: 16px;
  border: 2px solid transparent;
  background: rgba(255,255,255,.65);
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s, transform .1s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.pkg-card:hover {
  border-color: rgba(47,107,79,.35);
  background: rgba(255,255,255,.85);
  box-shadow: 0 4px 16px rgba(47,107,79,.10);
}
.pkg-card:active { transform: scale(.98); }

/* Selected state */
.pkg-card:has(.pkg-radio:checked) {
  border-color: var(--leaf);
  background: rgba(47,107,79,.08);
  box-shadow: 0 0 0 3px rgba(47,107,79,.15), 0 4px 20px rgba(47,107,79,.12);
}

/* Checkmark badge */
.pkg-check {
  position: absolute;
  top: -7px; right: -7px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--leaf);
  display: none;
  place-items: center;
  box-shadow: 0 2px 8px rgba(47,107,79,.35);
}
.pkg-card:has(.pkg-radio:checked) .pkg-check { display: grid; }

/* Left accent line */
.pkg-card::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  border-radius: 16px 0 0 16px;
  background: linear-gradient(180deg, var(--leaf), var(--sun));
  opacity: .7;
}
.pkg-card:has(.pkg-radio:checked)::before { opacity: 1; }

.pkg-icon { font-size: 20px; flex-shrink: 0; }

.pkg-body { flex: 1; min-width: 0; }
.pkg-name { font-weight: 800; font-size: 13px; line-height: 1.2; margin-bottom: 3px; }
.pkg-dur  { font-size: 11px; color: var(--muted); }
.pkg-unlimited { color: var(--leaf); font-weight: 700; }

.pkg-price {
  font-weight: 900; font-size: 13px;
  white-space: nowrap;
  padding: 4px 9px; border-radius: 999px;
  background: var(--surface-1);
  border: 1px solid var(--border);
}
.pkg-card:has(.pkg-radio:checked) .pkg-price {
  background: var(--leaf);
  color: white;
  border-color: transparent;
}

/* ─────────────────────────────────────────────
   BUY PANEL (step 2)
───────────────────────────────────────────── */
.buy-panel {
  display: none;
}
.buy-panel.visible {
  display: block;
}

.selected-summary {
  background: rgba(47,107,79,.07);
  border: 1px solid rgba(47,107,79,.18);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sel-row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.sel-label { color: var(--muted); }
.sel-price { font-weight: 900; color: var(--leaf); font-size: 16px; }

.phone-field { margin-bottom: 14px; }
.phone-field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }

.phone-wrap {
  display: flex;
  align-items: center;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.phone-wrap:focus-within {
  border-color: rgba(47,107,79,.6);
  box-shadow: 0 0 0 4px rgba(47,107,79,.12);
}
.phone-prefix {
  padding: 12px 10px 12px 14px;
  font-size: 14px; color: var(--muted);
  border-right: 1px solid var(--border);
  background: rgba(47,107,79,.04);
  white-space: nowrap;
}
.phone-wrap input {
  border: 0; outline: 0;
  padding: 12px 14px;
  font-size: 16px; /* prevents zoom on iOS */
  font-family: inherit;
  background: transparent;
  color: var(--text);
  width: 100%;
}

/* Pay button */
.buy-btn {
  width: 100%;
  padding: 14px;
  border: 0; border-radius: 16px;
  background: linear-gradient(135deg, #2f6b4f, #4a9a6e 60%, #e2a23a);
  color: white;
  font-weight: 900; font-size: 16px; font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(47,107,79,.25);
  transition: filter .15s, transform .1s;
  text-decoration: none;
}
.buy-btn:hover { filter: brightness(1.05); text-decoration: none; }
.buy-btn:active { transform: translateY(1px); }
.btn-price {
  background: rgba(255,255,255,.22);
  padding: 3px 10px; border-radius: 999px; font-size: 14px;
}

.pay-note { margin-top: 8px; font-size: 12px; color: var(--muted); text-align: center; }

/* ─────────────────────────────────────────────
   HOW IT WORKS STRIP
───────────────────────────────────────────── */
.how-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255,251,243,.6);
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.how-step { display: flex; align-items: center; gap: 7px; }
.how-num {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  font-weight: 900; font-size: 12px; color: white;
  background: linear-gradient(135deg, var(--leaf), #4a9a6e);
}
.how-text { font-size: 12px; color: var(--muted); }
.how-arrow { font-size: 18px; color: var(--muted); opacity: .5; }

/* ─────────────────────────────────────────────
   CONNECTED / SUCCESS PAGE
───────────────────────────────────────────── */
.connected-body {
  background:
    radial-gradient(ellipse 140% 70% at 50% -10%, rgba(47,107,79,.22), transparent 55%),
    radial-gradient(ellipse 100% 60% at 0% 90%,   rgba(226,162,58,.18), transparent 55%),
    linear-gradient(170deg, #f0f9f4 0%, #e8f5ec 40%, #f5ead4 100%);
}

html[data-theme="dark"] .connected-body {
  background:
    radial-gradient(ellipse 140% 70% at 50% -10%, rgba(99,177,134,.25), transparent 55%),
    radial-gradient(ellipse 100% 60% at 0% 90%, rgba(214,163,75,.18), transparent 55%),
    linear-gradient(170deg, #102019 0%, #17241f 42%, #121916 100%);
}

.connected-hero {
  text-align: center;
  padding: 28px 16px 20px;
  margin-bottom: 14px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(47,107,79,.08), rgba(255,251,243,.9));
  border: 1px solid rgba(47,107,79,.2);
  box-shadow: var(--shadow);
}

html[data-theme="dark"] .connected-hero {
  background: linear-gradient(160deg, rgba(36,56,46,.35), rgba(22,30,27,.92));
}

.connected-ring {
  width: 80px; height: 80px;
  border-radius: 50%;
  margin: 0 auto 14px;
  background: linear-gradient(135deg, #2f6b4f, #4a9a6e);
  display: grid; place-items: center;
  box-shadow: 0 12px 32px rgba(47,107,79,.35);
  animation: pop-in .5s cubic-bezier(.175,.885,.32,1.275) forwards;
}

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

.connected-icon { display: flex; }

.connected-title {
  font-size: 26px; font-weight: 900; margin-bottom: 6px;
  color: var(--leaf);
}
.connected-sub { font-size: 14px; color: var(--muted); }

.countdown-wrap { margin-top: 16px; }
.countdown-label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 4px; }
.countdown-timer {
  font-family: 'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace;
  font-size: 40px; font-weight: 700; letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
  color: var(--leaf);
}
.countdown-timer.expired { color: var(--clay); font-size: 20px; }

/* Voucher code card */
.voucher-card {
  background: linear-gradient(135deg, rgba(47,107,79,.06), rgba(255,251,243,.9));
  border: 2px dashed rgba(47,107,79,.4);
  border-radius: var(--radius);
  padding: 18px 16px;
  text-align: center;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

html[data-theme="dark"] .voucher-card {
  background: linear-gradient(135deg, rgba(99,177,134,.14), rgba(20,28,25,.9));
}
.voucher-card-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.voucher-card-code {
  font-family: 'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace;
  font-size: 34px; font-weight: 700; letter-spacing: 6px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  margin-bottom: 8px;
}
.voucher-card-hint { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* Detail card (reused on success + pending) */
.detail-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: 0 4px 14px rgba(0,0,0,.06);
}
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--muted); }
.expires-val { font-weight: 700; }

/* Reconnect details box */
.reconnect-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  overflow: hidden;
}
.reconnect-box summary {
  padding: 12px 16px;
  font-size: 14px; font-weight: 600;
  cursor: pointer; list-style: none;
  color: var(--leaf);
}
.reconnect-box summary::-webkit-details-marker { display: none; }
.reconnect-box ol {
  padding: 0 16px 14px 32px;
  font-size: 13px; color: var(--muted); line-height: 1.7;
}

.back-link {
  display: block;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 16px;
}

/* ─────────────────────────────────────────────
   WAITING / PENDING PAGE
───────────────────────────────────────────── */
.waiting-hero {
  text-align: center;
  padding: 28px 16px 20px;
  margin-bottom: 14px;
  border-radius: var(--radius);
  background: var(--card-bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.waiting-ring {
  width: 80px; height: 80px; border-radius: 50%;
  margin: 0 auto 14px;
  position: relative;
  display: grid; place-items: center;
}
.waiting-spinner {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 4px solid rgba(47,107,79,.15);
  border-top-color: var(--leaf);
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.waiting-phone { font-size: 32px; }

.waiting-title { font-size: 22px; font-weight: 900; margin-bottom: 8px; }
.waiting-sub   { font-size: 14px; color: var(--muted); line-height: 1.6; }

.waiting-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: 12px;
}
.ws { display: flex; align-items: center; gap: 6px; }
.ws-num {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  font-weight: 900; font-size: 11px;
  background: rgba(0,0,0,.08); color: var(--muted);
}
.ws-num.done  { background: var(--leaf); color: white; }
.ws-num.pulse { background: var(--sun);  color: white; animation: beat .8s ease-in-out infinite; }
@keyframes beat { 0%,100% { transform: scale(1); } 50% { transform: scale(1.15); } }
.ws-text { color: var(--muted); }
.ws-line { width: 24px; height: 2px; background: var(--border); flex-shrink: 0; }

.waiting-note { font-size: 13px; color: var(--muted); text-align: center; line-height: 1.6; }

.fail-icon {
  width: 80px; height: 80px; border-radius: 50%;
  margin: 0 auto 14px;
  display: grid; place-items: center;
  font-size: 32px; font-weight: 900; color: white;
  background: linear-gradient(135deg, #b86a3d, #c0392b);
  box-shadow: 0 12px 32px rgba(184,106,61,.3);
}

/* ─────────────────────────────────────────────
   STATUS STRIP
───────────────────────────────────────────── */
.status-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  background: rgba(47,107,79,.07);
  border: 1px solid rgba(47,107,79,.18);
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,.2);
  flex-shrink: 0;
  animation: glow 2s ease-in-out infinite;
}
@keyframes glow {
  0%,100% { box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
  50%      { box-shadow: 0 0 0 5px rgba(34,197,94,.3); }
}
.status-text { color: var(--leaf); font-weight: 600; }
.status-sep  { color: var(--border); }

/* ─────────────────────────────────────────────
   TRUST CHIPS
───────────────────────────────────────────── */
.trust-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  justify-content: center;
}
.trust-chip {
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(47,107,79,.10);
  border: 1px solid rgba(47,107,79,.22);
  color: var(--text);
}

/* ─────────────────────────────────────────────
   SECTION BLOCKS (What you get, FAQ, etc.)
───────────────────────────────────────────── */
.section-block {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.section-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--leaf);
  margin-bottom: 16px;
  padding-left: 10px;
  border-left: 3px solid var(--leaf);
}

/* ─────────────────────────────────────────────
   PERKS GRID
───────────────────────────────────────────── */
.perks-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 480px) {
  .perks-grid { grid-template-columns: 1fr 1fr; }
}
/* On a wide content column, 3 columns fits nicely */
@media (min-width: 960px) {
  .perks-grid { grid-template-columns: 1fr 1fr 1fr; }
}
.perk {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.perk-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--leaf-lt), rgba(226,162,58,.08));
  border-radius: 12px;
  border: 1px solid rgba(47,107,79,.16);
  box-shadow: 0 2px 8px rgba(47,107,79,.08);
}
.perk-name { font-weight: 700; font-size: 14px; margin-bottom: 3px; }
.perk-sub  { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ─────────────────────────────────────────────
   VERTICAL HOW IT WORKS
───────────────────────────────────────────── */
.how-steps { display: flex; flex-direction: column; gap: 0; }

.how-step-v {
  display: grid;
  grid-template-columns: 26px 2px 1fr;
  gap: 0 12px;
  padding-bottom: 20px;
}
.how-step-v:last-child { padding-bottom: 0; }

.how-num {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 900; font-size: 13px; color: white;
  background: linear-gradient(135deg, var(--leaf), #4a9a6e);
  grid-row: 1;
  align-self: start;
}
.how-line {
  grid-column: 2;
  grid-row: 1 / 3;
  background: linear-gradient(180deg, var(--leaf), rgba(47,107,79,.15));
  width: 2px;
  margin: 26px auto 0;
  border-radius: 2px;
}
.how-line.last { background: transparent; }

.how-content {
  grid-column: 3;
  grid-row: 1;
  padding-top: 2px;
}
.how-head { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.how-body { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* ─────────────────────────────────────────────
   FAQ
───────────────────────────────────────────── */
.faq { display: flex; flex-direction: column; }

.faq-item {
  border-bottom: 1px solid var(--border);
}
.faq-item:last-child { border-bottom: none; }

.faq-item summary {
  padding: 13px 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 18px;
  color: var(--leaf);
  font-weight: 300;
  flex-shrink: 0;
  transition: transform .2s;
}
.faq-item[open] summary::after {
  transform: rotate(45deg);
}
.faq-item p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  padding: 0 4px 14px;
}

/* ─────────────────────────────────────────────
   FOOTER
───────────────────────────────────────────── */
.portal-footer-block {
  text-align: center;
  padding: 10px 0 0;
}
.footer-support {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.footer-support-label { font-size: 13px; color: var(--muted); }
.footer-support-phone {
  font-size: 15px;
  font-weight: 700;
  color: var(--leaf);
}

.portal-footer {
  display: flex; justify-content: space-between; flex-wrap: wrap;
  gap: 6px; font-size: 12px; color: var(--muted);
  padding-top: 8px;
}

/* ─────────────────────────────────────────────
   STATUS BADGES (used in admin)
───────────────────────────────────────────── */
.status-badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .3px;
}
.status-paid    { background: rgba(47,107,79,.12); color: #1a5c37; border: 1px solid rgba(47,107,79,.25); }
.status-pending { background: rgba(226,162,58,.15); color: #7a5a10; border: 1px solid rgba(226,162,58,.35); }
.status-failed  { background: rgba(184,106,61,.12); color: #7a3010; border: 1px solid rgba(184,106,61,.25); }
.status-offline { background: rgba(100,100,100,.1);  color: #555;    border: 1px solid rgba(100,100,100,.2); }
.status-active  { background: rgba(47,107,79,.12); color: #1a5c37; border: 1px solid rgba(47,107,79,.25); }
.status-used    { background: rgba(100,100,100,.1);  color: #555;    border: 1px solid rgba(100,100,100,.2); }

/* ─────────────────────────────────────────────
   ADMIN PANEL
───────────────────────────────────────────── */
.admin-page {
  background: #edeae5;
  min-height: 100vh;
}

html[data-theme="dark"] .admin-page {
  background: #101513;
}
.admin-wrap { max-width: 1300px; margin: 0 auto; padding: 20px 16px 60px; }

.admin-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-radius: 20px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  box-shadow: 0 4px 14px rgba(0,0,0,.07);
  margin-bottom: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 4px 14px rgba(0,0,0,.06);
}
.stat-card-warn { border-color: rgba(226,162,58,.5); background: rgba(255,248,220,.9); }
.stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px; }
.stat-value { font-size: 22px; font-weight: 900; }

.filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-label { font-size: 12px; color: var(--muted); }
.filter-btn {
  font-size: 12px; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--muted); text-decoration: none;
}
.filter-btn.active { background: var(--leaf); color: white; border-color: var(--leaf); }
.filter-btn:hover:not(.active) { background: var(--leaf-lt); text-decoration: none; }

.table-wrap {
  background: var(--surface-1);
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 14px rgba(0,0,0,.06);
  overflow-x: auto;
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead { background: rgba(47,107,79,.05); }
th {
  text-align: left; padding: 12px 14px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .4px;
  color: var(--muted); border-bottom: 1px solid var(--border); white-space: nowrap;
}
td { padding: 10px 14px; border-bottom: 1px solid rgba(28,36,31,.05); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(47,107,79,.03); }
.row-used td { opacity: .5; }
.muted { color: var(--muted); }
.small-text { font-size: 12px; }

.voucher-code-sm {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px; font-weight: 700; letter-spacing: 1px;
  background: var(--leaf-lt);
  padding: 3px 8px; border-radius: 6px;
}

.btn-revoke {
  padding: 4px 10px; border: 1px solid rgba(184,106,61,.35);
  border-radius: 8px; background: rgba(184,106,61,.1);
  color: #7a3010; font-size: 12px; cursor: pointer; font-family: inherit;
}
.btn-revoke:hover { background: rgba(184,106,61,.2); }

.btn-secondary {
  padding: 7px 14px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface-1);
  color: var(--muted); font-size: 13px; cursor: pointer; font-family: inherit;
}
.btn-secondary:hover { background: rgba(0,0,0,.06); }

.pagination { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.page-btn {
  width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-1); font-size: 13px; color: var(--text);
  text-decoration: none;
}
.page-btn.active { background: var(--leaf); color: white; border-color: var(--leaf); }

/* ── Sub-brand in admin topbar ── */
.sub-brand { font-size: 11px; font-weight: 400; color: var(--muted); }

html[data-theme="dark"] .pkg-card {
  background: rgba(29,38,34,.75);
}
html[data-theme="dark"] .pkg-card:hover {
  background: rgba(36,47,42,.88);
}
html[data-theme="dark"] .phone-prefix {
  background: rgba(99,177,134,.1);
}
html[data-theme="dark"] .trust-chip {
  background: rgba(99,177,134,.18);
  border-color: rgba(99,177,134,.30);
}
html[data-theme="dark"] .how-strip,
html[data-theme="dark"] .status-strip,
html[data-theme="dark"] .selected-summary {
  background: rgba(99,177,134,.14);
}
html[data-theme="dark"] .stat-card-warn {
  background: rgba(214,163,75,.12);
}
html[data-theme="dark"] thead {
  background: rgba(99,177,134,.12);
}
html[data-theme="dark"] tbody tr:hover {
  background: rgba(99,177,134,.08);
}
html[data-theme="dark"] .btn-secondary:hover {
  background: rgba(255,255,255,.1);
}
html[data-theme="dark"] .status-sep {
  color: rgba(231,239,233,.26);
}
html[data-theme="dark"] .status-pending {
  color: #f2c369;
}
html[data-theme="dark"] .status-failed {
  color: #e7a283;
}
html[data-theme="dark"] .status-offline,
html[data-theme="dark"] .status-used {
  color: #b8c4bd;
}

.login-theme-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

/* ─────────────────────────────────────────────
   ADMIN LOGIN PAGE
───────────────────────────────────────────── */
.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 16px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--card-bg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.login-theme-bar {
  padding: 14px 16px 0;
  display: flex;
  justify-content: flex-end;
}
.login-header {
  text-align: center;
  padding: 20px 24px 0;
}
.login-logo {
  width: 56px; height: 56px;
  border-radius: 18px;
  margin: 0 auto 14px;
  font-size: 26px; line-height: 1;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #e2a23a, #b86a3d);
  box-shadow: 0 8px 20px rgba(184,106,61,.28);
}
.login-title {
  font-size: 22px; font-weight: 900;
  margin: 0 0 5px;
  letter-spacing: -.025em;
}
.login-sub {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.login-body {
  padding: 20px 24px 28px;
}
.login-error {
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid rgba(184,106,61,.35);
  background: rgba(184,106,61,.1);
  font-size: 14px;
  margin-bottom: 14px;
}
.login-field { margin-bottom: 16px; }
.login-field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: .3px;
  margin-bottom: 7px;
}
.login-field input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
}
.login-field input:focus {
  outline: none;
  border-color: rgba(47,107,79,.6);
  box-shadow: 0 0 0 4px rgba(47,107,79,.12);
}
.login-btn {
  width: 100%;
  padding: 13px 14px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--leaf), #4a9a6e);
  color: white;
  font-weight: 800;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(47,107,79,.28);
  transition: filter .15s, transform .1s;
  letter-spacing: .01em;
}
.login-btn:hover { filter: brightness(1.06); }
.login-btn:active { transform: translateY(1px); }
.login-back {
  display: block;
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
}

/* ─────────────────────────────────────────────
   UI POLISH LAYER
───────────────────────────────────────────── */

.portal-wrap,
.admin-wrap {
  animation: page-enter .45s ease both;
}

@keyframes page-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Strong, consistent keyboard focus */
a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible,
.pkg-card:focus-within,
.filter-btn:focus-visible,
.page-btn:focus-visible,
.theme-toggle:focus-visible,
.admin-link:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(47,107,79,.23);
  border-radius: 12px;
}

html[data-theme="dark"] a:focus-visible,
html[data-theme="dark"] button:focus-visible,
html[data-theme="dark"] input:focus-visible,
html[data-theme="dark"] summary:focus-visible,
html[data-theme="dark"] .pkg-card:focus-within,
html[data-theme="dark"] .filter-btn:focus-visible,
html[data-theme="dark"] .page-btn:focus-visible,
html[data-theme="dark"] .theme-toggle:focus-visible,
html[data-theme="dark"] .admin-link:focus-visible {
  box-shadow: 0 0 0 3px rgba(99,177,134,.32);
}

.portal-topbar,
.admin-topbar {
  position: sticky;
  top: 10px;
  z-index: 20;
}

.step-block,
.section-block,
.detail-card,
.voucher-card,
.waiting-hero,
.connected-hero,
.stat-card {
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .step-block:hover,
  .section-block:hover,
  .detail-card:hover,
  .voucher-card:hover,
  .waiting-hero:hover,
  .connected-hero:hover,
  .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0,0,0,.14);
  }
}

.connected-title,
.waiting-title {
  letter-spacing: -.025em;
}

.hero-sub,
.waiting-sub,
.connected-sub,
.perk-sub,
.how-body,
.faq-item p {
  max-width: 65ch;
  margin-inline: auto;
}

/* ── Mobile-first refinements (< 600px) ── */
@media (max-width: 599px) {
  /* Form col (prices) sits on top — give it breathing room */
  .form-col { margin-bottom: 12px; }

  /* Status strip: wrap onto two lines instead of overflowing */
  .status-strip {
    flex-wrap: wrap;
    gap: 4px 10px;
    font-size: 11px;
    padding: 8px 12px;
  }
  .status-sep { display: none; }   /* hide the · separators between wrapped items */

  /* Hero: tighter on small screens */
  .portal-hero { padding: 18px 14px 14px; }
  .hero-title  { font-size: clamp(20px, 5.5vw, 26px); }

  /* Section blocks: less padding */
  .section-block,
  .step-block { padding: 14px 12px; }

  /* Topbar: hide label text, just show icon for theme toggle */
  [data-theme-label] { display: none; }
  .theme-toggle { padding: 7px 9px; min-width: 0; }

  /* Trust chips: allow them to wrap */
  .trust-chips { gap: 6px; }
  .trust-chip  { font-size: 11px; padding: 4px 10px; }

  /* Perks: single column on phones */
  .perks-grid { grid-template-columns: 1fr; gap: 10px; }

  /* Package cards: single column on phones */
  .pkg-grid { grid-template-columns: 1fr; }
}

/* Tiny phones (< 390px) */
@media (max-width: 390px) {
  .portal-wrap  { padding: 10px 10px 40px; }
  .portal-topbar { padding: 8px 10px; }
  .topbar-actions { gap: 6px; }
  .admin-link { padding: 6px 9px; font-size: 11px; }
}

/* Admin clarity */
.badge {
  font-size: 12px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  text-decoration: none;
}
.badge:hover {
  text-decoration: none;
  background: var(--leaf-lt);
  color: var(--text);
}

.table-wrap {
  max-height: 68vh;
}

thead {
  position: sticky;
  top: 0;
  z-index: 3;
}

tbody tr:nth-child(even):not(.row-used) {
  background: rgba(0,0,0,.012);
}

html[data-theme="dark"] tbody tr:nth-child(even):not(.row-used) {
  background: rgba(255,255,255,.02);
}

.filter-btn,
.page-btn,
.btn-secondary,
.btn-revoke,
.badge,
.theme-toggle,
.admin-link,
.buy-btn {
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .12s ease, box-shadow .18s ease;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─────────────────────────────────────────────
   DARK MODE
───────────────────────────────────────────── */
[data-theme="dark"] {
  --leaf:    #4ade80;
  --leaf-lt: rgba(74,222,128,.12);
  --sun:     #fbbf24;
  --clay:    #f97316;
  --text:    #f0ece3;
  --muted:   #9ca3af;
  --border:  rgba(255,255,255,.1);
  --card-bg: rgba(28,32,26,.92);
  --shadow:  0 8px 32px rgba(0,0,0,.35);
}

[data-theme="dark"] .portal-body {
  background:
    radial-gradient(ellipse 120% 60% at 10% 0%, rgba(74,222,128,.08), transparent 60%),
    radial-gradient(ellipse 100% 60% at 90% 5%,  rgba(74,222,128,.06), transparent 55%),
    linear-gradient(170deg, #0f1a12 0%, #111a14 50%, #0d1510 100%);
}

[data-theme="dark"] .connected-body {
  background:
    radial-gradient(ellipse 140% 70% at 50% -10%, rgba(74,222,128,.1), transparent 55%),
    linear-gradient(170deg, #0d1a10 0%, #0f1f13 50%, #121a10 100%);
}

[data-theme="dark"] body.admin-page {
  background: #0f1210;
}

[data-theme="dark"] .portal-topbar,
[data-theme="dark"] .admin-topbar {
  background: rgba(18,22,17,.88);
}

[data-theme="dark"] .portal-hero {
  background: linear-gradient(160deg, rgba(18,28,20,.95), rgba(22,32,24,.85));
}

[data-theme="dark"] .step-block,
[data-theme="dark"] .section-block,
[data-theme="dark"] .detail-card,
[data-theme="dark"] .voucher-card,
[data-theme="dark"] .reconnect-box,
[data-theme="dark"] .waiting-hero,
[data-theme="dark"] .connected-hero,
[data-theme="dark"] .table-wrap,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .footer-support {
  background: rgba(22,28,22,.9);
  border-color: rgba(255,255,255,.08);
}

[data-theme="dark"] .pkg-card {
  background: rgba(28,36,28,.7);
  border-color: transparent;
}
[data-theme="dark"] .pkg-card:hover { background: rgba(35,46,35,.9); }
[data-theme="dark"] .pkg-card:has(.pkg-radio:checked) {
  background: rgba(74,222,128,.1);
  border-color: #4ade80;
  box-shadow: 0 0 0 3px rgba(74,222,128,.15);
}
[data-theme="dark"] .pkg-price { background: rgba(18,24,18,.9); }
[data-theme="dark"] .pkg-card:has(.pkg-radio:checked) .pkg-price { background: #4ade80; color: #0f1a12; }

[data-theme="dark"] .selected-summary { background: rgba(74,222,128,.07); border-color: rgba(74,222,128,.2); }
[data-theme="dark"] .phone-wrap { background: rgba(28,36,28,.7); border-color: rgba(255,255,255,.1); }
[data-theme="dark"] .phone-prefix { background: rgba(74,222,128,.06); }
[data-theme="dark"] .phone-wrap input { color: #f0ece3; }

[data-theme="dark"] .status-strip { background: rgba(74,222,128,.06); border-color: rgba(74,222,128,.15); }

[data-theme="dark"] .perk-icon { background: rgba(74,222,128,.1); }
[data-theme="dark"] .trust-chip { background: rgba(255,255,255,.07); }

[data-theme="dark"] select,
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="tel"] {
  background: rgba(28,36,28,.7);
  border-color: rgba(255,255,255,.1);
  color: #f0ece3;
}
[data-theme="dark"] select:focus,
[data-theme="dark"] input:focus {
  border-color: #4ade80;
  box-shadow: 0 0 0 4px rgba(74,222,128,.12);
}

[data-theme="dark"] .faq-item { border-color: rgba(255,255,255,.08); }
[data-theme="dark"] .faq-item summary { color: #f0ece3; }

[data-theme="dark"] thead { background: rgba(74,222,128,.05); }
[data-theme="dark"] td { border-color: rgba(255,255,255,.05); }
[data-theme="dark"] tbody tr:hover { background: rgba(74,222,128,.03); }

[data-theme="dark"] .filter-btn { background: rgba(22,28,22,.9); color: #9ca3af; }
[data-theme="dark"] .filter-btn.active { background: #4ade80; color: #0f1a12; }
[data-theme="dark"] .page-btn { background: rgba(22,28,22,.9); color: #f0ece3; }
[data-theme="dark"] .page-btn.active { background: #4ade80; color: #0f1a12; }

[data-theme="dark"] .btn-secondary { background: rgba(22,28,22,.9); color: #9ca3af; border-color: rgba(255,255,255,.1); }
[data-theme="dark"] .how-strip { background: rgba(22,28,22,.6); }

[data-theme="dark"] .admin-link,
[data-theme="dark"] .badge { background: rgba(22,28,22,.9); color: #9ca3af; }

/* ── Theme toggle button ── */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
.theme-toggle:hover { background: var(--leaf-lt); }
[data-theme="dark"] .theme-toggle { color: #9ca3af; }
[data-theme="dark"] .theme-toggle:hover { background: rgba(74,222,128,.1); }

/* Login page dark mode */
[data-theme="dark"] .login-wrap { background: #0f1210; }
[data-theme="dark"] .login-card { background: rgba(22,28,22,.96); border-color: rgba(255,255,255,.08); }
