/* ==========================================================================
   Haptags Forms — 6+6 onboarding
   Brand: navy #02213D + electric blue #007AF5. Outfit headings, Plus Jakarta Sans text.
   ========================================================================== */

:root {
  --navy: #02213d;
  --ink-950: #050b1a;
  --ink-900: #0a1226;
  --blue: #007af5;
  --blue-600: #0066d6;
  --blue-300: #6fb3ff;

  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --surface-3: #eef2f8;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0b1324;
  --text-2: #445169;
  --text-3: #64748b;
  --primary: #007af5;
  --primary-hover: #0066d6;
  --primary-ink: #0052ad;
  --primary-soft: #ecf4ff;
  --primary-ring: rgba(0, 122, 245, 0.35);
  --success: #16a34a;
  --success-soft: #e8f8ee;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --warn: #9a4a06;
  --warn-soft: #fff7ed;
  --warn-border: #fed7aa;
  --paper: #ffffff;

  --font-head: 'Outfit', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-sign: 'Caveat', 'Segoe Script', 'Brush Script MT', cursive;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(11, 19, 36, 0.06);
  --shadow: 0 1px 2px rgba(11, 19, 36, 0.04), 0 8px 24px rgba(11, 19, 36, 0.06);
  --shadow-lg: 0 2px 6px rgba(11, 19, 36, 0.05), 0 24px 56px rgba(11, 19, 36, 0.12);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --gutter: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #070d1b;
    --surface: #0d1729;
    --surface-2: #101d33;
    --surface-3: #13223b;
    --border: #1d2a44;
    --border-strong: #2b3b5c;
    --text: #edf2fa;
    --text-2: #a9b6cb;
    --text-3: #8091aa;
    --primary: #2b8cff;
    --primary-hover: #4d9fff;
    --primary-ink: #8fc6ff;
    --primary-soft: rgba(43, 140, 255, 0.13);
    --primary-ring: rgba(77, 159, 255, 0.45);
    --success: #22c55e;
    --success-soft: rgba(34, 197, 94, 0.12);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.1);
    --warn: #fbbf77;
    --warn-soft: rgba(251, 146, 60, 0.1);
    --warn-border: rgba(251, 146, 60, 0.3);
    --paper: #0f1a2e;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.35), 0 24px 56px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
  .brand-mark-dark { display: none; }
  .brand-mark-light { display: block !important; }
}

/* Base ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(0, 122, 245, 0.2); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.icon { width: 1.15em; height: 1.15em; flex-shrink: 0; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--primary); color: #fff; padding: 10px 14px; border-radius: var(--radius-sm); text-decoration: none; font-weight: 600; }
.skip-link:focus { top: 12px; }
.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 var(--gutter); }
.container-narrow { max-width: 880px; }
.mt-s { margin-top: 10px; }

/* Brand ------------------------------------------------------------------ */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark { width: 26px; height: auto; }
.brand-mark-light { display: none; }
.brand-name { font-family: var(--font-head); font-weight: 800; font-size: 1.15rem; letter-spacing: 0.06em; }
.on-dark .brand { color: #fff; }
.on-dark .brand-mark-dark { display: none; }
.on-dark .brand-mark-light { display: block; }

/* Buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 11px; border: 1px solid transparent;
  font-weight: 600; font-size: 0.97rem; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 0.9rem; border-radius: 10px; }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: 1rem; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px -6px rgba(0, 122, 245, 0.6); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--text-3); background: var(--surface-2); }
.btn-glass { background: rgba(255, 255, 255, 0.08); color: #fff; border-color: rgba(255, 255, 255, 0.18); backdrop-filter: blur(6px); }
.btn-glass:hover { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.3); }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); font-weight: 600; font-size: 0.9rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.link-btn:hover { color: var(--primary-hover); }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; }
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn.is-copied { color: var(--success); border-color: var(--success); }

/* Top bar ---------------------------------------------------------------- */
.topbar { position: relative; z-index: 5; background: var(--navy); }
.topbar-inner { display: flex; align-items: center; gap: 14px; min-height: 64px; }
.topbar-tag { display: none; color: rgba(255, 255, 255, 0.6); font-size: 0.85rem; font-weight: 500; padding-left: 14px; border-left: 1px solid rgba(255, 255, 255, 0.18); }
.topbar .btn { margin-left: auto; }
@media (min-width: 560px) { .topbar-tag { display: inline; } }

/* Hero ------------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; background: var(--navy); color: #fff; padding: 40px 0 64px; }
.hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 70% at 85% 10%, rgba(0, 122, 245, 0.45), transparent 60%),
    radial-gradient(50% 60% at 0% 100%, rgba(34, 195, 238, 0.16), transparent 60%),
    linear-gradient(180deg, #02213d 0%, #0a1226 100%);
}
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(80% 80% at 70% 30%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(80% 80% at 70% 30%, #000 30%, transparent 75%);
}
.hero-grid { position: relative; display: grid; gap: 36px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.14); font-size: 0.82rem; font-weight: 600; letter-spacing: 0.02em; color: #cfe5ff; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); } 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); } }
.hero h1 { margin-top: 18px; font-size: clamp(2.1rem, 6.4vw, 3.6rem); font-weight: 800; letter-spacing: -0.025em; }
.hero-accent { background: linear-gradient(90deg, #8fc6ff 0%, #ffffff 55%, #8fc6ff 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { margin-top: 18px; max-width: 34rem; font-size: 1.08rem; line-height: 1.65; color: rgba(255, 255, 255, 0.78); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-points { display: flex; flex-wrap: wrap; gap: 10px 22px; list-style: none; padding: 0; margin: 24px 0 0; color: rgba(255, 255, 255, 0.72); font-size: 0.92rem; }
.hero-points li { display: inline-flex; align-items: center; gap: 8px; }
.hero-points .icon { color: #8fc6ff; }

.offer-card {
  position: relative; padding: 24px; border-radius: 22px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}
.offer-top { display: flex; align-items: center; gap: 16px; padding-bottom: 18px; border-bottom: 1px dashed rgba(255, 255, 255, 0.2); }
.offer-mark { font-family: var(--font-head); font-weight: 800; font-size: 3.6rem; line-height: 1; letter-spacing: -0.04em; background: linear-gradient(180deg, #fff, #8fc6ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.offer-mark span { color: #4d9fff; -webkit-text-fill-color: #4d9fff; margin: 0 2px; }
.offer-top-text { display: flex; flex-direction: column; gap: 4px; font-size: 0.95rem; line-height: 1.3; }
.offer-top-text span { color: rgba(255, 255, 255, 0.6); font-size: 0.82rem; }
.offer-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.offer-label { display: block; font-size: 0.82rem; color: rgba(255, 255, 255, 0.65); font-weight: 500; }
.offer-price { display: block; font-family: var(--font-head); font-size: 1.85rem; font-weight: 700; letter-spacing: -0.01em; }
.offer-price s { font-family: var(--font-body); font-size: 0.9rem; font-weight: 500; color: rgba(255, 255, 255, 0.45); margin-left: 6px; }
.offer-pill { padding: 5px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; background: rgba(77, 159, 255, 0.2); color: #b9dcff; border: 1px solid rgba(77, 159, 255, 0.35); white-space: nowrap; }
.offer-pill-free { background: rgba(74, 222, 128, 0.16); color: #86efac; border-color: rgba(74, 222, 128, 0.35); }
.offer-total { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 14px 16px; border-radius: 14px; background: rgba(0, 122, 245, 0.22); border: 1px solid rgba(77, 159, 255, 0.35); }
.offer-total span { font-size: 0.9rem; color: #d6e9ff; }
.offer-total strong { font-family: var(--font-head); font-size: 1.5rem; }
.offer-fine { margin-top: 14px; font-size: 0.78rem; line-height: 1.5; color: rgba(255, 255, 255, 0.55); }

@media (min-width: 900px) {
  .hero { padding: 64px 0 96px; }
  .hero-grid { grid-template-columns: 1.25fr 1fr; gap: 56px; }
  .offer-card { padding: 28px; }
}

/* Sections --------------------------------------------------------------- */
.section-head { text-align: center; max-width: 40rem; margin: 0 auto 32px; }
.kicker { display: inline-block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--primary); margin-bottom: 10px; }
.section-head h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 700; }
.section-head p { margin-top: 12px; color: var(--text-2); }

.included { padding: 64px 0 24px; }
.benefit-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .benefit-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .benefit-grid { grid-template-columns: repeat(4, 1fr); } }
.benefit { display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.benefit:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.benefit-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--primary-soft); color: var(--primary); margin-bottom: 6px; }
.benefit-icon .icon { width: 20px; height: 20px; }
.benefit strong { font-family: var(--font-head); font-size: 1.05rem; font-weight: 600; }
.benefit span { font-size: 0.9rem; color: var(--text-2); line-height: 1.55; }
@media (max-width: 559px) {
  .benefit-grid { gap: 10px; }
  .benefit { display: grid; grid-template-columns: 36px 1fr; column-gap: 14px; row-gap: 2px; padding: 14px 16px; }
  .benefit-icon { grid-row: span 2; width: 36px; height: 36px; margin: 2px 0 0; }
  .benefit strong { font-size: 1rem; }
  .benefit span { font-size: 0.85rem; line-height: 1.5; }
}

/* Wizard ----------------------------------------------------------------- */
.onboard { padding: 56px 0 40px; scroll-margin-top: 12px; }
.wizard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.wizard-top { padding: 20px 20px 0; }
.stepper { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.stepper button { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; padding: 4px 0; cursor: pointer; color: var(--text-3); font-size: 0.8rem; font-weight: 600; }
.stepper button:disabled { cursor: default; }
.step-num { position: relative; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); font-family: var(--font-head); font-size: 0.95rem; transition: all .2s var(--ease); }
.step-num .icon { display: none; width: 16px; height: 16px; }
.stepper .is-current .step-num { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.stepper .is-current button { color: var(--text); }
.stepper .is-done .step-num { background: var(--primary); border-color: var(--primary); color: #fff; }
.stepper .is-done .step-num span { display: none; }
.stepper .is-done .step-num .icon { display: block; }
.stepper .is-done button { color: var(--text-2); }
.stepper button:not(:disabled):hover .step-num { border-color: var(--primary); }
.step-lbl { display: none; }
@media (min-width: 560px) { .step-lbl { display: block; } }
.progress { height: 4px; margin-top: 16px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), #22c3ee); border-radius: 4px; transition: width .35s var(--ease); }

.wizard-form { padding: 0 20px; }
.step { border: 0; margin: 0; padding: 28px 0 8px; min-width: 0; animation: stepIn .35s var(--ease); }
@keyframes stepIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.step-head { margin-bottom: 24px; }
.step-kicker { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--primary); }
.step-head h3 { margin-top: 6px; font-size: clamp(1.35rem, 3.4vw, 1.65rem); font-weight: 700; outline: none; }
.step-head p { margin-top: 6px; color: var(--text-2); font-size: 0.97rem; }

@media (min-width: 720px) {
  .wizard-top { padding: 28px 36px 0; }
  .wizard-form { padding: 0 36px; }
}

.restore-notice { margin: 16px 20px 0; }
@media (min-width: 720px) { .restore-notice { margin: 20px 36px 0; } }

/* Fields ----------------------------------------------------------------- */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 0 18px; }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .span-2 { grid-column: 1 / -1; }
}
.field { margin-bottom: 20px; min-width: 0; }
.field > label:not([class]), .field .label { display: block; margin-bottom: 7px; font-weight: 600; font-size: 0.93rem; color: var(--text); }
.req { color: var(--danger); }
.opt { margin-left: 4px; font-weight: 500; font-size: 0.78rem; color: var(--text-3); }
.field-hint { margin-top: 6px; font-size: 0.83rem; color: var(--text-3); line-height: 1.5; }
.field-error { font-size: 0.84rem; font-weight: 500; color: var(--danger); }
.field-error:not(:empty) { margin-top: 6px; }
.field-error:not(:empty)::before { content: "! "; font-weight: 800; }

input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="password"], input[type="search"], select, textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 11px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-size: 1rem; line-height: 1.4; transition: border-color .15s, box-shadow .15s, background-color .15s;
  -webkit-appearance: none; appearance: none;
}
textarea { resize: vertical; min-height: 0; }
input::placeholder, textarea::placeholder { color: var(--text-3); opacity: .8; }
input:hover, select:hover, textarea:hover { border-color: var(--text-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
input[type="date"] { min-height: 48px; }
.invalid input:not([type="checkbox"]):not([type="radio"]), .invalid select, .invalid textarea, [aria-invalid="true"] { border-color: var(--danger); background: var(--danger-soft); }
.select-wrap { position: relative; }
.select-wrap select { padding-right: 40px; cursor: pointer; }
.select-chevron { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--text-3); }
.input-prefix { display: flex; align-items: stretch; border: 1px solid var(--border-strong); border-radius: 11px; background: var(--surface); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.input-prefix span { display: grid; place-items: center; padding: 0 12px; background: var(--surface-2); color: var(--text-3); font-size: 0.95rem; border-right: 1px solid var(--border); }
.input-prefix input { border: 0; border-radius: 0; box-shadow: none !important; }
.input-prefix:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.invalid .input-prefix { border-color: var(--danger); }

.inline-check { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 0.88rem; color: var(--text-2); cursor: pointer; }
.inline-check input { width: 17px; height: 17px; accent-color: var(--primary); margin: 0; }

.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Chips (multi-select) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 0.9rem; font-weight: 500; transition: all .15s var(--ease); user-select: none; }
.chip .icon { width: 0; height: 15px; opacity: 0; transition: width .15s var(--ease), opacity .15s; }
.chip:hover span { border-color: var(--text-3); }
.chip input:checked + span { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-ink); font-weight: 600; }
.chip input:checked + span .icon { width: 15px; opacity: 1; }
.chip input:focus-visible + span { box-shadow: 0 0 0 3px var(--primary-ring); }

/* Choice cards (single select) */
.choices { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 560px) {
  .choices-2 { grid-template-columns: 1fr 1fr; }
  .choices-3 { grid-template-columns: repeat(3, 1fr); }
}
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice-body { display: flex; gap: 12px; align-items: flex-start; height: 100%; padding: 14px 16px; border-radius: 13px; border: 1px solid var(--border-strong); background: var(--surface); transition: all .15s var(--ease); }
.choice:hover .choice-body { border-color: var(--text-3); }
.choice-radio { flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); transition: all .15s var(--ease); }
.choice-text { display: flex; flex-direction: column; gap: 3px; }
.choice-title { font-weight: 600; font-size: 0.94rem; line-height: 1.35; }
.choice-desc { font-size: 0.83rem; color: var(--text-3); line-height: 1.45; }
.choice input:checked + .choice-body { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.choice input:checked + .choice-body .choice-radio { border-color: var(--primary); border-width: 6px; }
.choice input:focus-visible + .choice-body { box-shadow: 0 0 0 3px var(--primary-ring); }
.invalid .choice-body { border-color: var(--danger); }

/* Segmented pills */
.seg { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px; border-radius: 13px; background: var(--surface-3); border: 1px solid var(--border); }
.seg-opt { position: relative; flex: 1 1 auto; cursor: pointer; }
.seg-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg-opt span { display: block; padding: 9px 12px; border-radius: 9px; text-align: center; font-size: 0.88rem; font-weight: 600; color: var(--text-2); transition: all .15s var(--ease); white-space: nowrap; }
.seg-opt:hover span { color: var(--text); }
.seg-opt input:checked + span { background: var(--surface); color: var(--primary-ink); box-shadow: var(--shadow-sm), 0 0 0 1px var(--primary); }
.seg-opt input:focus-visible + span { box-shadow: 0 0 0 3px var(--primary-ring); }
.invalid .seg { border-color: var(--danger); }

.content-box { padding: 18px; margin-bottom: 20px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); }
.content-box-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; }
.content-box-head strong { font-family: var(--font-head); font-size: 1.05rem; }
.content-box-head span { font-size: 0.86rem; color: var(--text-3); }
.content-box .field:last-child { margin-bottom: 0; }

/* Dropzone */
.dropzone { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 13px; border: 1.5px dashed var(--border-strong); background: var(--surface); cursor: pointer; transition: all .15s var(--ease); }
.dropzone:hover, .dropzone.is-drag { border-color: var(--primary); background: var(--primary-soft); }
.dropzone.has-file { border-style: solid; border-color: var(--success); }
.dropzone input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dropzone:focus-within { box-shadow: 0 0 0 3px var(--primary-ring); }
.dropzone-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; background: var(--primary-soft); color: var(--primary); flex-shrink: 0; }
.dropzone-text { display: flex; flex-direction: column; min-width: 0; font-size: 0.86rem; color: var(--text-3); }
.dropzone-text strong { color: var(--text); font-size: 0.95rem; }
.dropzone-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropzone .link-btn { margin-left: auto; position: relative; z-index: 1; }

/* Notices */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 13px 15px; border-radius: 12px; font-size: 0.9rem; line-height: 1.55; }
.notice > .icon { margin-top: 2px; }
.notice .link-btn { margin-left: auto; white-space: nowrap; }
.notice-info { background: var(--primary-soft); color: var(--text); border: 1px solid rgba(0, 122, 245, 0.25); }
.notice-info > .icon { color: var(--primary); }
.notice-warn { background: var(--warn-soft); color: var(--text); border: 1px solid var(--warn-border); margin-bottom: 8px; }
.notice-warn > .icon { color: var(--warn); }
.notice-error { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(220, 38, 38, 0.3); font-weight: 500; }
.form-alert { margin: 4px 0 16px; }

/* Checkboxes */
.check { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; cursor: pointer; font-size: 0.93rem; line-height: 1.5; color: var(--text); }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-box { flex-shrink: 0; display: grid; place-items: center; width: 22px; height: 22px; margin-top: 1px; border-radius: 7px; border: 2px solid var(--border-strong); background: var(--surface); color: #fff; transition: all .15s var(--ease); }
.check-box .icon { width: 14px; height: 14px; opacity: 0; transform: scale(.6); transition: all .15s var(--ease); stroke-width: 3; }
.check input:checked + .check-box { background: var(--primary); border-color: var(--primary); }
.check input:checked + .check-box .icon { opacity: 1; transform: none; }
.check input:focus-visible + .check-box { box-shadow: 0 0 0 3px var(--primary-ring); }
.check.invalid .check-box { border-color: var(--danger); }
.acks { padding: 6px 18px 12px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface-2); }
.acks > .label { padding-top: 12px; }
.acks .check + .check { border-top: 1px solid var(--border); }
.acks.invalid { border-color: var(--danger); }
.check-card { padding: 16px 18px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); }
.check-card.invalid { border-color: var(--danger); }
.consent-error { margin: 6px 0 0; }

/* Review summary */
.summary { display: grid; gap: 12px; margin-bottom: 24px; }
@media (min-width: 760px) { .summary { grid-template-columns: repeat(3, 1fr); } }
.summary-card { padding: 16px 18px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); min-width: 0; }
.summary-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.summary-head h4 { font-size: 1rem; font-weight: 600; }
.summary dl { margin: 0; display: grid; gap: 8px; }
.summary dl div { display: grid; gap: 1px; }
.summary dt { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3); }
.summary dd { margin: 0; font-size: 0.9rem; overflow-wrap: anywhere; }
@media (max-width: 759px) {
  .summary dl { gap: 6px; }
  .summary dl div { grid-template-columns: 104px 1fr; gap: 10px; align-items: baseline; }
}

/* Signature */
.sig-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.sig-head .label { margin: 0; }
.tabs { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--border); }
.tabs button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 0; border-radius: 8px; background: none; cursor: pointer; font-size: 0.86rem; font-weight: 600; color: var(--text-2); }
.tabs button .icon { width: 15px; height: 15px; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.sig-pad { position: relative; height: clamp(160px, 38vw, 230px); border-radius: 14px; border: 1.5px dashed var(--border-strong); background: #fff; overflow: hidden; touch-action: none; }
.sig-pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; z-index: 1; }
.sig-pad canvas:focus-visible { outline: none; }
.sig-pad:focus-within { border-color: var(--primary); }
.sig-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: #94a3b8; font-family: var(--font-sign); font-size: 2rem; pointer-events: none; transition: opacity .2s; }
.has-ink .sig-placeholder { opacity: 0; }
.sig-line { position: absolute; left: 6%; right: 6%; bottom: 26%; border-bottom: 1.5px solid #cbd5e1; pointer-events: none; }
.sig-line span { position: absolute; left: -2px; bottom: 2px; color: #94a3b8; font-size: 1.1rem; font-weight: 600; }
.sig-clear { position: absolute; z-index: 2; right: 10px; top: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; border: 1px solid #e2e8f0; background: rgba(255, 255, 255, 0.92); color: #445169; font-size: 0.82rem; font-weight: 600; cursor: pointer; }
.sig-clear .icon { width: 14px; height: 14px; }
.sig-clear:hover { color: #0b1324; border-color: #cbd5e1; }
.invalid .sig-pad { border-color: var(--danger); }
.sig-type input { margin-bottom: 10px; }
.sig-type-preview { display: grid; place-items: center; min-height: 130px; padding: 10px 16px; border-radius: 14px; border: 1.5px dashed var(--border-strong); background: #fff; color: #0b2a5b; font-family: var(--font-sign); font-weight: 600; font-size: clamp(2.4rem, 8vw, 3.6rem); line-height: 1.1; text-align: center; overflow-wrap: anywhere; }
.sig-type-preview:empty::before { content: "Your signature"; color: #94a3b8; font-size: 2rem; }
.sign-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 14px 0 8px; font-size: 0.85rem; color: var(--text-3); }
.sign-meta span { display: inline-flex; align-items: center; gap: 6px; }

/* Wizard footer */
.wizard-foot {
  position: sticky; bottom: 0; z-index: 3;
  display: flex; align-items: center; gap: 12px;
  margin: 8px -20px 0; padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
@media (min-width: 720px) { .wizard-foot { margin: 8px -36px 0; padding: 18px 36px; } }
.wizard-foot [data-next], .wizard-foot [data-submit] { margin-left: auto; }
.save-state { font-size: 0.82rem; color: var(--text-3); opacity: 0; transition: opacity .3s; }
.save-state.is-visible { opacity: 1; }
@media (max-width: 420px) { .save-state { display: none; } .wizard-foot .btn { flex: 1; } }
.btn-submit { position: relative; min-width: 170px; }
.btn-submit .spinner { display: none; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn-submit.is-busy .btn-label { visibility: hidden; }
.btn-submit.is-busy .spinner { display: block; position: absolute; }
.btn-label { display: inline-flex; align-items: center; gap: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Success */
.success { padding: 48px 20px 36px; text-align: center; outline: none; animation: stepIn .45s var(--ease); }
.success-badge { display: grid; place-items: center; width: 76px; height: 76px; margin: 0 auto 20px; border-radius: 50%; background: var(--success-soft); color: var(--success); box-shadow: 0 0 0 10px color-mix(in srgb, var(--success-soft) 50%, transparent); animation: pop .5s var(--ease); }
.success-badge .icon { width: 38px; height: 38px; stroke-width: 2.6; }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: none; opacity: 1; } }
.success h3 { font-size: clamp(1.6rem, 4vw, 2rem); font-weight: 700; }
.success-lead { margin-top: 8px; color: var(--text-2); }
.ref-chip { display: inline-flex; align-items: center; gap: 12px; margin-top: 22px; padding: 8px 8px 8px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.ref-chip span { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.ref-chip strong { font-family: var(--font-head); font-size: 1.15rem; letter-spacing: 0.04em; }
.success-mail { margin-top: 14px; font-size: 0.92rem; color: var(--text-2); }
.success-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 24px; }
.next-steps { max-width: 34rem; margin: 36px auto 0; padding: 22px 24px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); text-align: left; }
.next-steps h4 { font-size: 1.05rem; margin-bottom: 12px; }
.next-steps ol { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 12px; }
.next-steps li { position: relative; padding-left: 40px; font-size: 0.92rem; color: var(--text-2); counter-increment: step; }
.next-steps li::before { content: counter(step); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-ink); font-weight: 700; font-size: 0.82rem; }
.next-steps strong { color: var(--text); }

.privacy-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; font-size: 0.84rem; color: var(--text-3); text-align: center; }

/* FAQ -------------------------------------------------------------------- */
.faq { padding: 40px 0 72px; }
.faq-list { display: grid; gap: 10px; }
.faq details { border-radius: 14px; border: 1px solid var(--border); background: var(--surface); transition: box-shadow .2s; }
.faq details[open] { box-shadow: var(--shadow); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; cursor: pointer; list-style: none; font-weight: 600; font-family: var(--font-head); font-size: 1.05rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { color: var(--text-3); transition: transform .2s var(--ease); }
.faq details[open] summary .icon { transform: rotate(180deg); }
.faq details p { padding: 0 20px 18px; color: var(--text-2); font-size: 0.95rem; }

/* Footer ----------------------------------------------------------------- */
.footer { background: var(--ink-900); color: rgba(255, 255, 255, 0.7); padding: 40px 0 24px; font-size: 0.9rem; }
.footer-inner { display: grid; gap: 24px; }
@media (min-width: 760px) { .footer-inner { grid-template-columns: 1fr auto; align-items: start; } }
.footer-tag { margin-top: 10px; color: rgba(255, 255, 255, 0.55); }
.footer-contact { display: grid; gap: 8px; }
.footer-contact a { display: inline-flex; align-items: center; gap: 8px; color: rgba(255, 255, 255, 0.85); text-decoration: none; }
.footer-contact a:hover { color: #fff; }
.footer-contact span { color: rgba(255, 255, 255, 0.55); max-width: 22rem; }
.footer-bottom { margin-top: 28px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, 0.1); font-size: 0.82rem; color: rgba(255, 255, 255, 0.45); }

/* Agreement document (shared by form, dialog and agreement page) -------- */
.doc-frame { border-radius: 16px; border: 1px solid var(--border); overflow: hidden; margin-bottom: 20px; }
.doc-frame-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 0.88rem; font-weight: 600; color: var(--text-2); }
.doc-frame-bar > span { display: inline-flex; align-items: center; gap: 8px; }
.doc-embedded { max-height: 420px; overflow-y: auto; overscroll-behavior: contain; }
.doc { padding: 24px 20px; background: var(--paper); color: var(--text); font-size: 0.92rem; line-height: 1.65; }
@media (min-width: 640px) { .doc { padding: 32px 36px; } }
.doc-head { text-align: center; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 2px solid var(--text); }
.doc-title { font-family: var(--font-head); font-size: clamp(1.15rem, 3vw, 1.45rem); font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; }
.doc-sub { margin-top: 4px; color: var(--text-2); font-size: 0.88rem; }
.doc-meta { display: grid; grid-template-columns: 1fr; gap: 8px 24px; margin: 18px 0 0; text-align: left; }
@media (min-width: 560px) { .doc-meta { grid-template-columns: 1fr 1fr; } }
.doc-meta div { display: flex; gap: 8px; align-items: baseline; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.doc-meta dt { font-weight: 700; font-size: 0.82rem; white-space: nowrap; }
.doc-meta dt::after { content: ":"; }
.doc-meta dd { margin: 0; font-size: 0.9rem; overflow-wrap: anywhere; }
.doc-clause { margin-top: 18px; }
.doc-clause h3 { font-family: var(--font-head); font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; margin-bottom: 6px; }
.doc-num { color: var(--primary); }
.doc-clause p, .doc-clause ul { margin: 0; color: var(--text-2); }
.doc-clause ul { padding-left: 20px; display: grid; gap: 4px; }
.doc-note { margin-top: 10px !important; }
.doc-table-wrap { overflow-x: auto; margin: 6px 0 4px; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; min-width: 440px; }
.doc-table th, .doc-table td { padding: 8px 10px; border: 1px solid var(--border-strong); text-align: left; }
.doc-table th { background: var(--surface-3); font-weight: 700; }
.doc-table td:not(:first-child), .doc-table th:not(:first-child) { text-align: right; }
.doc-table tr.total td { background: var(--surface-2); font-weight: 600; }

/* Dialog */
.terms-dialog { width: min(820px, calc(100% - 24px)); max-height: calc(100% - 24px); padding: 0; border: 0; border-radius: 18px; background: var(--paper); color: var(--text); box-shadow: var(--shadow-lg); overflow: hidden; }
.terms-dialog[open] { display: flex; flex-direction: column; }
.terms-dialog::backdrop { background: rgba(5, 11, 26, 0.6); backdrop-filter: blur(3px); }
.terms-dialog-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px 12px 22px; border-bottom: 1px solid var(--border); background: var(--surface-2); font-family: var(--font-head); }
.doc-dialog { overflow-y: auto; }

/* Status badges (agreement + admin) */
.status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-awaiting_countersign { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border); }
.status-active { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 35%, transparent); }
.status-renewed { background: var(--primary-soft); color: var(--primary-ink); border-color: color-mix(in srgb, var(--primary) 35%, transparent); }
.status-discontinued { background: var(--surface-3); color: var(--text-3); border-color: var(--border-strong); }

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