/* ===== GSM Discovery Call — call.gsmlo.com ===== */
:root {
  --blue: #0a3d91; --blue-600: #14509b; --blue-300: #3a8dde; --blue-050: #eef4fd;
  --navy: #0e2a54; --gold: #c9a04c; --gold-soft: #f4ead3;
  --ink: #141a2a; --muted: #5b6474; --line: #e2e8f2;
  --bg: #eef1f7; --surface: #ffffff; --surface-2: #f7f9fd;
  --ok: #1d7a44; --ok-soft: #e7f5ec; --danger: #c0362c;
  --radius: 12px; --shadow: 0 1px 2px rgba(16,32,64,.06), 0 8px 24px rgba(16,32,64,.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
[data-theme="dark"] {
  --blue: #5b9bf5; --blue-600: #6ea3f5; --blue-300: #4d8df0; --blue-050: #17233c;
  --navy: #101d38; --gold: #d9b366; --gold-soft: #2c2717;
  --ink: #e7ecf6; --muted: #9aa6bd; --line: #26314b;
  --bg: #0d1322; --surface: #141b2c; --surface-2: #1a2236;
  --ok: #4cc07a; --ok-soft: #14301f;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button { font-family: inherit; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---- Brand + buttons ---- */
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-logo { height: 44px; width: auto; display: block; }
.brand-lockup.sm .brand-logo { height: 34px; }
.brand-name { font-weight: 700; font-size: 16px; color: var(--ink); }
.brand-sub { font-size: 12px; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s, transform .05s, opacity .15s; color: var(--ink); background: transparent; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--blue-300); outline-offset: 2px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--blue-600); }
.btn-ghost { border-color: var(--line); background: var(--surface); }
.btn-ghost:hover { border-color: var(--blue-300); }
.btn-sm { min-height: 38px; padding: 0 12px; font-size: 13px; }
.btn-icon { width: 44px; padding: 0; }
.btn-block { width: 100%; }
.btn-danger { border-color: var(--danger); color: var(--danger); background: var(--surface); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.inline { display: inline; margin: 0; }
.muted { color: var(--muted); }

/* ===== Login ===== */
.auth-body { display: grid; place-items: center; padding: 24px; }
.auth-wrap { width: 100%; max-width: 440px; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 30px; }
.auth-card h1 { font-size: 22px; margin: 20px 0 6px; }
.auth-card .muted { font-size: 14px; margin: 14px 0 20px; }
.auth-form { display: grid; gap: 8px; }
.auth-form label { font-size: 13px; font-weight: 600; color: var(--muted); }
.auth-form input { width: 100%; min-height: 46px; padding: 0 14px; font-size: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--ink); }
.auth-form input:focus-visible { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-050); }
.auth-form .btn { margin-top: 8px; }
.form-error { color: var(--danger); font-size: 13px; font-weight: 600; }

/* ===== App shell ===== */
.app-body { min-height: 100dvh; }
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.progress-track { position: sticky; top: 64px; z-index: 39; height: 4px; background: var(--line); }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--blue-300)); transition: width .3s ease-out; }

/* ---- Section chip nav ---- */
.section-nav { position: sticky; top: 68px; z-index: 38; display: flex; gap: 8px; padding: 10px 18px; overflow-x: auto; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); scrollbar-width: none; }
.section-nav::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; transition: border-color .15s, color .15s, background .15s; white-space: nowrap; }
.chip:hover { border-color: var(--blue-300); color: var(--ink); }
.chip.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip .chip-count { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--blue-050); color: var(--blue); }
.chip.active .chip-count { background: rgba(255,255,255,.2); color: #fff; }
.chip.done .chip-count { background: var(--ok-soft); color: var(--ok); }
.chip.active.done .chip-count { background: rgba(255,255,255,.2); color: #fff; }

/* ===== Content ===== */
.content { padding: 18px; }
.sheet { max-width: 860px; margin: 0 auto; display: grid; gap: 18px; }

.client-card { background: linear-gradient(135deg, var(--navy), #1a4a8f); border-radius: 16px; box-shadow: var(--shadow); padding: 24px; color: #fff; }
.client-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .client-grid { grid-template-columns: 1fr; } }
.client-card .field label { display: block; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.75); margin-bottom: 6px; }
.client-card .field .req { color: var(--gold); }
.client-card .field input { width: 100%; min-height: 48px; padding: 0 14px; font-size: 17px; font-weight: 600; border: 1px solid rgba(255,255,255,.25); border-radius: 10px; background: rgba(255,255,255,.1); color: #fff; transition: border-color .15s, background .15s; }
.client-card .field input::placeholder { color: rgba(255,255,255,.45); font-weight: 400; }
.client-card .field input:focus-visible { outline: none; border-color: var(--gold); background: rgba(255,255,255,.16); }
.intro-note { margin: 16px 0 0; font-size: 13px; line-height: 1.55; color: rgba(255,255,255,.72); border-left: 3px solid var(--gold); padding-left: 12px; }
.intro-note:empty { display: none; }

/* ---- Section cards ---- */
.sec-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; scroll-margin-top: 132px; }
.sec-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.sec-num { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 auto; border-radius: 9px; background: var(--navy); color: var(--gold); font-weight: 800; font-size: 15px; }
.sec-title { flex: 1 1 auto; font-size: 18px; font-weight: 700; }
.sec-tag { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); white-space: nowrap; }
.sec-meta { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.sec-meta.done { color: var(--ok); background: var(--ok-soft); border-color: transparent; }

.q-row { display: grid; gap: 6px; padding: 14px 20px; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; transition: border-left-color .2s, background .2s; }
.q-row:last-child { border-bottom: none; }
.q-row.answered { border-left-color: var(--ok); background: color-mix(in srgb, var(--ok-soft) 40%, transparent); }
.q-label { display: flex; align-items: baseline; gap: 8px; font-size: 15px; font-weight: 600; }
.q-check { flex: 0 0 auto; width: 16px; height: 16px; align-self: center; color: var(--ok); opacity: 0; transform: scale(.6); transition: opacity .2s, transform .2s; }
.q-row.answered .q-check { opacity: 1; transform: scale(1); }
.q-hint { font-size: 12.5px; color: var(--muted); font-style: italic; margin: -2px 0 0 24px; }
.q-row textarea { width: 100%; min-height: 44px; padding: 10px 12px; margin-left: 24px; max-width: calc(100% - 24px); font-family: inherit; font-size: 15px; line-height: 1.45; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; resize: none; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.q-row textarea:focus-visible { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-050); }
.q-row textarea::placeholder { color: var(--muted); opacity: .6; }

.foot-note { text-align: center; font-size: 12.5px; color: var(--muted); margin: 6px 0 30px; }
.foot-note a { color: var(--muted); }

/* ===== Saved calls drawer ===== */
/* [hidden] must win over the display rules below, or the drawer shows on load
   and the close button can't hide it. */
.drawer[hidden], .scrim[hidden] { display: none !important; }
.scrim { position: fixed; inset: 0; z-index: 90; background: rgba(8, 15, 30, .5); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 91; width: min(420px, 92vw); background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; animation: drawer-in .22s ease-out; }
@keyframes drawer-in { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 17px; }
.drawer-search { padding: 12px 18px; border-bottom: 1px solid var(--line); }
.drawer-search input { width: 100%; min-height: 44px; padding: 0 14px; font-size: 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--ink); }
.drawer-search input:focus-visible { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-050); }
.call-list { flex: 1 1 auto; overflow-y: auto; padding: 10px 12px; display: grid; gap: 8px; align-content: start; }
.call-item { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); padding: 12px 14px; display: grid; gap: 4px; }
.call-item-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.call-item-name { font-weight: 700; font-size: 15px; }
.call-item-date { font-size: 12px; color: var(--muted); white-space: nowrap; }
.call-item-sub { font-size: 13px; color: var(--muted); }
.call-item-actions { display: flex; gap: 8px; margin-top: 6px; }
.call-empty { padding: 26px 10px; text-align: center; color: var(--muted); font-size: 14px; }

/* ===== Toast ===== */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 95; background: var(--navy); color: #fff; font-size: 14px; font-weight: 600; padding: 12px 20px; border-radius: 999px; box-shadow: var(--shadow); animation: toast-in .25s ease-out; max-width: 90vw; }
.toast.err { background: var(--danger); }
@keyframes toast-in { from { transform: translate(-50%, 12px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* ===== Admin ===== */
.admin-sheet { max-width: 900px; margin: 0 auto; display: grid; gap: 16px; }
.admin-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.admin-bar h1 { margin: 0; font-size: 20px; }
.dirty-dot { display: none; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); }
.dirty .dirty-dot { display: inline-block; }
.admin-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.admin-sec-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.admin-sec-head input { font-family: inherit; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ink); padding: 6px 9px; transition: border-color .15s, background .15s; }
.admin-sec-head input:hover, .admin-sec-head input:focus-visible { border-color: var(--line); background: var(--surface-2); outline: none; }
.admin-sec-title { flex: 1 1 200px; font-size: 17px; font-weight: 700; min-width: 0; }
.admin-sec-tag { flex: 0 1 220px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.icon-btns { display: flex; gap: 4px; }
.mini-btn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; transition: border-color .15s, color .15s; }
.mini-btn:hover { border-color: var(--blue-300); color: var(--ink); }
.mini-btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.mini-btn:disabled { opacity: .3; cursor: default; }
.admin-q { display: flex; gap: 8px; align-items: flex-start; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.admin-q:last-of-type { border-bottom: none; }
.admin-q-fields { flex: 1 1 auto; display: grid; gap: 6px; min-width: 0; }
.admin-q-fields textarea, .admin-q-fields input { width: 100%; font-family: inherit; font-size: 14px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; resize: none; overflow: hidden; }
.admin-q-fields textarea:focus-visible, .admin-q-fields input:focus-visible { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-050); }
.admin-q-fields input { font-size: 12.5px; font-style: italic; color: var(--muted); }
.admin-add-q { padding: 10px 16px 14px; }
.admin-intro textarea { width: 100%; font-family: inherit; font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; resize: vertical; min-height: 70px; }
.admin-intro { padding: 14px 16px; }
.admin-intro label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.admin-calls .call-item { background: var(--surface); }
.admin-calls { padding: 12px 16px; display: grid; gap: 8px; }
