/* ============================================================
   PAYEoff - design system
   Paper light theme, Fraunces editorial type, restrained glass,
   postbox-red accent. Light only, no dark mode.
   ============================================================ */

:root {
  --paper: #FAF7F1;
  --paper-deep: #F3EDE1;
  --ink: #191509;
  --ink-soft: #2E2820;
  --muted: #756C5B;
  --faint: #A89D89;
  --red: #C8321E;
  --red-deep: #A82818;
  --red-soft: #FBEAE4;
  --line: #E8E0CF;
  --line-soft: #EFE9DB;
  --card: #FFFFFF;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(25,21,9,.05), 0 10px 28px rgba(25,21,9,.07);
  --shadow-lg: 0 2px 6px rgba(25,21,9,.06), 0 32px 70px rgba(25,21,9,.14);
  --glass: rgba(250,247,241,.72);
  --font-ui: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
  --font-hand: 'Caveat', cursive;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ---------------- top bar ---------------- */
.progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 100%;
  background: transparent; z-index: 30;
}
.progress > div { height: 100%; background: var(--red); width: 0%; transition: width .35s ease; }
body.landing .progress { display: none; }

.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(20px, 4vw, 44px);
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
  border-bottom: 1px solid var(--line-soft);
}
.wordmark {
  font-family: var(--font-ui); font-weight: 900; font-size: 24px;
  letter-spacing: -.045em; color: var(--ink); text-decoration: none; line-height: 1;
}
.wordmark em {
  font-family: var(--font-display); font-style: italic; font-weight: 560;
  letter-spacing: -.02em; color: var(--red);
}
.nav-links { display: none; align-items: center; gap: 30px; }
body.landing .nav-links { display: flex; }
.nav-links a {
  color: var(--muted); text-decoration: none; font-size: 14.5px; font-weight: 500;
  transition: color .15s;
}
.nav-links a:hover { color: var(--ink); }
.nav-links .nav-cta {
  background: var(--ink); color: #FAF7F1; padding: 10px 22px; border-radius: 999px;
  font-weight: 600;
}
.nav-links .nav-cta:hover { background: #000; color: #fff; }

/* ---------------- generic stage (flow) ---------------- */
.stage {
  max-width: 640px; margin: 0 auto;
  min-height: 100dvh; display: flex; flex-direction: column;
  padding: 108px 22px 130px;
}
body.landing .stage { max-width: none; padding: 0; }

.screen { animation: in .3s ease both; flex: 1; display: flex; flex-direction: column; }
@keyframes in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.kicker {
  font-size: 12.5px; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--red); margin-bottom: 14px;
}
h1.q {
  font-family: var(--font-display); font-weight: 560; font-size: clamp(27px, 5.6vw, 36px);
  line-height: 1.16; margin: 0 0 10px; letter-spacing: -.015em;
}
.helper { color: var(--muted); font-size: 15.5px; margin: 0 0 28px; max-width: 48ch; }
.helper a { color: var(--red); }

/* ---------------- flow fields ---------------- */
.field { margin-bottom: 18px; }
label.lb { display: block; font-size: 13.5px; font-weight: 600; color: var(--muted); margin-bottom: 7px; }
input[type=text], input[type=tel], input[type=number], select {
  width: 100%; padding: 15px 17px; font-size: 17px; font-family: inherit;
  border: 1.5px solid var(--line); border-radius: 14px;
  background: var(--card); color: var(--ink); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(25,21,9,.07); }
input.invalid { border-color: var(--red); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ---------------- flow options ---------------- */
.opts { display: flex; flex-direction: column; gap: 12px; }
.opt {
  display: flex; align-items: flex-start; gap: 14px; text-align: left;
  padding: 17px 19px; border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--card); cursor: pointer; font: inherit; color: inherit; width: 100%;
  transition: border-color .15s, box-shadow .2s, transform .12s;
}
.opt:hover { border-color: #CDBFA6; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.opt.sel { border-color: var(--ink); box-shadow: var(--shadow-sm); }
.opt .t { font-weight: 600; font-size: 16.5px; }
.opt .d { color: var(--muted); font-size: 14px; margin-top: 2px; }
.opt .dot {
  flex: none; width: 20px; height: 20px; margin-top: 2px; border-radius: 50%;
  border: 1.5px solid var(--line); position: relative; transition: border-color .15s;
}
.opt.sel .dot { border-color: var(--red); }
.opt.sel .dot::after {
  content: ''; position: absolute; inset: 4.5px; border-radius: 50%; background: var(--red);
}
.opt.sq .dot { border-radius: 6px; }
.opt.sq.sel .dot::after { border-radius: 3px; }

/* ---------------- flow action bar ---------------- */
.actions {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
  border-top: 1px solid var(--line-soft);
  padding: 16px 22px calc(16px + env(safe-area-inset-bottom));
}
.actions-inner { max-width: 640px; margin: 0 auto; display: flex; gap: 12px; align-items: center; }
.btn {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 600;
  padding: 15px 28px; border-radius: 999px; font-size: 16.5px;
  transition: transform .1s, opacity .15s, background .15s;
}
.btn.primary { background: var(--ink); color: #FAF7F1; flex: 1; }
.btn.primary:hover { background: #000; }
.btn.primary:active { transform: scale(.985); }
.btn.primary:disabled { opacity: .35; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--muted); padding: 15px 10px; border-radius: 999px; }
.btn.ghost:hover { color: var(--ink); }
.btn.accent { background: var(--red); color: #fff; flex: 1; }
.btn.accent:hover { background: var(--red-deep); }
.hint { font-size: 13px; color: var(--muted); margin-top: 10px; text-align: center; width: 100%; }
.key-hint { font-size: 12.5px; color: var(--faint); margin-left: 8px; }

/* ---------------- review ---------------- */
.summary { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.sum-row {
  display: flex; justify-content: space-between; gap: 14px; align-items: baseline;
  background: var(--card); border: 1px solid var(--line-soft); border-radius: 14px;
  padding: 14px 17px; font-size: 15px;
}
.sum-row .k { color: var(--muted); flex: none; }
.sum-row .v { font-weight: 600; text-align: right; }
.sum-row .edit { font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; background: none; border: 0; padding: 0; font: inherit; color: var(--red); }
.pdf-frame {
  width: 100%; height: 62dvh; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; box-shadow: var(--shadow-sm);
}
.pdf-alt { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 12px; }
.pdf-open-btn {
  display: inline-block; background: var(--card); color: var(--ink); text-decoration: none;
  font-weight: 600; font-size: 15px; padding: 12px 22px; border-radius: 999px;
  border: 1.5px solid var(--ink); transition: background .15s, color .15s;
}
.pdf-open-btn:hover { background: var(--ink); color: #FAF7F1; }
.pdf-open { color: var(--red); text-decoration: none; font-weight: 600; }

/* ---------------- signature ---------------- */
.sig-wrap {
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.sig-wrap canvas {
  display: block; width: 100%; height: 220px; touch-action: none; cursor: crosshair;
  background:
    linear-gradient(transparent calc(100% - 64px), transparent),
    repeating-linear-gradient(#fff, #fff);
}
.sig-tools { display: flex; justify-content: space-between; padding: 10px 16px; border-top: 1px dashed var(--line); }
.sig-tools button { background: none; border: 0; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.sig-tools button:hover { color: var(--ink); }

.notice {
  background: var(--red-soft); border: 1px solid #F0D2C6; color: #7A2A18;
  border-radius: 14px; padding: 14px 17px; font-size: 14.5px; margin-bottom: 20px;
}

/* ---------------- done ---------------- */
.done-card {
  background: var(--card); border: 1px solid var(--line-soft); border-radius: 20px;
  padding: 30px; box-shadow: var(--shadow-sm); margin-bottom: 16px;
}
.done-card h2 { font-family: var(--font-display); font-weight: 560; margin: 0 0 6px; font-size: 26px; letter-spacing: -.01em; }
.done-card p { color: var(--muted); font-size: 15px; margin: 0 0 16px; }
.price-row { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--line-soft); font-size: 15px; }
.price-row .amt { font-family: var(--font-display); font-size: 26px; font-weight: 600; }
.link { color: var(--red); cursor: pointer; text-decoration: none; font-weight: 600; }
.small { font-size: 13.5px; color: var(--muted); }
.center { text-align: center; }

/* ============================================================
   LANDING
   ============================================================ */

.landing { animation: in .3s ease both; }

/* ---- hero ---- */
.hero {
  max-width: 1240px; margin: 0 auto;
  padding: clamp(140px, 18vh, 200px) clamp(22px, 5vw, 48px) clamp(70px, 9vw, 120px);
  display: grid; grid-template-columns: 1.02fr .98fr; gap: clamp(40px, 6vw, 90px);
  align-items: center;
}
.display {
  font-family: var(--font-display); font-weight: 560;
  font-size: clamp(42px, 5.6vw, 76px); line-height: 1.04; letter-spacing: -.022em;
  margin: 0 0 26px;
}
.display em { font-style: italic; color: var(--red); font-weight: 500; }
.lede {
  font-size: clamp(16.5px, 1.6vw, 19px); color: var(--muted);
  max-width: 46ch; margin: 0 0 36px; line-height: 1.65;
}
.lede strong { color: var(--ink-soft); font-weight: 600; }
.cta-row { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-bottom: 22px; }
.btn-hero {
  appearance: none; border: 0; cursor: pointer; font-family: var(--font-ui);
  background: var(--ink); color: #FAF7F1; font-size: 17px; font-weight: 600;
  padding: 17px 36px; border-radius: 999px; transition: transform .12s, background .15s;
}
.btn-hero:hover { background: #000; transform: translateY(-1px); }
.btn-hero:active { transform: scale(.98); }
.cta-quiet {
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15.5px;
  border-bottom: 1.5px solid var(--line); padding-bottom: 2px; transition: color .15s, border-color .15s;
}
.cta-quiet:hover { color: var(--ink); border-color: var(--ink); }
.proof-line { font-size: 14px; color: var(--faint); margin: 0; }
.proof-line b { color: var(--muted); font-weight: 600; }

/* ---- hero document art (the real populated P87) ---- */
.hero-art { position: relative; display: flex; justify-content: center; }
.doc-scene { position: relative; width: min(500px, 100%); }
.doc-glow {
  position: absolute; inset: -8% -14%; z-index: 0; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(200,50,30,.10), transparent 70%);
}
.doc-photo {
  position: relative; z-index: 1; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-lg);
  transform: rotate(1.6deg);
}
.doc-img { display: block; width: 100%; height: auto; }
.sample-tag {
  position: absolute; bottom: 16px; right: 14px;
  background: rgba(255,255,255,.92); border: 2px solid var(--red); color: var(--red);
  font-weight: 800; font-size: 12px; letter-spacing: .22em;
  padding: 7px 13px; border-radius: 8px; transform: rotate(-2deg);
}

.chip {
  position: absolute; z-index: 2;
  background: rgba(255,255,255,.68);
  -webkit-backdrop-filter: blur(14px) saturate(1.6);
  backdrop-filter: blur(14px) saturate(1.6);
  border: 1px solid rgba(232,224,207,.9);
  border-radius: 999px; padding: 11px 20px;
  font-size: 13.5px; font-weight: 600; color: var(--ink-soft);
  box-shadow: var(--shadow-sm); white-space: nowrap;
}
.chip-1 { top: -4%; right: -5%; transform: rotate(1.5deg); }
.chip-2 { bottom: -3%; left: -5%; transform: rotate(-2deg); }
.chip em { font-family: var(--font-display); font-style: italic; color: var(--red); font-weight: 560; }

/* ---- quiet band ---- */
.band {
  background: var(--paper-deep);
  border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
}
.band-inner {
  max-width: 880px; margin: 0 auto; text-align: center;
  padding: clamp(56px, 8vw, 96px) clamp(22px, 5vw, 48px);
}
.band h2 {
  font-family: var(--font-display); font-weight: 560; letter-spacing: -.015em;
  font-size: clamp(26px, 3.6vw, 40px); line-height: 1.2; margin: 0 0 16px;
}
.band h2 em { font-style: italic; color: var(--red); font-weight: 500; }
.band p { color: var(--muted); font-size: 16px; margin: 0 auto; max-width: 58ch; }

/* ---- how it works ---- */
.section { max-width: 1060px; margin: 0 auto; padding: clamp(70px, 10vw, 130px) clamp(22px, 5vw, 48px); }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; margin-bottom: clamp(30px, 4vw, 50px); flex-wrap: wrap; }
.sec-title {
  font-family: var(--font-display); font-weight: 560; letter-spacing: -.018em;
  font-size: clamp(30px, 4.4vw, 48px); margin: 0;
}
.sec-note { color: var(--faint); font-size: 14.5px; max-width: 34ch; margin: 0; }

.steps { list-style: none; margin: 0; padding: 0; }
.step {
  display: grid; grid-template-columns: 110px 1fr 1.2fr; gap: clamp(18px, 4vw, 48px);
  align-items: baseline; padding: clamp(24px, 3.4vw, 38px) 0;
  border-top: 1px solid var(--line);
}
.step:last-child { border-bottom: 1px solid var(--line); }
.step-num { font-family: var(--font-display); font-style: italic; font-weight: 500; font-size: clamp(26px, 3vw, 36px); color: var(--red); }
.step-name { font-family: var(--font-display); font-weight: 560; font-size: clamp(20px, 2.4vw, 27px); letter-spacing: -.01em; }
.step-desc { color: var(--muted); font-size: 15.5px; line-height: 1.6; margin: 0; }
.step-desc b { color: var(--ink-soft); font-weight: 600; }

/* ---- pricing ---- */
.price-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(36px, 6vw, 90px); align-items: center; }
.price-figure { font-family: var(--font-display); font-weight: 560; letter-spacing: -.03em; font-size: clamp(72px, 10vw, 130px); line-height: .95; margin: 0; }
.price-figure sup { font-size: .32em; font-weight: 500; font-style: italic; color: var(--red); margin-left: 6px; }
.price-sub { color: var(--muted); font-size: 16px; margin: 14px 0 0; max-width: 38ch; }
.price-list { list-style: none; margin: 0; padding: 0; }
.price-list li {
  display: flex; justify-content: space-between; gap: 18px; align-items: baseline;
  padding: 15px 0; border-top: 1px solid var(--line); font-size: 15.5px;
}
.price-list li:last-child { border-bottom: 1px solid var(--line); }
.price-list .pl-k { color: var(--muted); }
.price-list .pl-v { font-weight: 600; text-align: right; }
.price-cta { margin-top: 26px; }
.price-fair { font-size: 13.5px; color: var(--faint); margin: 14px 0 0; }

/* ---- faq ---- */
.faq-list { max-width: 780px; }
details.faq { border-top: 1px solid var(--line); }
details.faq:last-child { border-bottom: 1px solid var(--line); }
details.faq summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: baseline; gap: 20px;
  padding: 22px 0; font-family: var(--font-display); font-weight: 560; letter-spacing: -.01em;
  font-size: clamp(18px, 2.2vw, 22px); transition: color .15s;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary:hover { color: var(--red); }
details.faq summary::after {
  content: '+'; font-family: var(--font-ui); font-weight: 400; font-size: 24px;
  color: var(--faint); flex: none; transition: transform .2s;
}
details.faq[open] summary::after { transform: rotate(45deg); }
details.faq .faq-a { color: var(--muted); font-size: 15.5px; line-height: 1.65; padding: 0 0 24px; margin: 0; max-width: 62ch; }
details.faq .faq-a a { color: var(--red); }

/* ---- final cta ---- */
.final-cta { text-align: center; padding: clamp(60px, 9vw, 110px) clamp(22px, 5vw, 48px); }
.final-cta h2 {
  font-family: var(--font-display); font-weight: 560; letter-spacing: -.02em;
  font-size: clamp(32px, 5vw, 54px); margin: 0 0 28px; line-height: 1.1;
}
.final-cta h2 em { font-style: italic; color: var(--red); font-weight: 500; }

/* ---- footer ---- */
.foot { border-top: 1px solid var(--line); }
.foot-inner {
  max-width: 1060px; margin: 0 auto; padding: 44px clamp(22px, 5vw, 48px) 56px;
  display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap;
}
.foot .wordmark { font-size: 20px; }
.foot-legal { font-size: 13px; color: var(--faint); line-height: 1.7; max-width: 62ch; margin: 14px 0 0; }
.foot-side { font-size: 13px; color: var(--faint); text-align: right; }

/* ---------------- responsive ---------------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; padding-top: 124px; gap: 72px; }
  .hero-art { order: 2; }
  .chip-1 { right: -2%; top: -5%; }
  .chip-2 { left: -2%; }
  .step { grid-template-columns: 64px 1fr; }
  .step-desc { grid-column: 2; }
  .price-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-links a:not(.nav-cta) { display: none; }
  .chip { font-size: 12.5px; padding: 9px 16px; }
  .chip-1 { top: -4%; right: 0; }
  .chip-2 { bottom: -4%; left: 0; }
  .foot-side { text-align: left; }
}
@media (max-width: 480px) {
  .row2, .row3 { grid-template-columns: 1fr; }
  .stage { padding-top: 92px; }
}
