/* 850 Tax CPA brand (docs/brand/README.md). Every text and background pair below is checked
   for WCAG AA in tests/test_brand.py. Coastal Teal fails as small text on white, so text and links
   use --teal-ink and primary buttons put navy text on teal. Coral is one decorative accent only,
   never text and never an error colour. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* brand palette */
  --navy: #0b2d4a;
  --teal: #00b3a4;
  --teal-ink: #007a70;
  --teal-hover: #3cc5b9;
  --seafoam: #a7e3d7;
  --seafoam-soft: #e8f7f3;
  --coral: #ff7f5e;
  --white: #ffffff;
  --page: #f4faf9;
  --footer-text: #dce7ee;
  /* roles, mapped onto the brand */
  --ocean: var(--teal-ink);
  --ocean-deep: var(--navy);
  --ocean-soft: var(--seafoam-soft);
  --sea: var(--teal-ink);
  --sea-soft: var(--seafoam-soft);
  --sand: var(--page);
  --sand-deep: #e3f1ee;
  --shell: var(--white);
  --ink: var(--navy);
  --ink-soft: #46596a;
  --line: #d5e6e3;
  --ok: #2e7d5b;
  --ok-soft: var(--seafoam-soft);
  --warn: #8a5700;
  --warn-soft: #fdf1d8;
  --bad: #b23a3a;
  --bad-soft: #f9e3e3;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(11, 45, 74, 0.06), 0 6px 20px rgba(11, 45, 74, 0.07);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Montserrat", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--sand);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--ocean); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 0.5rem; color: var(--ocean-deep); font-family: var(--font-head); font-weight: 700; letter-spacing: -0.015em; line-height: 1.2; }
h1 { font-size: 1.85rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 0.9rem; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.92rem; }
.tiny { font-size: 0.8rem; }
.center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
.hidden { display: none !important; }

/* Header and navigation */
.header { background: var(--shell); border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1040px; margin: 0 auto; padding: 0.8rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { font-weight: 800; font-size: 1.15rem; color: var(--ocean-deep); letter-spacing: -0.01em; display: flex; align-items: center; gap: 0.5rem; white-space: nowrap; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--ocean) 0%, var(--sea) 100%); display: inline-block; position: relative; }
.brand-mark::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: 8px; height: 5px; border-radius: 4px; background: rgba(255, 255, 255, 0.85); }
.env-badge .env-short { display: none; }
.env-badge { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; background: var(--warn-soft); color: var(--warn); padding: 0.15rem 0.5rem; border-radius: 6px; font-weight: 700; white-space: nowrap; }
.nav { display: flex; gap: 0.25rem; align-items: center; }
.nav a, .nav button { color: var(--ink-soft); padding: 0.45rem 0.7rem; border-radius: 8px; font-size: 0.95rem; font-weight: 600; background: none; border: 0; font-family: inherit; cursor: pointer; position: relative; }
.nav a:hover, .nav a.active { background: var(--ocean-soft); color: var(--ocean-deep); text-decoration: none; }
.nav .badge { display: inline-block; min-width: 1.35em; padding: 0 0.35em; margin-left: 0.3em; border-radius: 999px; background: var(--bad); color: #fff; font-size: 0.75rem; line-height: 1.35em; text-align: center; }
.nav-account { display: flex; align-items: center; gap: 0.5rem; }
.nav-account form { display: inline; }

.footer p { margin: 0 0 0.35rem; }
.footer .footer-legal { color: var(--white); font-weight: 600; }

/* Beta banner: on every page while the beta gate is on */
.beta-banner { background: var(--warn); color: var(--white); text-align: center; font-weight: 700; padding: 0.55rem 1rem; font-size: 0.95rem; }

/* Wordmark: text and an inline SVG wave, never a raster (sharp and readable by screen readers) */
.brand-block { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.6rem; min-width: 0; }
.wordmark { display: inline-flex; flex-direction: column; line-height: 1; color: var(--navy); font-family: var(--font-head); }
.wordmark:hover { text-decoration: none; }
.wm-row { display: flex; align-items: baseline; gap: 0.28rem; font-weight: 700; font-size: 1.6rem; letter-spacing: -0.03em; white-space: nowrap; }
.wm-850 { position: relative; color: var(--navy); font-weight: 800; }
.wm-wave { position: absolute; left: -3%; bottom: -0.42rem; width: 106%; height: 0.6rem; overflow: visible; }
.wm-wave .wave-back { fill: none; stroke: var(--navy); stroke-width: 2.5; stroke-linecap: round; }
.wm-wave .wave-front { fill: none; stroke: var(--teal); stroke-width: 3.5; stroke-linecap: round; }
.wm-tax { color: var(--navy); }
.wm-cpa { color: var(--teal); }
.wm-tag { font-family: var(--font); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em; color: var(--navy); margin-top: 0.6rem; white-space: nowrap; }

/* The pelican guide: one line for the stage that is actually true (app/web/brand_copy.py) */
.guide { display: flex; align-items: center; gap: 0.8rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 0.6rem 1rem 0.6rem 0.7rem; margin: 0 0 1.2rem; }
.guide-mascot { width: 56px; height: 56px; flex: none; }
.guide-line { margin: 0; font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; color: var(--navy); }
.brand-lines { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.6rem; margin: 0.4rem auto 1.6rem; max-width: 900px; text-align: center; }
.brand-line { margin: 0; font-weight: 600; color: var(--teal-ink); }
.footer .footer-brand { color: var(--footer-text); margin-top: 0; }
.footer .footer-name { color: var(--white); font-weight: 700; }

/* Page shell */
.page { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 1.6rem 1rem 5.5rem; }
.narrow { max-width: 640px; margin-left: auto; margin-right: auto; }
.footer { background: var(--navy); padding: 1.4rem 1rem 6rem; text-align: center; color: var(--footer-text); font-size: 0.85rem; }
.footer a { color: var(--seafoam); }

/* Cards */
.card { background: var(--shell); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1rem; }
.card-title { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 0.6rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.stat { background: var(--shell); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; box-shadow: var(--shadow); display: block; color: inherit; }
.stat:hover { text-decoration: none; border-color: var(--ocean); }
.stat .stat-label { color: var(--ink-soft); font-size: 0.88rem; font-weight: 600; }
.stat .stat-value { font-size: 2rem; font-weight: 800; color: var(--ocean-deep); line-height: 1.1; }
.stat .stat-value.attention { color: var(--bad); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 54px; padding: 0.8rem 1.4rem; border-radius: var(--radius-sm);
  font: inherit; font-weight: 700; font-size: 1.05rem; cursor: pointer; text-decoration: none;
  border: 2px solid transparent; transition: background 0.12s ease, transform 0.05s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--teal); color: var(--navy); }
.btn-primary:hover { background: var(--teal-hover); }
.btn-secondary { background: var(--shell); color: var(--ocean-deep); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--ocean); }
.btn-ghost { background: transparent; color: var(--ocean); min-height: 44px; padding: 0.5rem 0.8rem; }
.btn-block { width: 100%; }
.btn-lg { min-height: 60px; font-size: 1.15rem; }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-row { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1rem; }
.btn-row .btn { flex: 1 1 200px; }
.actions-stack { display: grid; gap: 0.75rem; margin-top: 1.2rem; }

/* Forms */
.field { margin-bottom: 1.1rem; }
.field label, .field .label { display: block; font-weight: 700; margin-bottom: 0.35rem; color: var(--ocean-deep); }
.field .hint { color: var(--ink-soft); font-size: 0.9rem; margin-top: 0.3rem; }
.input, select.input, textarea.input {
  width: 100%; min-height: 54px; padding: 0.75rem 0.95rem; font: inherit; font-size: 1.05rem;
  border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--shell); color: var(--ink);
}
textarea.input { min-height: 120px; resize: vertical; }
.input:focus { outline: none; border-color: var(--ocean); box-shadow: 0 0 0 4px var(--ocean-soft); }
.field.has-error .input { border-color: var(--bad); }
.form-error { background: var(--bad-soft); color: var(--bad); border-radius: var(--radius-sm); padding: 0.8rem 1rem; margin-bottom: 1rem; font-weight: 600; }
.checkbox-row { display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.4rem 0; }
.checkbox-row input { width: 22px; height: 22px; margin-top: 0.2rem; flex: none; accent-color: var(--ocean); }
input[type="file"] { font: inherit; }
.file-input { display: block; width: 100%; padding: 1rem; border: 2px dashed var(--line); border-radius: var(--radius-sm); background: var(--sand); }

/* Option cards (one question per screen) */
.options { display: grid; gap: 0.7rem; margin: 1.2rem 0; }
.option { position: relative; display: block; }
.option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option span {
  display: flex; align-items: center; min-height: 60px; padding: 0.9rem 1.1rem 0.9rem 3.2rem;
  background: var(--shell); border: 2px solid var(--line); border-radius: var(--radius-sm);
  font-size: 1.08rem; font-weight: 600; color: var(--ocean-deep); cursor: pointer; position: relative;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.option span::before {
  content: ""; position: absolute; left: 1.05rem; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); background: var(--shell);
}
.option.option-check span::before { border-radius: 6px; }
.option span:hover { border-color: var(--ocean); }
.option input:checked + span { border-color: var(--ocean); background: var(--ocean-soft); }
.option input:checked + span::before { border-color: var(--ocean); background: var(--ocean); box-shadow: inset 0 0 0 4px var(--shell); }
.option.option-check input:checked + span::before { box-shadow: none; background: var(--ocean) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' d='M3 8.5l3 3 7-7'/%3E%3C/svg%3E") center / 14px no-repeat; }
.option input:focus-visible + span { box-shadow: 0 0 0 4px var(--ocean-soft); }
.option.option-unsure span { color: var(--ink-soft); font-weight: 500; background: transparent; }

/* Progress */
.progress { height: 10px; background: var(--sand-deep); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--sea) 0%, var(--ocean) 100%); border-radius: 999px; }
.progress-label { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 0.4rem; font-weight: 600; }
.step-label { color: var(--sea); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; }
.question-title { font-size: 1.6rem; margin: 0.4rem 0 0.4rem; }
.question-help { color: var(--ink-soft); margin-bottom: 0.4rem; }

/* Progress widths, 5 percent steps, so no template needs a style attribute */
.progress-0 { width: 0%; }
.progress-5 { width: 5%; }
.progress-10 { width: 10%; }
.progress-15 { width: 15%; }
.progress-20 { width: 20%; }
.progress-25 { width: 25%; }
.progress-30 { width: 30%; }
.progress-35 { width: 35%; }
.progress-40 { width: 40%; }
.progress-45 { width: 45%; }
.progress-50 { width: 50%; }
.progress-55 { width: 55%; }
.progress-60 { width: 60%; }
.progress-65 { width: 65%; }
.progress-70 { width: 70%; }
.progress-75 { width: 75%; }
.progress-80 { width: 80%; }
.progress-85 { width: 85%; }
.progress-90 { width: 90%; }
.progress-95 { width: 95%; }
.progress-100 { width: 100%; }

/* Status pills */
.pill { display: inline-block; padding: 0.15rem 0.7rem; border-radius: 999px; font-size: 0.82rem; font-weight: 700; white-space: nowrap; }
.pill-needed { background: var(--warn-soft); color: var(--warn); }
.pill-uploaded, .pill-under_review { background: var(--ocean-soft); color: var(--ocean-deep); }
.pill-complete, .pill-filed, .pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-not_applicable { background: var(--sand-deep); color: var(--ink-soft); }
.pill-status { background: var(--ocean-soft); color: var(--ocean-deep); font-size: 0.95rem; padding: 0.3rem 0.9rem; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.item-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 0; color: inherit; }
.item-row:hover { text-decoration: none; }
.item-row .item-title { font-weight: 700; color: var(--ocean-deep); }
.item-row .item-sub { color: var(--ink-soft); font-size: 0.9rem; }
.item-row .chev { color: var(--line); font-size: 1.4rem; }
.doc-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.7rem 0; flex-wrap: wrap; }
.doc-name { font-weight: 600; word-break: break-word; }

/* Flash and notices */
.flash { border-radius: var(--radius-sm); padding: 0.85rem 1rem; margin-bottom: 1rem; font-weight: 600; }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.err { background: var(--bad-soft); color: var(--bad); }
.notice { border-left: 4px solid var(--sea); background: var(--sea-soft); padding: 0.85rem 1rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 1rem 0; }
.notice.warn { border-color: var(--warn); background: var(--warn-soft); }
.notice p:last-child { margin-bottom: 0; }

/* Messages */
.thread { display: grid; gap: 0.7rem; margin-bottom: 1.2rem; }
.bubble { max-width: 85%; padding: 0.8rem 1rem; border-radius: 16px; background: var(--shell); border: 1px solid var(--line); }
.bubble.client { margin-left: auto; background: var(--ocean); color: #fff; border-color: var(--ocean); }
.bubble.status { margin: 0 auto; background: var(--sand-deep); border-color: var(--sand-deep); font-size: 0.92rem; color: var(--ink-soft); text-align: center; }
.bubble .meta { font-size: 0.75rem; opacity: 0.75; margin-top: 0.3rem; }
.bubble p { margin: 0; white-space: pre-wrap; }

/* Review tables */
.review-table { width: 100%; border-collapse: collapse; }
.review-table td { padding: 0.55rem 0; border-top: 1px solid var(--line); vertical-align: top; }
.review-table tr:first-child td { border-top: 0; }
.review-table td:first-child { color: var(--ink-soft); width: 58%; padding-right: 1rem; }
.review-table td:last-child { font-weight: 700; }
.review-table .edit { font-weight: 500; font-size: 0.85rem; margin-left: 0.5rem; }

/* Landing */
.hero { padding: 2.5rem 0 1.5rem; text-align: center; }
.hero h1 { font-size: 2.4rem; }
.hero p { font-size: 1.15rem; color: var(--ink-soft); max-width: 560px; margin: 0.6rem auto 1.4rem; }
.hero .price { font-size: 1rem; color: var(--ocean-deep); font-weight: 700; }
.hero h1 .hero-accent { color: var(--teal-ink); display: inline-block; position: relative; }
.hero-wave { display: block; width: 9rem; height: 0.8rem; margin: 0.2rem auto 0; overflow: visible; }
.hero-wave path { fill: none; stroke: var(--coral); stroke-width: 4; stroke-linecap: round; }
.hero .subline { font-size: 1.2rem; color: var(--navy); font-weight: 600; max-width: 600px; margin: 0.8rem auto 0.4rem; }
.steps { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 2rem 0; }
.step { background: var(--shell); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; }
.step .num { width: 34px; height: 34px; border-radius: 50%; background: var(--sea-soft); color: var(--sea); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; margin-bottom: 0.6rem; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 0.8rem; align-items: flex-start; padding: 0.5rem 0; color: var(--ink-soft); }
.timeline li .dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); flex: none; margin-top: 0.35rem; background: var(--shell); }
.timeline li.done { color: var(--ink); }
.timeline li.done .dot { background: var(--ok); border-color: var(--ok); }
.timeline li.current { color: var(--ocean-deep); font-weight: 700; }
.timeline li.current .dot { border-color: var(--ocean); background: var(--ocean-soft); }

/* Two-step sign-in */
.setup-key { font-size: 1.35rem; letter-spacing: 0.08em; background: var(--sand); padding: 0.8rem 1rem; border-radius: var(--radius-sm); word-break: break-all; }
.setup-uri { word-break: break-all; color: var(--ink-soft); }
.recovery-codes { list-style: none; padding: 0; margin: 1rem 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.5rem; }
.recovery-codes li { background: var(--sand); padding: 0.6rem 0.8rem; border-radius: var(--radius-sm); font-size: 1.05rem; letter-spacing: 0.05em; }

/* Dev outbox */
.mail { background: var(--shell); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem; margin-bottom: 0.8rem; }
.mail pre { white-space: pre-wrap; word-break: break-word; font-size: 0.9rem; background: var(--sand); padding: 0.8rem; border-radius: 8px; margin: 0.5rem 0 0; }

/* Mobile */
@media (max-width: 720px) {
  body { font-size: 16px; }
  h1 { font-size: 1.55rem; }
  .hero h1 { font-size: 1.9rem; }
  .question-title { font-size: 1.35rem; }
  .header-inner { padding: 0.7rem 1rem; gap: 0.5rem; }
  .wm-row { font-size: 1.3rem; }
  .wm-tag { font-size: 0.64rem; }
  .guide-mascot { width: 44px; height: 44px; }
  .hero .subline { font-size: 1.05rem; }
  .env-badge .env-long { display: none; }
  .env-badge .env-short { display: inline; }
  .brand { font-size: 1.05rem; gap: 0.4rem; }
  .nav-account button, .nav-account a { white-space: nowrap; }
  .nav.nav-main {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: var(--shell); border-top: 1px solid var(--line);
    justify-content: space-around; padding: 0.35rem 0.25rem calc(0.35rem + env(safe-area-inset-bottom));
  }
  .nav.nav-main a { flex: 1; text-align: center; padding: 0.5rem 0.2rem; font-size: 0.78rem; border-radius: 8px; }
  .nav.nav-main .badge { position: absolute; top: 0; right: 12%; margin: 0; }
  .nav-account .account-name { display: none; }
  .card { padding: 1.1rem; }
  .btn-row .btn { flex-basis: 100%; }
  .review-table td:first-child { width: 52%; }
}
