/*
 * Same visual language as the app (oneos-style clean UI): Inter, soft
 * #F5F7FB background with a faded brand glow, white 20px cards, pill
 * buttons. Brand colour comes from the backend (site.js sets the vars).
 */
:root {
  --brand: #006CEB;
  --brand-2: #3d8bff;
  --brand-soft: #e6f0fd;
  --brand-ink: #0056bc;
  --bg: #F5F7FB;
  --line: #E6E9F2;
  --muted: #64748B;
}

html { scroll-behavior: smooth; }
body { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif; font-feature-settings: 'cv11', 'ss01'; background: var(--bg); color: #0F172A; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
::selection { background: color-mix(in srgb, var(--brand) 20%, transparent); }

/* Keyboard focus: visible ring, never on mouse clicks */
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 12px; }
.btn:focus-visible { border-radius: 999px; }

/* Faded brand glow behind the top of every page */
.page-bg { background:
  radial-gradient(900px 480px at 85% -120px, color-mix(in srgb, var(--brand) 14%, transparent), transparent 70%),
  radial-gradient(700px 420px at -10% 0px, color-mix(in srgb, var(--brand-2) 10%, transparent), transparent 70%),
  var(--bg); }

.text-brand { color: var(--brand); }
.bg-brand { background: var(--brand); }
.bg-brand-soft { background: var(--brand-soft); }
.bg-brand-grad { background-image: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.text-brand-grad { color: var(--brand); }
.border-brand { border-color: var(--brand); }
.text-muted { color: var(--muted); }

/* Surfaces */
.surface { background: #fff; border: 1px solid var(--line); border-radius: 20px; }
.surface-lg { background: #fff; border: 1px solid var(--line); border-radius: 28px; }
.shadow-soft { box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 12px 32px -12px rgba(15, 23, 42, .14); }
.header-glass { background: color-mix(in srgb, #fff 78%, transparent); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border-radius: 999px; font-weight: 600; transition: transform .15s, filter .15s, background .15s; }
.btn:active { transform: scale(.98); }
.btn-brand, .btn-primary { background: var(--brand); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 6px 16px -6px color-mix(in srgb, var(--brand) 70%, transparent); }
.btn-brand:hover, .btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 10px 22px -8px color-mix(in srgb, var(--brand) 75%, transparent); }
.btn-brand:active, .btn-primary:active { transform: scale(.98); }
.btn-brand:disabled, .btn-primary:disabled { opacity: .6; cursor: default; filter: none; transform: none; }
.btn-ghost { background: #fff; color: #0F172A; border: 1px solid var(--line); }
.btn-ghost:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }

.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .75rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: .78rem; color: #334155; }
.icon-tile { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); }

/* Period toggle -- like the app's SegmentedButton */
.segmented { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: #fff; border: 1px solid var(--line); }
.per { border-radius: 999px; padding: .55rem 1.1rem; font-weight: 600; font-size: .9rem; color: #334155; transition: background .15s, color .15s; }
.per[aria-pressed=true] { background: var(--brand); color: #fff; }
.per .save { margin-left: .35rem; font-size: .7rem; font-weight: 700; padding: .1rem .4rem; border-radius: 999px; background: #DCFCE7; color: #15803D; }
.per[aria-pressed=true] .save { background: rgba(255, 255, 255, .22); color: #fff; }

/* Plan cards */
.plan { cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; border: 1.5px solid var(--line); }
.plan:hover { transform: translateY(-2px); }
.plan[aria-selected=true] { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 12%, transparent), 0 18px 40px -16px rgba(15, 23, 42, .3); }
.paybtn { border: 1.5px solid var(--brand); color: var(--brand); background: #fff; }
.plan[aria-selected=true] .paybtn { background: var(--brand); color: #fff; }
.check { flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 999px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }

/* Fields */
.field-label { display: block; font-size: .8rem; font-weight: 600; color: #334155; margin-bottom: .35rem; }
.field { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: .8rem 1rem; font-size: 1rem; outline: none; transition: border-color .15s, box-shadow .15s; }
.field:focus { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 12%, transparent); }

/* Details dialog: bottom sheet on phones, centred on larger screens */
.sheet-backdrop { background: rgba(15, 23, 42, .45); }
.sheet { width: 100%; max-width: 440px; background: #fff; border-radius: 28px 28px 0 0; animation: sheet-up .22s ease-out; }
@media (min-width: 640px) { .sheet { border-radius: 28px; animation: pop .18s ease-out; } }
.grabber { width: 40px; height: 4px; border-radius: 999px; background: #CBD5E1; margin: 0 auto 14px; }
@media (min-width: 640px) { .grabber { display: none; } }
/* Details form: scrolls on short screens but without a visible side bar */
.sheet-scroll { scrollbar-width: none; -ms-overflow-style: none; }
.sheet-scroll::-webkit-scrollbar { display: none; }
/* Details form layout: header and footer stay put, only the fields scroll,
   so the pay button can never be pushed off a short screen. */
.sheet-form { display: flex; flex-direction: column; max-height: min(92vh, 92dvh); overflow: hidden; }
.sheet-head { flex: none; padding: 1.5rem 1.5rem 0; }
.sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 1.1rem 1.5rem .75rem; }
.sheet-fields > * + * { margin-top: .85rem; }
.sheet-foot { flex: none; padding: .85rem 1.5rem max(1.1rem, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: inherit; border-radius: 0 0 28px 28px; }
@media (max-width: 639px) { .sheet-foot { border-radius: 0; } }
/* Short screens (laptops at 100%+ zoom, small phones): tighter spacing */
@media (max-height: 820px) {
  .sheet-head { padding-top: 1.1rem; }
  .sheet-head .mt-4 { margin-top: .75rem; padding-top: .6rem; padding-bottom: .6rem; }
  .sheet-body { padding-top: .85rem; }
  .sheet-fields > * + * { margin-top: .6rem; }
  .sheet-form .field { padding: .62rem .9rem; font-size: .95rem; }
  .sheet-form .field-label { margin-bottom: .25rem; }
  .sheet-form .consent { padding: .6rem .75rem; }
}
/* Inline field errors (checkout.js): red line + message under the field */
.field-error { display: none; margin-top: .35rem; font-size: .78rem; font-weight: 500; color: #DC2626; }
.field-error:not(:empty) { display: block; }
.field[aria-invalid="true"] { border-color: #DC2626; }
.field[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px rgba(220, 38, 38, .12); }
/* Terms & Privacy consent */
.consent { display: flex; align-items: flex-start; gap: .6rem; padding: .75rem .85rem; border: 1px solid var(--line); border-radius: 14px; font-size: .82rem; line-height: 1.45; color: #334155; cursor: pointer; transition: border-color .15s, background .15s; }
.consent:has(input:checked) { border-color: color-mix(in srgb, var(--brand) 45%, transparent); background: color-mix(in srgb, var(--brand) 5%, transparent); }
.consent input { flex: none; width: 18px; height: 18px; margin-top: 1px; accent-color: var(--brand); cursor: pointer; }
.consent a { color: var(--brand); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
@keyframes sheet-up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes pop { from { transform: scale(.97); opacity: .6; } to { transform: none; opacity: 1; } }

/* Success steps */
.steps { display: flex; align-items: center; gap: .5rem; font-size: .75rem; font-weight: 600; color: var(--muted); }
.step-dot { width: 22px; height: 22px; border-radius: 999px; display: grid; place-items: center; border: 1.5px solid var(--line); background: #fff; font-size: .7rem; }
.step.done .step-dot { background: #16A34A; border-color: #16A34A; color: #fff; }
.step.now .step-dot { border-color: var(--brand); color: var(--brand); }
.step.now { color: #0F172A; }
.step-line { flex: 1; height: 1.5px; background: var(--line); min-width: 16px; }

/* Store badges */
.store { display: flex; align-items: center; justify-content: center; gap: .6rem; border-radius: 16px; background: #0F172A; color: #fff; padding: .7rem 1rem; }

details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details[open] .chev { transform: rotate(180deg); }

.hidden { display: none !important; }

/* Legal pages */
.prose h2 { font-size: 1.1rem; font-weight: 700; margin: 1.6rem 0 .5rem; }
.prose p, .prose li { color: #334155; line-height: 1.75; }
.prose ul { list-style: disc; padding-left: 1.25rem; }
.prose a { color: var(--brand); font-weight: 600; }
