/* ============================================================
   Launchpad — Design System
   Warm, reassuring, mobile-first. Deliberately NOT NextLevel navy.
   ============================================================ */
:root {
  --teal: #0F5257;
  --teal-700: #0B3E42;
  --teal-100: #E4EFEF;
  --teal-50: #F1F7F6;
  --coral: #FF6B5B;
  --coral-600: #F0503F;
  --coral-100: #FFE7E3;
  --cream: #FAF7F2;
  --green: #3BA776;
  --green-100: #E1F3EA;
  --amber: #E8A32C;
  --amber-100: #FBEED4;
  --ink: #1B2A2C;
  --muted: #5C6B6D;
  --line: #E7E1D8;
  --white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(27,42,44,.06), 0 1px 2px rgba(27,42,44,.04);
  --shadow: 0 10px 30px rgba(15,82,87,.10), 0 2px 8px rgba(27,42,44,.06);
  --shadow-lg: 0 24px 60px rgba(15,82,87,.16);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --maxw: 720px;
  --font-head: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, .head { font-family: var(--font-head); letter-spacing: -0.01em; }
a { color: var(--teal); }
button { font-family: var(--font-body); cursor: pointer; }

/* subtle warm background wash */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(1200px 500px at 100% -5%, rgba(255,107,91,.06), transparent 60%),
    radial-gradient(900px 500px at -10% 0%, rgba(15,82,87,.06), transparent 55%);
}

/* ── Sticky progress header ─────────────────────────────── */
.app-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(250,247,242,.86);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.app-header .bar {
  max-width: var(--maxw); margin: 0 auto;
  padding: 14px 20px 12px; display: flex; flex-direction: column; gap: 10px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--teal), var(--teal-700));
  display: grid; place-items: center; color: #fff; font-size: 16px;
  box-shadow: var(--shadow-sm);
}
.brand .name { font-family: var(--font-head); font-weight: 700; font-size: 18px; color: var(--teal); }
.brand .name b { color: var(--coral); }
.progress-row { display: flex; align-items: center; gap: 12px; }
.progress-track { flex: 1; height: 10px; border-radius: 999px; background: var(--teal-100); overflow: hidden; }
.progress-fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--green));
  transition: width .6s cubic-bezier(.2,.7,.2,1);
}
.progress-label { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }

/* ── Layout ─────────────────────────────────────────────── */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 26px 20px 120px; }

/* mini step map */
.stepmap { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 22px; }
.stepmap .dot {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  background: var(--white); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px 6px 8px;
}
.stepmap .dot .n {
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; background: var(--teal-100); color: var(--teal);
}
.stepmap .dot.done { color: var(--green); border-color: var(--green-100); background: var(--green-100); }
.stepmap .dot.done .n { background: var(--green); color: #fff; }
.stepmap .dot.current { color: var(--teal); border-color: var(--teal); background: var(--teal-50); box-shadow: 0 0 0 3px var(--teal-50); }
.stepmap .dot.current .n { background: var(--coral); color: #fff; }

/* ── Step card ──────────────────────────────────────────── */
.card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: 30px; animation: rise .5s cubic-bezier(.2,.7,.2,1);
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--teal); background: var(--teal-50); border: 1px solid var(--teal-100);
  padding: 5px 11px; border-radius: 999px;
}
.step-icon { font-size: 40px; line-height: 1; margin: 16px 0 6px; }
.card h1 { font-size: clamp(24px, 5vw, 32px); margin: 6px 0 10px; color: var(--ink); line-height: 1.15; }
.why { font-size: 17px; color: var(--muted); margin: 0 0 18px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--muted);
  background: var(--cream); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px;
}
.badge.deadline { color: var(--coral-600); background: var(--coral-100); border-color: var(--coral-100); }

/* body blocks */
.block { margin: 16px 0; }
.block p { font-size: 16px; margin: 0; }
.block.text p { color: #35474A; }

.callout {
  border-radius: var(--radius-sm); padding: 15px 16px; display: flex; gap: 12px;
  border: 1px solid var(--line); background: var(--cream);
}
.callout .ic { font-size: 20px; line-height: 1.2; }
.callout .ct { font-size: 15px; }
.callout .ct b { display: block; font-family: var(--font-head); font-size: 15px; margin-bottom: 2px; }
.callout.info { background: var(--teal-50); border-color: var(--teal-100); }
.callout.tip { background: var(--amber-100); border-color: #F1DCA9; }
.callout.warn { background: var(--coral-100); border-color: #FFD3CC; }
.callout.success { background: var(--green-100); border-color: #C7E8D6; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 700; font-size: 16px; border-radius: 14px; padding: 14px 22px;
  border: none; text-decoration: none; transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
  width: 100%;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--coral); color: #fff; box-shadow: 0 8px 20px rgba(255,107,91,.32); }
.btn-primary:hover { background: var(--coral-600); }
.btn-teal { background: var(--teal); color: #fff; box-shadow: 0 8px 20px rgba(15,82,87,.22); }
.btn-teal:hover { background: var(--teal-700); }
.btn-ghost { background: var(--white); color: var(--teal); border: 1.5px solid var(--teal-100); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--teal); background: var(--teal-50); }
.btn-link-ext { background: var(--teal-50); color: var(--teal); border: 1.5px solid var(--teal-100); }
.btn-link-ext:hover { background: var(--teal-100); }
.btn .arrow { font-size: 18px; }
.btn-note { font-size: 13px; color: var(--muted); margin: 7px 2px 0; text-align: center; }

/* copy block */
.copybox { border: 1.5px dashed var(--teal-100); border-radius: var(--radius-sm); overflow: hidden; background: var(--teal-50); }
.copybox pre {
  font-family: 'SFMono-Regular', ui-monospace, Menlo, monospace; font-size: 13.5px;
  white-space: pre-wrap; margin: 0; padding: 15px 16px; color: #2B3B3D; line-height: 1.5;
}
.copybox .copy-btn {
  width: 100%; border: none; border-top: 1.5px dashed var(--teal-100);
  background: var(--white); color: var(--teal); font-weight: 700; font-size: 15px;
  padding: 13px; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.copybox .copy-btn:hover { background: var(--teal-50); }
.copybox .copy-btn.copied { color: var(--green); }

/* checklist */
.checklist { background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; }
.checklist h4 { font-family: var(--font-head); font-size: 14px; margin: 0 0 10px; color: var(--ink); }
.checklist ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.checklist li { display: flex; gap: 10px; font-size: 15px; color: #35474A; }
.checklist li::before { content: '○'; color: var(--teal); font-weight: 700; }

/* carriers */
.carriers { display: grid; gap: 14px; }
.carrier-group { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.carrier-group .cg-head {
  background: var(--teal); color: #fff; font-family: var(--font-head); font-weight: 600;
  font-size: 14px; padding: 9px 16px; display: flex; align-items: center; gap: 8px;
}
.carrier-group ul { list-style: none; margin: 0; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.carrier-group li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 9px; font-size: 15px; }
.carrier-group li:hover { background: var(--teal-50); }
.carrier-group li .cn { font-weight: 600; display: flex; align-items: center; gap: 9px; }
.carrier-group li .cn::before { content: '📋'; font-size: 14px; }
.carrier-group li .note { font-size: 12px; color: var(--coral-600); background: var(--coral-100); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }

/* video slot */
.video-slot {
  border: 1.5px dashed var(--line); border-radius: var(--radius-sm); background: var(--cream);
  aspect-ratio: 16/9; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; color: var(--muted); text-align: center; padding: 16px;
}
.video-slot .vic { font-size: 30px; opacity: .7; }
.video-slot .vt { font-weight: 600; font-size: 14px; }
.video-slot .vs { font-size: 12.5px; }
.video-slot video { width: 100%; height: 100%; border-radius: var(--radius-sm); }

/* upline help card */
.upline {
  margin-top: 24px; border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, #fff, var(--teal-50)); padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.upline .uh { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 600; font-size: 15px; color: var(--teal); margin-bottom: 4px; }
.upline .us { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.upline .ucontacts { display: flex; flex-wrap: wrap; gap: 10px; }
.upline .ucontacts a {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  background: #fff; border: 1px solid var(--teal-100); border-radius: 12px; padding: 10px 14px;
  font-weight: 600; font-size: 14px; color: var(--teal);
}
.upline .ucontacts a:hover { border-color: var(--teal); background: var(--teal-50); }
.upline .uname { font-weight: 700; color: var(--ink); }

/* action bar */
.actions { margin-top: 26px; display: flex; flex-direction: column; gap: 12px; }
.done-btn {
  background: var(--green); color: #fff; border: none; border-radius: 16px;
  font-weight: 700; font-size: 17px; padding: 17px; display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 10px 24px rgba(59,167,118,.30); transition: transform .12s ease, background .2s ease;
}
.done-btn:hover { background: #329067; }
.done-btn:active { transform: translateY(1px); }
.done-btn.completed { background: var(--green-100); color: var(--green); box-shadow: none; cursor: default; }
.nav-row { display: flex; gap: 10px; }
.nav-row .btn { flex: 1; }
.nav-back { background: transparent; color: var(--muted); border: none; font-weight: 600; font-size: 14px; padding: 8px; }
.nav-back:hover { color: var(--teal); }

/* ── Intake form (welcome) ──────────────────────────────── */
.form-grid { display: grid; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 14px; color: var(--ink); }
.field label .req { color: var(--coral); }
.field input[type=text], .field input[type=email], .field input[type=tel] {
  font-family: var(--font-body); font-size: 16px; padding: 13px 15px;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); width: 100%;
}
.field input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-50); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.chip-select { display: flex; flex-wrap: wrap; gap: 10px; }
.chip-opt {
  border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 11px 18px;
  font-weight: 600; font-size: 15px; color: var(--muted); transition: all .15s ease;
}
.chip-opt.on { border-color: var(--teal); background: var(--teal-50); color: var(--teal); box-shadow: 0 0 0 3px var(--teal-50); }
.field.err input, .chip-select.err .chip-opt { border-color: var(--coral); }
.err-msg { color: var(--coral-600); font-size: 13px; font-weight: 600; }

/* unlicensed path */
.branch-box { margin-top: 8px; border: 1px solid var(--amber); background: var(--amber-100); border-radius: var(--radius-sm); padding: 16px 18px; }
.branch-box h4 { font-family: var(--font-head); margin: 0 0 6px; font-size: 15px; }
.branch-box p { margin: 0 0 12px; font-size: 14.5px; color: #6b5a2e; }

/* ── Finish celebration ─────────────────────────────────── */
.finish { text-align: center; padding: 20px 10px 8px; }
.finish .big { font-size: 66px; line-height: 1; margin-bottom: 8px; }
.finish h1 { font-size: clamp(28px, 7vw, 40px); color: var(--teal); margin: 6px 0 10px; }
.finish p { font-size: 18px; color: var(--muted); max-width: 460px; margin: 0 auto 22px; }
.finish .recap { text-align: left; display: inline-block; background: var(--green-100); border: 1px solid #C7E8D6; border-radius: var(--radius-sm); padding: 16px 22px; margin-top: 6px; }
.finish .recap li { list-style: none; font-weight: 600; color: var(--teal-700); padding: 4px 0; display: flex; gap: 10px; }
.finish .recap li::before { content: '✅'; }

/* confetti canvas */
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: 14px;
  opacity: 0; transition: all .3s ease; z-index: 70; box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* loading / states */
.center-state { text-align: center; padding: 80px 20px; color: var(--muted); }
.center-state .big { font-size: 44px; margin-bottom: 10px; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--teal-100); border-top-color: var(--teal); border-radius: 50%; margin: 0 auto 16px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Admin ──────────────────────────────────────────────── */
.admin-wrap { max-width: 1080px; margin: 0 auto; padding: 26px 22px 80px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.admin-head h1 { font-size: 26px; margin: 0; color: var(--teal); }
.admin-grid { display: grid; grid-template-columns: 1fr; gap: 22px; }
@media (min-width: 900px) { .admin-grid { grid-template-columns: 360px 1fr; align-items: start; } }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 22px; }
.panel h2 { font-size: 17px; margin: 0 0 14px; }
.agent-table { width: 100%; border-collapse: collapse; }
.agent-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.agent-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.agent-table tr:hover td { background: var(--teal-50); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.pill.ontrack { background: var(--teal-50); color: var(--teal); }
.pill.stuck { background: var(--coral-100); color: var(--coral-600); }
.pill.done { background: var(--green-100); color: var(--green); }
.mini-track { width: 90px; height: 7px; border-radius: 999px; background: var(--teal-100); overflow: hidden; display: inline-block; vertical-align: middle; }
.mini-fill { height: 100%; background: linear-gradient(90deg, var(--teal), var(--green)); }
.linkcell { font-family: ui-monospace, monospace; font-size: 12px; color: var(--muted); }
.copy-link { border: 1px solid var(--teal-100); background: var(--teal-50); color: var(--teal); border-radius: 8px; padding: 5px 10px; font-size: 12px; font-weight: 700; }
.pass-gate { max-width: 380px; margin: 80px auto; text-align: center; }
.pass-gate input { text-align: center; letter-spacing: .1em; }

/* ============================================================
   Accessibility + contrast + polish overrides (post-review)
   ============================================================ */

/* Visible keyboard focus on every interactive control (was missing on custom
   buttons/links/chips). Uses outline so it never fights existing box-shadows. */
a:focus-visible, button:focus-visible, input:focus-visible,
.chip-opt:focus-visible, .stepmap .dot:focus-visible, .copy-btn:focus-visible,
.copy-link:focus-visible, .stuck-btn:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

/* Contrast fixes — darker corals for text/small UI (bright coral stays for large fills). */
.badge.deadline { color: #A62C1D; background: var(--coral-100); border-color: #F6C7BF; }
.err-msg { color: #A62C1D; }
.field label .req { color: #C0392B; }
.btn-primary { background: var(--coral-600); }
.btn-primary:hover { background: #D63E2E; }

/* The reassurance sentence is the emotional core of each step — make it readable. */
.why { color: #33454A; }

/* Locked step-map dots: de-emphasized, non-button, so they don't compete with the
   single current action or read as "things I can't do." */
.stepmap .dot.locked { background: transparent; border-color: transparent; color: #97A2A2; box-shadow: none; }
.stepmap .dot.locked .n { background: #ECE6DC; color: #A7B0B0; }
.stepmap .dot.locked:hover { background: rgba(0,0,0,.02); }

/* "I'm stuck" button on the upline card — clear, calm, not alarming. */
.stuck-btn {
  width: 100%; margin: 4px 0 14px; padding: 12px; border-radius: 12px;
  border: 1.5px solid var(--teal-100); background: #fff; color: var(--teal);
  font-family: var(--font-body); font-weight: 700; font-size: 15px;
}
.stuck-btn:hover { background: var(--teal-50); }
.stuck-btn.done { background: var(--green-100); color: var(--green); border-color: #C7E8D6; }

/* Admin "link not opened yet" pill. */
.pill.waiting { background: var(--amber-100); color: #8A6410; }
