:root {
  --cream: #F8F2E9;
  --ink: #2A1F17;
  --soft: #5C4A3A;
  --terracotta: #A85535;
  --terracotta-light: #C17A54;
  --terracotta-hover: #8F4527;
  --accent: #E6D2B8;
  --badge-muted: #A4907A;
  --border: #EBE1D6;
  --border-light: #EFE7DB;
  --input-bg: #FBF8F4;
  --input-bg-hover: #F5ECDF;
  --white: #fff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Manrope', system-ui, sans-serif;
}

h1, h2 { color: var(--ink); letter-spacing: -0.02em; }

a { color: inherit; }

/* ============ Shared bits ============ */

.badge-pill {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--terracotta-light);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.badge-muted {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--badge-muted);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 50px;
  padding: 0 32px;
  background: var(--terracotta);
  color: #fff;
  border: none;
  border-radius: 999px;
  font: 700 15px 'Manrope', sans-serif;
  cursor: pointer;
  transition: background .15s, opacity .15s;
}
.btn-pill:hover { background: var(--terracotta-hover); }
.btn-pill:disabled { opacity: .4; cursor: default; }
.btn-pill:disabled:hover { background: var(--terracotta); }
.btn-pill.full { width: 100%; }

.link-btn {
  background: none;
  border: none;
  font: 700 14px 'Manrope', sans-serif;
  color: var(--soft);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 8px 0;
}
.link-btn:hover { color: var(--ink); }

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  font: 700 14px 'Manrope', sans-serif;
  color: var(--soft);
  cursor: pointer;
  padding: 6px 0;
  text-decoration: none;
}
.back-btn:hover { color: var(--ink); }

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 7px;
  color: var(--ink);
}
.field-label .optional { font-weight: 500; color: var(--soft); }

.field-input {
  width: 100%;
  box-sizing: border-box;
  height: 50px;
  padding: 0 16px;
  border: 0.5px solid var(--border-light);
  background: var(--input-bg);
  border-radius: 10px;
  font: 500 15px 'Manrope', sans-serif;
  color: var(--ink);
  outline: none;
  margin-bottom: 20px;
}
.field-input:focus { border-color: var(--terracotta); background: var(--input-bg-hover); }

.option-btn {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  background: var(--input-bg);
  border: 0.5px solid var(--border-light);
  border-radius: 10px;
  font: 500 14px 'Manrope', sans-serif;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: background .15s, border-color .15s;
  margin-bottom: 9px;
}
.option-btn:last-child { margin-bottom: 0; }
.option-btn:hover { border-color: var(--terracotta); background: var(--input-bg-hover); }

.chip-btn {
  min-height: 44px;
  padding: 10px 18px;
  background: var(--input-bg);
  border: 0.5px solid var(--border-light);
  border-radius: 999px;
  font: 500 13.5px 'Manrope', sans-serif;
  color: var(--ink);
  cursor: pointer;
}
.chip-btn:hover { border-color: var(--terracotta); background: var(--input-bg-hover); }

.lock-icon { display: inline-flex; flex-direction: column; align-items: center; }
.lock-icon .shackle { width: 8px; height: 6px; border: 1.5px solid var(--badge-muted); border-bottom: none; border-radius: 4px 4px 0 0; display: block; }
.lock-icon .body { width: 13px; height: 9px; background: var(--badge-muted); border-radius: 2.5px; display: block; }

.trust-note {
  margin: 16px 0 0;
  font-size: 12.5px;
  color: var(--soft);
  display: flex;
  align-items: center;
  gap: 8px;
}

.error-text { color: #b00020; font-size: 13px; margin-top: 12px; }

/* ============ Decorative background shapes ============ */

.decor { position: absolute; pointer-events: none; }
.decor-blob-lg { width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, rgba(230,210,184,.6), rgba(230,210,184,0) 65%); }
.decor-ring-dashed { border-radius: 50%; border: 1.5px dashed rgba(193,122,84,.4); }
.decor-ring-solid { border-radius: 50%; border: 1.5px solid rgba(230,210,184,.7); }
.decor-circle-fill { border-radius: 50%; background: rgba(230,210,184,.4); }
.decor-square { background: var(--accent); border-radius: 4px; }
.decor-square-outline { border: 1.5px solid var(--terracotta); border-radius: 3px; }

/* ============ Landing / quiz ============ */

.landing {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--cream);
  overflow: hidden;
}

.landing-header, .done-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  padding: 0 clamp(20px, 4.5vw, 56px);
  flex: none;
}
.landing-header img, .done-header img { height: 40px; display: block; }

.hero-row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: clamp(28px, 4vw, 64px);
  padding: clamp(24px, 3.5vw, 44px) clamp(20px, 4.5vw, 56px) 44px;
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
  justify-content: center;
}
.hero-copy { flex: 1 1 420px; max-width: 560px; }
.hero-copy h1 {
  margin: 0 0 22px;
  font-size: clamp(34px, 4.6vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 800;
  text-wrap: pretty;
}
.hero-copy h1 .grad {
  background: linear-gradient(100deg, var(--terracotta-light) 0%, var(--terracotta) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-steps { display: flex; flex-direction: column; gap: 14px; font-size: 15px; font-weight: 500; color: var(--soft); }
.hero-steps span.row { display: flex; align-items: center; gap: 12px; }
.step-badge {
  width: 24px; height: 24px; border-radius: 50%; background: var(--accent);
  color: var(--ink); display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: none;
}

.quiz-card {
  flex: 1 1 360px;
  max-width: 480px;
  background: #fff;
  border: 0.5px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(42,31,23,.08);
  padding: 0 0 28px;
  overflow: hidden;
}
.quiz-card-standalone {
  width: 100%;
  max-width: 560px;
  background: #fff;
  border: 0.5px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(42,31,23,.08);
  padding: 0 0 32px;
  overflow: hidden;
  margin: 0 auto;
}
.quiz-progress-track { height: 5px; background: var(--border-light); }
.quiz-progress-fill { height: 100%; background: var(--terracotta); border-radius: 0 3px 3px 0; transition: width .3s; }
.quiz-body { padding: 24px clamp(20px, 3vw, 28px) 0; }
.quiz-body h2 { margin: 12px 0 18px; font-size: 21px; font-weight: 700; }
.quiz-body p.hint { margin: 0 0 18px; font-size: 14px; line-height: 1.7; color: var(--soft); }

.q-page { position: relative; padding: clamp(20px, 4vw, 48px) 20px 72px; display: flex; justify-content: center; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }

.q-actions { display: flex; align-items: center; gap: 18px; margin-top: 26px; flex-wrap: wrap; }

.how-it-works {
  position: relative;
  background: #fff;
  border-top: 0.5px solid var(--border);
  border-radius: 32px 32px 0 0;
  padding: 44px clamp(20px, 4.5vw, 56px) 60px;
}
.how-it-works h2 { margin: 0 auto 40px; max-width: 1280px; font-size: clamp(26px, 2.8vw, 34px); font-weight: 800; }
.how-grid { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(20px, 2.5vw, 32px); max-width: 1280px; margin: 0 auto; }
.how-card {
  position: relative;
  flex: 1 1 240px;
  max-width: 360px;
  background: var(--input-bg);
  border: 0.5px solid var(--border-light);
  border-radius: 16px;
  padding: 30px 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform .25s;
}
.how-card:hover { transform: rotate(0deg) translateY(-3px); }
.how-card .num {
  position: absolute; top: -16px; left: -10px; width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent); color: var(--ink); display: grid; place-items: center;
  font-size: 16px; font-weight: 800; border: 3px solid #fff;
}
.how-card p.title { margin: 4px 0 0; font-size: 16px; font-weight: 800; }
.how-card p.desc { margin: 0; font-size: 14px; line-height: 1.7; color: var(--soft); }

/* ============ Rail layout (account / details / disclosure / sign) ============ */

.rail-layout { display: flex; flex-wrap: wrap; min-height: 100vh; background: var(--cream); }

.rail-side {
  flex: 1 1 300px;
  max-width: 100%;
  background: #fff;
  border-right: 0.5px solid var(--border);
  border-bottom: 0.5px solid var(--border);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 32px 36px 28px;
  box-sizing: border-box;
}
.rail-side img { position: relative; height: 34px; width: auto; display: block; margin-bottom: 48px; align-self: flex-start; }
.rail-side .badge-pill { position: relative; align-self: flex-start; }
.rail-side .rail-title { position: relative; font-size: 24px; font-weight: 700; line-height: 1.25; margin-top: 12px; }
.rail-progress-track { position: relative; height: 5px; background: var(--border-light); border-radius: 3px; margin-top: 22px; }
.rail-progress-fill { height: 100%; background: var(--terracotta); border-radius: 3px; transition: width .3s; }
.rail-footer { position: relative; margin-top: auto; padding-top: 40px; }
.rail-decor { position: absolute; pointer-events: none; }
.rail-decor-blob { bottom: -140px; left: -100px; width: 340px; height: 340px; border-radius: 50%; background: radial-gradient(circle at 40% 40%, rgba(230,210,184,.55), rgba(230,210,184,0) 70%); }
.rail-decor-ring { bottom: -80px; left: -40px; width: 220px; height: 220px; border-radius: 50%; border: 1.5px dashed rgba(193,122,84,.4); }
.rail-decor-sq1 { bottom: 150px; right: 36px; width: 13px; height: 13px; background: var(--accent); border-radius: 3px; transform: rotate(45deg); }
.rail-decor-sq2 { bottom: 90px; right: 70px; width: 9px; height: 9px; border: 1.5px solid var(--terracotta-light); border-radius: 2px; transform: rotate(45deg); opacity: .5; }

.rail-content { flex: 999 1 420px; padding: 36px clamp(20px, 5vw, 72px) 64px; box-sizing: border-box; }

.form-card {
  max-width: 590px;
  margin-top: 24px;
  background: #fff;
  border-radius: 16px;
  border: 0.5px solid var(--border);
  padding: 32px clamp(20px, 4vw, 36px) 36px;
}
.form-card.wide { max-width: 620px; }
.form-card p.hint { margin: 0 0 26px; font-size: 14px; line-height: 1.7; color: var(--soft); }

.callout {
  background: var(--input-bg);
  border: 0.5px solid var(--border-light);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--soft);
}
.callout a { color: var(--terracotta); }

/* Disclosure */
.disclosure-list { border-top: 0.5px solid var(--border-light); }
.disclosure-item { padding: 20px 2px; border-bottom: 0.5px solid var(--border-light); }
.disclosure-item h2 { margin: 0 0 8px; font-size: 16px; font-weight: 700; }
.disclosure-item p { margin: 0; font-size: 14px; line-height: 1.7; color: var(--soft); }
.disclosure-item a { text-decoration: underline; text-underline-offset: 3px; }

/* Sign */
.review-list { border-top: 0.5px solid var(--border-light); margin-bottom: 26px; }
.review-row { display: flex; justify-content: space-between; gap: 20px; padding: 12px 2px; border-bottom: 0.5px solid var(--border-light); font-size: 13px; }
.review-row .label { color: var(--soft); font-weight: 500; flex: none; }
.review-row .value { font-weight: 700; text-align: right; overflow-wrap: anywhere; }

.auth-box { background: var(--input-bg); border: 0.5px solid var(--border-light); border-radius: 10px; padding: 18px 20px; margin-bottom: 26px; }
.auth-box .badge-muted { margin-bottom: 10px; }
.auth-box p { margin: 0; font-size: 14px; line-height: 1.7; }

.sig-label-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sig-label-row label { font-size: 13px; font-weight: 700; }

.sig-wrap { position: relative; background: #FFFDF9; border: 1.5px dashed #D9C9B4; border-radius: 10px; overflow: hidden; }
.sig-wrap canvas { display: block; width: 100%; height: 180px; cursor: crosshair; touch-action: none; }
.sig-guideline { position: absolute; left: 22px; right: 22px; bottom: 36px; border-bottom: 1.5px solid var(--accent); pointer-events: none; }
.sig-hint { position: absolute; left: 22px; bottom: 13px; font-size: 12px; color: var(--badge-muted); pointer-events: none; }

/* ============ Done ============ */

.done-page-content { position: relative; padding: clamp(20px, 4vw, 48px) 20px 80px; display: flex; justify-content: center; }
.done-card {
  width: 100%; max-width: 640px; background: #fff; border: 0.5px solid var(--border);
  border-radius: 16px; box-shadow: 0 12px 32px rgba(42,31,23,.08); padding: 32px clamp(20px, 4vw, 40px) 36px;
  box-sizing: border-box;
}
.done-check {
  width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: var(--ink);
  display: grid; place-items: center; font-size: 22px; font-weight: 800; margin-bottom: 18px;
}
.done-card h1 { margin: 0 0 12px; font-size: clamp(26px, 3.2vw, 32px); line-height: 1.25; letter-spacing: -0.01em; font-weight: 700; text-wrap: pretty; }
.done-card p.lead { margin: 0 0 28px; font-size: 14px; line-height: 1.7; color: var(--soft); text-wrap: pretty; }

.doc-list { display: flex; flex-direction: column; border-top: 0.5px solid var(--border-light); margin-bottom: 8px; }
.doc-item { display: flex; align-items: flex-start; gap: 14px; padding: 16px 2px; border-bottom: 0.5px solid var(--border-light); }
.doc-check { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--ink); display: grid; place-items: center; font-size: 11px; font-weight: 800; flex: none; margin-top: 1px; }
.doc-item p { margin: 0; font-size: 14px; color: var(--ink); }

@media (max-width: 640px) {
  .rail-side { border-right: none; }
}
