:root {
  --ink: #13211D;
  --paper: #F6F3EC;
  --card: #FFFFFF;
  --accent: #0E8B7B;
  --accent-bright: #2FD9C4;
  --accent-soft: #E3F3EF;
  --amber: #E2A034;
  --line: #E4DECD;
  --muted: #5C6E67;
  --faint: #8B978F;
  --danger: #8B4B3D;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Work Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font-family: inherit; }
input::placeholder { color: #A8A08D; }

.app {
  max-width: 460px;
  margin: 0 auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

.screen { display: flex; flex-direction: column; min-height: 100%; }

/* -- language switch (sits over every screen) -- */
.app { position: relative; }
.lang-switch {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + 22px); right: 18px; z-index: 10;
  display: flex; padding: 3px; gap: 2px; border-radius: 999px;
  background: var(--card); border: 1.5px solid var(--line);
}
.lang-switch button {
  border: 0; background: none; cursor: pointer; padding: 5px 10px; border-radius: 999px;
  font: 600 11.5px 'IBM Plex Mono', monospace; color: var(--muted); letter-spacing: 0.04em;
}
.lang-switch button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.lang-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.page-header { padding-right: 110px; }

/* -- header / brand -- */
.brand-header {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px 22px 20px;
  background: var(--ink);
}
.brand-row { display: flex; align-items: center; gap: 10px; }
.brand-word {
  font-family: 'Sora', sans-serif; font-weight: 800; font-size: 19px;
  letter-spacing: 0.2px; color: #fff;
}
.tagline { font-size: 13px; color: #B7C7C2; line-height: 1.4; }
.device-chip {
  display: inline-flex; align-self: flex-start; align-items: center; gap: 7px;
  padding: 6px 11px; background: rgba(47,217,196,0.12);
  border: 1px solid rgba(47,217,196,0.35); border-radius: 20px;
}
.device-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-bright); }
.device-chip span:last-child { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--accent-bright); }

.page-header {
  display: flex; align-items: center; gap: 12px; padding: 24px 22px 16px;
}
.page-title { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 17px; }
.icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px; background: var(--card);
  border: 1.5px solid var(--line); cursor: pointer;
}

/* -- sections -- */
.section { display: flex; flex-direction: column; gap: 12px; padding: 20px 22px 14px; }
.section-title { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 16px; }
.divider { height: 1px; background: var(--line); }
.spacer { flex-grow: 1; }
.fineprint { font-size: 11px; color: var(--faint); line-height: 1.5; }
.fineprint.center { text-align: center; padding-top: 4px; }

/* -- plans -- */
.plans-list { display: flex; flex-direction: column; gap: 12px; }
.plan-card {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 16px; border-radius: 14px; cursor: pointer;
  background: var(--card); border: 1.5px solid var(--line); text-align: left;
}
.plan-card, .network-pill { width: 100%; font: inherit; color: var(--ink); text-align: left; }
.plan-card.selected { background: var(--accent-soft); border-color: var(--accent); }
.timer-days { font-size: 13px; font-weight: 600; color: var(--accent); }
.plan-badge {
  position: absolute; top: -9px; left: 14px; padding: 2px 9px; background: var(--amber);
  color: var(--ink); font-weight: 600; font-size: 10px; letter-spacing: 0.4px;
  text-transform: uppercase; border-radius: 8px;
}
.plan-name { font-family: 'Sora', sans-serif; font-weight: 600; font-size: 15px; }
.plan-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.plan-price-col { display: flex; align-items: center; gap: 10px; }
.plan-was { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: #9A9484; text-decoration: line-through; text-align: right; }
.plan-price { font-family: 'IBM Plex Mono', monospace; font-weight: 600; font-size: 18px; font-variant-numeric: tabular-nums; text-align: right; }
.plan-dot {
  width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.plan-card.selected .plan-dot { border-color: var(--accent); background: var(--accent); }

/* -- login -- */
.link-btn { background: none; border: none; color: var(--accent); font-size: 13px; font-weight: 600; padding: 2px; cursor: pointer; text-align: left; }
.link-btn.muted { color: var(--muted); font-size: 12px; text-decoration: underline; font-weight: 400; align-self: flex-start; }
.login-form { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.login-title { font-family: 'Sora', sans-serif; font-weight: 600; font-size: 14px; }
.login-form label { font-size: 11px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; }
.login-form input { padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 14px; background: var(--card); }

/* -- buttons -- */
.btn-primary {
  padding: 16px; background: var(--accent); color: #fff; border: none; border-radius: 14px;
  font-family: 'Sora', sans-serif; font-weight: 700; font-size: 15px; cursor: pointer;
  text-decoration: none; text-align: center; display: block;
}
.btn-primary:disabled { opacity: 0.55; cursor: default; }
.btn-outline {
  padding: 14px; background: var(--card); color: var(--ink); border: 1.5px solid var(--ink);
  border-radius: 14px; font-weight: 600; font-size: 14px; cursor: pointer;
}
.sticky-cta { position: sticky; bottom: 0; padding: 16px 22px 22px; background: linear-gradient(180deg, rgba(246,243,236,0) 0%, var(--paper) 35%); }
.sticky-cta.stack { display: flex; flex-direction: column; gap: 10px; }
.btn-cta { display: flex; align-items: center; justify-content: center; gap: 8px; }

/* -- payment screen -- */
.order-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--ink); border-radius: 14px; color: #fff; }
.order-row { display: flex; align-items: center; justify-content: space-between; }
.order-plan { font-family: 'Sora', sans-serif; font-weight: 600; font-size: 15px; }
.order-sub { font-size: 12px; color: #8FA39C; margin-top: 2px; }
.order-price { font-family: 'IBM Plex Mono', monospace; font-weight: 600; font-size: 20px; color: var(--accent-bright); font-variant-numeric: tabular-nums; }
.order-divider { height: 1px; background: rgba(255,255,255,0.12); }
.order-device { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: #B7C7C2; }

.network-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.network-pill { display: flex; align-items: center; gap: 8px; padding: 12px; background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; }
.network-pill.selected { background: var(--accent-soft); border-color: var(--accent); }
.network-pill .dot { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--line); flex-shrink: 0; }
.network-pill.selected .dot { border-color: var(--accent); background: var(--accent); }
.network-pill span:last-child { font-size: 13px; font-weight: 500; }

.field-label { font-size: 11px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; }
.mono-input { padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 15px; background: var(--card); font-family: 'IBM Plex Mono', monospace; }

.pending-panel { display: flex; flex-direction: column; gap: 10px; padding: 18px 16px; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; align-items: center; text-align: center; }
.pending-title { font-family: 'Sora', sans-serif; font-weight: 600; font-size: 14px; }
.pending-body { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.error-text { font-size: 12.5px; color: var(--danger); text-align: center; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }

/* -- connected screen -- */
.success-header { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 22px 24px; }
.success-circle { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%; background: var(--accent-soft); border: 1.5px solid var(--accent); }
.success-title { font-family: 'Sora', sans-serif; font-weight: 800; font-size: 19px; }
.success-sub { font-size: 13px; color: var(--muted); }
.timer-section { align-items: center; text-align: center; }
.timer-label { font-size: 11px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: 0.6px; }
.timer { font-family: 'IBM Plex Mono', monospace; font-weight: 600; font-size: 44px; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.progress-track { width: 100%; max-width: 300px; height: 8px; background: var(--line); border-radius: 6px; overflow: hidden; margin-top: 4px; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 6px; width: 0%; }
.detail-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; }
.detail-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.detail-row span:first-child { color: var(--muted); font-size: 12.5px; }
.detail-row span:last-child { font-weight: 600; }

@media (max-width: 400px) {
  .timer { font-size: 38px; }
}
