/* The billing portal's own stylesheet.
 *
 * A SEPARATE ARTIFACT, SO A SEPARATE TOKEN FILE. The app's design tokens live
 * in `global.css` / `tailwind.config.js` and are consumed through NativeWind,
 * which does not exist here; `06`'s 1:1 mockup rule does not reach this page
 * either, because `02` S-15.5 is explicit that the portal is "a web journey,
 * not an app screen" and the gallery draws no frame for it. The colour values
 * below are copied from `global.css` lines 13-20 (light) and 37-44 (dark) so an
 * owner arriving from the app does not land somewhere that looks like a
 * different company. They are the only values in this file, declared once at
 * the top, which is the same discipline the `tokens-only` rule enforces on the
 * app: no raw hex anywhere below this block.
 *
 * SYSTEM FONTS ON PURPOSE. The app ships Plus Jakarta Sans; a web font here
 * would be a render-blocking download on an EDGE connection for a page whose
 * whole job is one form. Legibility beats brand continuity on this surface.
 */

:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --border: #e2e8f0;
  --primary: #2563eb;
  --on-primary: #ffffff;
  --primary-pressed: #1d4ed8;
  --danger: #dc2626;
  --focus: #2563eb;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1428;
    --surface: #14213e;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #263457;
    --primary: #3b82f6;
    --on-primary: #0a1428;
    --primary-pressed: #60a5fa;
    --danger: #f87171;
    --focus: #60a5fa;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 1.5rem 1.25rem 3rem;
  background: var(--bg);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.5;
}

main {
  max-width: 26rem;
  margin: 0 auto;
}

h1 {
  margin: 0 0 0.25rem;
  font-size: 1.65rem;
  line-height: 1.25;
}

.lede {
  margin: 0 0 1.5rem;
  color: var(--text-secondary);
}

/* The two TPL-26 not-usable lines. Deliberately NOT styled as an error: they
 * are recoveries, the owner did nothing wrong, and the passcode form sits
 * directly beneath. Neutral surface, no red, no icon. */
.notice {
  margin: 0 0 1.5rem;
  padding: 0.875rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  color: var(--text-secondary);
}

.confirmation {
  margin: 0;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  font-size: 1.15rem;
}

label {
  display: block;
  margin: 1rem 0 0.375rem;
  font-weight: 600;
}

input {
  display: block;
  width: 100%;
  padding: 0.8rem 0.9rem;
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  /* 17px keeps iOS Safari from zooming the viewport on focus, which on a phone
   * reads as the page jumping when the owner taps the passcode field. */
  font-size: 17px;
  font-family: inherit;
}

input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

button {
  width: 100%;
  margin-top: 1.5rem;
  padding: 0.9rem 1rem;
  background: var(--primary);
  color: var(--on-primary);
  border: none;
  border-radius: 999px;
  font-size: 17px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  /* 44px is the minimum comfortable touch target; the padding above clears it,
   * and this floor keeps it true if the font ever shrinks. */
  min-height: 44px;
}

button:active {
  background: var(--primary-pressed);
}

button[disabled] {
  opacity: 0.55;
  cursor: default;
}

.error {
  margin: 0.875rem 0 0;
  color: var(--danger);
}

.error[hidden] {
  display: none;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.safe-exit {
  display: inline-block;
  margin: 0 0 1.5rem;
  color: var(--text-secondary);
  font-weight: 650;
}

.primary-link {
  display: block;
  min-height: 48px;
  margin-top: 1.5rem;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 750;
  text-align: center;
  text-decoration: none;
}

.progress {
  display: grid;
  gap: 0.4rem;
  margin: 1.5rem 0;
  padding: 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
  list-style: none;
}

.progress li::before {
  content: "○";
  margin-right: 0.5rem;
}

.progress .done::before {
  content: "✓";
  color: var(--primary);
}

.progress .current {
  color: var(--text-primary);
  font-weight: 700;
}

.method-list,
.plan-list {
  display: grid;
  gap: 0.75rem;
}

.method-card,
.plan-card {
  display: grid;
  gap: 0.3rem;
  min-height: 96px;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: var(--surface);
  color: var(--text-primary);
  text-decoration: none;
}

.method-card span,
.plan-card span,
.fine-print,
.status-copy {
  color: var(--text-secondary);
}

.method-card b {
  color: var(--primary);
}

.chooser-section {
  margin-top: 1.5rem;
}

.chooser-section h2 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  padding: 0.3rem;
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  background: var(--surface);
}

.segmented button,
.plan-card {
  margin: 0;
  min-height: 44px;
  border-radius: 0.6rem;
}

.segmented button {
  padding: 0.55rem 0.25rem;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.segmented button[aria-checked="true"],
.plan-card[aria-checked="true"] {
  border-color: var(--primary);
  background: #eef2ff;
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
  color: var(--text-primary);
}

.plan-card {
  width: 100%;
  text-align: left;
}

.plan-card strong {
  font-size: 1.05rem;
}

.payment-options {
  display: grid;
  gap: 0.6rem;
}

.payment-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  align-items: start;
  margin: 0;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface);
}

.payment-option input {
  width: 1.1rem;
  margin: 0.2rem 0 0;
}

.payment-option small {
  display: block;
  color: var(--text-secondary);
  font-weight: 400;
}

.status-card {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface);
}

@media (min-width: 42rem) {
  body {
    padding-top: 3.5rem;
  }

  main {
    max-width: 34rem;
  }
}
