/* ============================================================
   My Kurtains — quote funnel (/quote/, /soumission/)
   Mobile-first. Colour tokens mirror config.theme; app.js re-applies
   them on :root at boot so the two never drift for long.
   ============================================================ */

/* Manrope only — same self-hosted files and unicode-range split as ../styles.css */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../assets/fonts/manrope-normal-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;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../assets/fonts/manrope-normal-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;
}

:root {
  /* config.theme defaults — keep identical to quote/config.js */
  --ink:          #17130f;
  --accent:       #a67c3d;
  --accent-light: #c39a5b;
  --ground:       #fbf8f3;
  --linen:        #f6f1ea;
  --card:         #ffffff;
  --muted:        #6f665d;              /* 5.3:1 on --ground, 5.6:1 on --card */

  /* Darkened brass for anything that carries text contrast (links, solid-button
     hover, rail counters). CSS-only on purpose: applyTheme() maps the seven
     config.theme keys only, so this token is never overwritten at boot. */
  --accent-dark:  #85612c;              /* 5.6:1 with --card, 5.3:1 with --ground */

  --line:      rgba(23, 19, 15, 0.12);
  --line-tile: #8a8178;                 /* 3.6:1 on white — tile borders need 3:1 */
  --error:     #a83232;                 /* 6.6:1 on white */
  --ok:        #2f6b3a;
  --shadow-sm: 0 2px 10px rgba(23, 19, 15, 0.06);
  --shadow-md: 0 18px 40px -18px rgba(23, 19, 15, 0.28);

  --radius:    18px;
  --radius-sm: 12px;
  --font:      "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ease:      cubic-bezier(0.22, 1, 0.36, 1);
  --gutter:    16px;
  --focus:     0 0 0 3px var(--card), 0 0 0 6px var(--accent);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, p { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--ink); }
img, svg { display: block; }

/* Visible focus rings everywhere, only for keyboard/assistive users */
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

/* Skip link: hidden until focused */
.skip {
  position: absolute; left: var(--gutter); top: -100px;
  padding: .6rem 1rem; border-radius: 100px;
  background: var(--ink); color: var(--ground); text-decoration: none;
  z-index: 10;
}
.skip:focus-visible { top: var(--gutter); }

/* ---------- page frame ---------- */
#app {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 var(--gutter) calc(var(--gutter) * 2);
}

.hdr {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem 0 .6rem;
  min-height: 60px;
}
.brand { display: inline-flex; align-items: center; gap: .55rem; }
.brand__mark { width: 32px; height: 32px; color: var(--accent); display: grid; place-items: center; }
.brand__mark svg { width: 100%; height: 100%; }
.brand__name { font-weight: 700; font-size: 1.2rem; letter-spacing: -0.02em; color: var(--ink); }
.brand__name em { font-style: normal; color: var(--accent); }

.lang { display: inline-flex; align-items: center; gap: .1rem; }
.lang__btn {
  background: none; border: 1.5px solid transparent; border-radius: 100px;
  padding: .35rem .6rem; min-width: 44px; min-height: 40px;
  font-weight: 600; font-size: .9rem; letter-spacing: .04em; color: var(--muted);
}
.lang__btn[aria-pressed="true"] { color: var(--ink); border-color: var(--ink); }
.lang__btn:hover { color: var(--ink); }
.lang__sep { color: var(--muted); opacity: .6; }

.tagline {
  font-size: .82rem; line-height: 1.4; color: var(--muted);
  margin: 0 0 .9rem;
  min-height: 2.3em;                    /* reserved: two lines at 375 px, one on wide screens */
}
/* Resolves the asterisk in the tagline. Deliberately quiet, but present: an asterisk
   with nothing behind it is worse than no asterisk. */
.footnote {
  margin: .15rem 0 0; padding: 0 var(--gutter);
  font-size: .72rem; line-height: 1.3; color: var(--muted);
}

/* The ad promises, kept on the landing page itself. */
.trust {
  margin: .7rem 0 0; padding: 0 var(--gutter);
  font-size: .8rem; line-height: 1.45; font-weight: 600; color: var(--ink);
}

/* ---------- layout: card + optional rail ---------- */
.layout { display: block; }
.rail { display: none; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.1rem var(--gutter) 1.35rem;
  overflow: hidden;
}

/* ---------- progress (fixed height, never shifts) ---------- */
.progress { height: 34px; margin-bottom: .9rem; }
.progress__bar {
  height: 6px; border-radius: 100px; background: var(--linen); overflow: hidden;
}
.progress__fill {
  height: 100%; width: 0; border-radius: inherit; background: var(--accent);
  transition: width .45s var(--ease);
}
.progress__text {
  margin-top: .45rem; font-size: .8rem; font-weight: 600; letter-spacing: .02em;
  color: var(--muted); line-height: 1.2; height: 1.2em;
}

/* ---------- screens ---------- */
.screens { position: relative; min-height: 26rem; }
.screen { animation: screen-in .32s var(--ease) both; }
@keyframes screen-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.screen h1 {
  font-size: clamp(1.45rem, 5.4vw, 1.75rem);
  line-height: 1.2; font-weight: 700; letter-spacing: -0.02em;
  margin-bottom: .35rem;
}
.screen h1:focus-visible { box-shadow: none; outline: 3px solid var(--accent); outline-offset: 4px; }
.sub { color: var(--muted); font-size: .98rem; margin-bottom: 1.1rem; }
.screen h1 + .tiles, .screen h1 + .field { margin-top: 1.1rem; }

/* tiles */
.tiles {
  display: grid; grid-template-columns: 1fr; gap: .7rem;
  margin-bottom: 1rem;
}
.tile {
  min-height: 90px; width: 100%;          /* contract says ≥ 88; margin for sub-pixel rounding */
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .9rem 1.05rem;
  text-align: left; font-weight: 600; font-size: 1.02rem; line-height: 1.3;
  background: var(--card); color: var(--ink);
  border: 1.5px solid var(--line-tile); border-radius: var(--radius-sm);
  transition: border-color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.tile:hover { border-color: var(--ink); }
.tile:active { transform: scale(.985); }
.tile[aria-checked="true"] { border-color: var(--accent); background: var(--linen); box-shadow: inset 0 0 0 1px var(--accent); }
.tile__dot {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--line-tile); position: relative;
}
.tile[aria-checked="true"] .tile__dot { border-color: var(--accent); background: var(--accent); }
.tile[aria-checked="true"] .tile__dot::after {
  content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px;
  border: solid var(--card); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.tile:focus-visible { border-radius: var(--radius-sm); }
.tile[aria-checked="true"]:focus-visible { box-shadow: inset 0 0 0 1px var(--accent), var(--focus); }

.note {
  font-size: .92rem; line-height: 1.45; color: var(--ink);
  background: var(--linen); border-left: 3px solid var(--accent-light);
  padding: .65rem .85rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 1rem;
}
.note[hidden] { display: none; }
.note:empty { padding: 0; border: 0; margin: 0; }   /* live region stays in the tree */

/* renter prices (#s2b): information, not choices — so no tile borders, nothing that looks tappable */
.prices {
  list-style: none; margin: 0 0 1rem; padding: .3rem 1.05rem;
  background: var(--linen); border-radius: var(--radius-sm);
}
.prices li { padding: .7rem 0; font-weight: 600; font-size: 1.02rem; line-height: 1.35; }
.prices li + li { border-top: 1px solid var(--line); }
.exit { margin-top: .5rem; text-align: center; font-size: .92rem; }
.exit a { color: var(--muted); font-weight: 600; display: inline-block; padding: .7rem .5rem; }   /* ≥ 44 px tap target */
.exit a:hover { color: var(--ink); }

/* fields */
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: .4rem; }
.field label small { font-weight: 500; color: var(--muted); }
.input {
  width: 100%; min-height: 52px;
  padding: .8rem 1rem; font-size: 1.05rem;
  background: var(--ground); color: var(--ink);
  border: 1.5px solid var(--line-tile); border-radius: var(--radius-sm);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
  -webkit-appearance: none; appearance: none;
}
.input::placeholder { color: var(--muted); opacity: 1; }   /* opacity set explicitly: Firefox's UA sheet dims placeholders */
.input:focus { border-color: var(--accent); }
.input:focus-visible { box-shadow: var(--focus); border-radius: var(--radius-sm); }
.input[aria-invalid="true"] { border-color: var(--error); }
.input--postal { letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }
.help { font-size: .88rem; color: var(--muted); margin-top: .4rem; }
.error { font-size: .88rem; color: var(--error); font-weight: 600; margin-top: .4rem; }
.help:empty { display: none; }
.error:empty { margin: 0; }                 /* stays in the a11y tree; 0-height when empty */
.echo { font-size: .88rem; color: var(--ok); font-weight: 600; margin-top: .4rem; min-height: 1.3em; }
.input[aria-invalid="true"] ~ .echo:empty { display: none; }   /* keep the phone error next to its field */

/* consent */
.consent { display: grid; grid-template-columns: 24px 1fr; column-gap: .7rem; row-gap: 0; align-items: start; margin: 1.1rem 0 1.2rem; }
.consent input {
  width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--accent); cursor: pointer;
}
.consent label { font-size: .88rem; line-height: 1.45; color: var(--ink); cursor: pointer; }
.consent .error { grid-column: 2; margin-top: 0; }
.consent .error:not(:empty) { margin-top: .4rem; }

/* honeypot: off-screen, never displayed, never focusable */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* buttons */
.actions { display: flex; flex-direction: column; gap: .7rem; margin-top: .25rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 52px; padding: .9rem 1.5rem; width: 100%;
  border-radius: 100px; border: 1.5px solid transparent;
  font-weight: 700; font-size: 1rem; letter-spacing: .01em;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease), opacity .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:focus-visible { border-radius: 100px; }
.btn--solid { background: var(--ink); color: var(--ground); box-shadow: var(--shadow-sm); }
.btn--solid:hover:not(:disabled):not([aria-disabled="true"]) { background: var(--accent-dark); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn--solid:disabled, .btn--solid[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
/* After the rules above on purpose, and at least as specific as the :hover rule —
   otherwise the resting/hover drop shadow would swallow the keyboard focus ring. */
.btn--solid:focus-visible { box-shadow: var(--shadow-sm), var(--focus); }
.btn--solid:hover:focus-visible:not(:disabled):not([aria-disabled="true"]) { box-shadow: var(--shadow-md), var(--focus); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); min-height: 44px; font-weight: 600; }
.btn--ghost:hover { border-color: var(--ink); }
.btn--ghost:disabled { opacity: .5; cursor: default; }
.btn--link {
  background: none; border: 0; min-height: 44px; padding: .5rem;
  color: var(--muted); font-weight: 600; font-size: .92rem; width: auto; align-self: center;
}
.btn--link:hover { color: var(--ink); }
/* Cascade pair: newer engines take the empty alt text, older ones keep the arrow. */
.btn--link::before { content: "\2190"; content: "\2190" / ""; margin-right: .1rem; }

.spinner {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  border: 2.5px solid rgba(255, 255, 255, 0.35); border-top-color: currentColor;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.status { font-size: .88rem; color: var(--muted); text-align: center; min-height: 1.3em; margin-top: .6rem; }
.status--error { color: var(--error); font-weight: 600; }

/* thanks */
.thanks__p { margin: .5rem 0 1rem; color: var(--ink); }
.calendly-inline-widget { height: 660px; min-height: 600px; width: 100%; border-radius: var(--radius-sm); overflow: hidden; background: var(--ground); position: relative; }
/* Widget failed to load: collapse the empty box so the fallback button stays above the fold. */
.calendly-inline-widget:has(+ .book:not([hidden])) { display: none; }
.calendly__loading {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--muted); font-size: .92rem; pointer-events: none;
}
.calendly-inline-widget iframe ~ .calendly__loading { display: none; }
.book[hidden] { display: none; }
.book { margin: .9rem 0 0; text-align: center; }
.call { margin-top: 1.1rem; text-align: center; font-size: .98rem; }
.call a, .error-p a, .thanks__notice a { font-weight: 700; white-space: nowrap; }
.nowrap { white-space: nowrap; }

/* error screen */
.screen--error .error-p { font-size: 1.02rem; margin: .5rem 0 1.2rem; }

/* ---------- ≥ 480 px: two tile columns ---------- */
@media (min-width: 480px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .calendly-inline-widget { height: 720px; }
  .screens { min-height: 19rem; }      /* two rows of tiles + heading + back link */
  .card { padding: 1.5rem 1.6rem 1.7rem; }
  .actions { flex-direction: row-reverse; justify-content: space-between; align-items: center; }
  .actions .btn--solid { width: auto; min-width: 200px; padding-inline: 2rem; }
  .actions .btn--link { align-self: auto; }
}

/* ---------- ≥ 1024 px: centred card + right rail ---------- */
@media (min-width: 1024px) {
  #app { max-width: 880px; padding-top: 1rem; }
  .hdr { padding-top: 1.4rem; }
  .layout { display: grid; grid-template-columns: 560px 1fr; gap: 2rem; align-items: start; }
  .rail {
    display: block; position: sticky; top: 2rem;
    padding: 1.4rem 1.5rem; border-radius: var(--radius);
    background: var(--linen);
  }
  .rail h2 { font-size: 1rem; font-weight: 700; margin-bottom: .9rem; }
  .rail ol { margin: 0; padding: 0; list-style: none; counter-reset: rail; }
  .rail li {
    counter-increment: rail; position: relative;
    padding: 0 0 .9rem 2.2rem; font-size: .95rem; line-height: 1.4; color: var(--ink);
  }
  .rail li::before {
    content: counter(rail); position: absolute; left: 0; top: 0;
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--accent-dark); color: var(--card);
    font-size: .8rem; font-weight: 700; display: grid; place-items: center;
  }
  .rail li:last-child { padding-bottom: 0; }
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
  .screen { animation: none; }
  .spinner { animation: none; border-top-color: transparent; border-right-color: currentColor; }
}

/* ---------- no JS ---------- */
.noscript { max-width: 560px; margin: 2rem auto; padding: 0 var(--gutter); }
.noscript p + p { margin-top: .75rem; }
