/* My Owner Build Journey: styles. Mobile first; one stylesheet for the landing page, login, and the app.
   Navy + gold, the same family as Carolina Build Journey. Light and dark themes follow the device. */
:root {
  --navy: #1f3864; --navy-d: #16284a; --gold: #c8a040; --gold-d: #b08a30;
  --bg: #f3f5f9; --surface: #ffffff; --ink: #1c2433; --muted: #56607a; --line: #dde2ec;
  --head: #1f3864; --ok: #1a5e20; --ok-bg: #e2f1e3; --warn: #8a5a00; --warn-bg: #fdf0d3; --bad: #9b2c2c; --bad-bg: #fbe6e6;
  --info: #1f3864; --info-bg: #e3e9f5; --cream: #fff8e1;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,48,.06), 0 6px 20px rgba(16,24,48,.08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --bar-h: 64px; --tab-h: 68px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1527; --surface: #14203a; --ink: #e6ebf5; --muted: #a2adc3; --line: #253656; --head: #d5e0f7;
    --ok: #9fd8a5; --ok-bg: #153a1b; --warn: #f1c76e; --warn-bg: #3b2c0c; --bad: #f2a5a5; --bad-bg: #46191c;
    --info: #bccbf0; --info-bg: #1c2c4f; --cream: #2b2512; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); }
h1, h2, h3 { color: var(--head); line-height: 1.2; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(1.6rem, 5vw, 2.2rem); } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; } a { color: var(--info); }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }

/* ---------- Buttons, chips, badges ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px;
  border: 2px solid transparent; border-radius: 8px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn--gold { background: var(--gold); color: var(--navy-d); } .btn--gold:hover { background: var(--gold-d); }
.btn--navy { background: var(--navy); color: #fff; } .btn--navy:hover { background: var(--navy-d); }
.btn--ghost { background: transparent; color: var(--info); border-color: var(--line); } .btn--ghost:hover { border-color: var(--gold); }
.btn--danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn--block { width: 100%; } .btn--sm { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 4px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: .92rem; cursor: pointer; }
.chip[aria-pressed="true"], .chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; letter-spacing: .02em; vertical-align: middle; }
.badge--verify { background: var(--warn-bg); color: var(--warn); } .badge--open { background: var(--bad-bg); color: var(--bad); }
.badge--gate { background: var(--info-bg); color: var(--info); } .badge--ok { background: var(--ok-bg); color: var(--ok); }

/* ---------- Forms ---------- */
label { display: block; font-weight: 700; margin-bottom: 4px; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); outline: 3px solid rgba(200,160,64,.35); }
.field { margin-bottom: 14px; }
.hint { font-size: .88rem; color: var(--muted); margin-top: 4px; }
.err { color: var(--bad); font-weight: 700; min-height: 1.4em; margin: 6px 0 0; }
.hp { position: absolute; left: -9999px; }   /* spam trap */

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card + .card { margin-top: 14px; }
.card--accent { border-left: 5px solid var(--gold); }
.stack > * + * { margin-top: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row--between { justify-content: space-between; }

/* ---------- Landing / auth pages ---------- */
.site-head { background: var(--navy); color: #fff; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; text-decoration: none; letter-spacing: -.2px; }
.brand__mark { width: 34px; height: 34px; border-radius: 8px; background: var(--gold); color: var(--navy); display: grid; place-items: center; }
.brand__mark svg { width: 22px; height: 22px; }
.hero { background: linear-gradient(160deg, var(--navy-d), var(--navy)); color: #fff; padding: 56px 0 64px; }
.hero h1 { color: #fff; max-width: 18ch; font-size: clamp(2rem, 6vw, 3.1rem); letter-spacing: -.5px; }
.hero p { color: #e6ecf8; font-size: 1.1rem; max-width: 56ch; }
.hero .row { margin-top: 22px; }
.section { padding: 44px 0; }
.grid3 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.waitlist { display: flex; flex-wrap: wrap; gap: 10px; max-width: 520px; }
.waitlist input { flex: 1 1 240px; }
.site-foot { padding: 28px 0 40px; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); }
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth .card { width: min(440px, 100%); }
.auth .brand { color: var(--head); margin-bottom: 18px; } .auth .brand__mark { background: var(--navy); color: var(--gold); }

/* ---------- App shell ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--navy); color: #fff; height: var(--bar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; }
.topbar .brand { font-size: 1rem; }
.topbar select { width: auto; min-height: 36px; padding: 4px 8px; background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.3); max-width: 46vw; }
.topbar select option { color: #111; }
.shell { display: block; }
.nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr); height: var(--tab-h); padding-bottom: env(safe-area-inset-bottom, 0); }
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted);
  text-decoration: none; font-size: .72rem; font-weight: 700; min-height: 48px; }
.nav a svg { width: 24px; height: 24px; }
.nav a[aria-current="page"] { color: var(--navy); } @media (prefers-color-scheme: dark) { .nav a[aria-current="page"] { color: var(--gold); } }
.nav a.snap { color: var(--navy-d); }
.nav a.snap span.disc { width: 52px; height: 52px; margin-top: -22px; border-radius: 50%; background: var(--gold); display: grid; place-items: center; box-shadow: var(--shadow); border: 3px solid var(--surface); }
.main { padding: 18px 16px calc(var(--tab-h) + 28px); max-width: 900px; margin-inline: auto; }
.main:focus { outline: none; }
.banner { background: var(--info-bg); color: var(--info); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-weight: 700; }
@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100dvh - var(--bar-h)); }
  .nav { position: sticky; top: var(--bar-h); bottom: auto; height: calc(100dvh - var(--bar-h)); grid-template-columns: 1fr; grid-auto-rows: 52px;
    align-content: start; padding: 14px 10px; border-top: 0; border-right: 1px solid var(--line); gap: 4px; }
  .nav a { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 14px; border-radius: 8px; font-size: .98rem; }
  .nav a[aria-current="page"] { background: var(--info-bg); }
  .nav a.snap { background: var(--gold); color: var(--navy-d); margin-bottom: 8px; }
  .nav a.snap span.disc { width: auto; height: auto; margin: 0; background: none; border: 0; box-shadow: none; }
  .nav a.snap[aria-current="page"] { background: var(--gold-d); }
  .main { padding: 28px 28px 60px; }
}

/* ---------- Today ---------- */
.progress { height: 12px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-d)); border-radius: 999px; }
.parts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.part-pill { flex: 1 1 120px; font-size: .8rem; }
.part-pill .progress { height: 6px; margin-top: 4px; }
.step { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.step:first-child { border-top: 0; }
.step input[type=checkbox] { width: 26px; height: 26px; min-height: 26px; margin: 2px 0 0; flex: none; accent-color: var(--navy); }
.step.done .step__text { text-decoration: line-through; color: var(--muted); }
.step__text { flex: 1; min-width: 0; }
.step__meta { font-size: .85rem; color: var(--muted); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
details.part { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 12px; }
details.part > summary { cursor: pointer; padding: 14px 16px; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 800; color: var(--head); min-height: 56px; }
details.part > summary::-webkit-details-marker { display: none; }
details.part .inner { padding: 0 16px 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }

/* ---------- Snap / Files ---------- */
.dropzone { border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center; background: var(--surface); }
.snap-actions { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .snap-actions { grid-template-columns: 1fr 1fr; } }
.preview { max-height: 320px; width: auto; margin: 0 auto 12px; border-radius: 8px; border: 1px solid var(--line); }
.kinds { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }
.files { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.file { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); padding: 0; cursor: pointer; }
.file img { width: 100%; height: 100%; object-fit: cover; }
.file .pdf { height: 100%; display: grid; place-items: center; font-weight: 800; color: var(--bad); }
.file .tag { position: absolute; left: 6px; bottom: 6px; background: rgba(22,40,74,.85); color: #fff; font-size: .72rem; padding: 2px 8px; border-radius: 999px; }
dialog { border: 0; border-radius: 12px; padding: 0; width: min(720px, 94vw); max-height: 92dvh; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(10,16,32,.7); }
dialog .dlg { padding: 16px; overflow: auto; max-height: 92dvh; }
dialog img.full { max-height: 56dvh; width: auto; margin: 0 auto 12px; border-radius: 8px; }
dialog iframe { width: 100%; height: 56dvh; border: 1px solid var(--line); border-radius: 8px; }

/* ---------- Toast ---------- */
.toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + 12px); display: grid; justify-items: center; gap: 8px; z-index: 60; pointer-events: none; padding: 0 16px; }
@media (min-width: 900px) { .toasts { bottom: 24px; } }
.toast { background: var(--navy-d); color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); font-weight: 700; max-width: 520px; }
.toast.bad { background: var(--bad); color: #fff; }

@media (prefers-reduced-motion: no-preference) { .progress > i { transition: width .4s ease; } }
@media print { .topbar, .nav, .toasts { display: none; } }

/* Icons inside buttons stay icon-sized. */
.btn svg { width: 22px; height: 22px; flex: none; }

/* The "hidden" attribute must always win over a class's display setting. */
[hidden] { display: none !important; }
