/* Market Better — The Content Funnel
   Shared design system for the three application-funnel pages.
   Light is the default; dark is opt-in via [data-theme="dark"] on <html>. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* The `hidden` attribute is only `display: none` in the UA stylesheet, so any
   author rule that sets `display` silently outranks it — .cta-btn's flex did
   exactly that and kept the submit button on screen through every step. */
[hidden] { display: none !important; }

/* ── Light (default) ── */
:root {
  --page:        #f4f3f0;
  --page-alt:    #eceae5;
  --card:        #fffefc;
  --accent:      #f54e29;
  --accent-dark: #d63d1c;
  --accent-soft: #f9a893;
  /* Market Better's structural colour, from the brand theme's
     --primary: hsl(250 58% 43%). */
  --structure:   #432ead;
  --on-structure:#ffffff;
  /* The testimonial band keeps the same purple and cream in both themes:
     it is a printed-looking panel, not a surface that follows the page. */
  --band:        #432ead;
  --band-card:   #efeadc;
  --band-ink:    #17161a;
  --band-muted:  #5f5c66;
  --ink:         #14140f;
  --ink-soft:    #35342e;
  --ink-muted:   #5f5f53;
  --ink-faint:   #8e8b80;
  --border:      #dcd9d2;
  --danger:      #b3381a;
}

/* ── Dark ── */
:root[data-theme="dark"] {
  --page:        #14140f;
  --page-alt:    #1d1d18;
  --card:        #1d1d18;
  --accent:      #ff6440;
  --accent-dark: #f54e29;
  --accent-soft: #7a3928;
  --structure:   #8f78e8;
  --on-structure:#14140f;
  --band:        #2e2078;
  --band-card:   #efeadc;
  --band-ink:    #17161a;
  --band-muted:  #5f5c66;
  --ink:         #f2ede4;
  --ink-soft:    #d8d2c6;
  --ink-muted:   #a29c8e;
  --ink-faint:   #7a7568;
  --border:      #34342d;
  --danger:      #ff8566;
}

body {
  font-family: 'Roboto', system-ui, sans-serif;
  background: var(--page);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s ease, color 0.2s ease;
}

/* ── Nav ── */
.nav {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 1.25rem 3rem 1.1rem;
  background: var(--page);
  border-bottom: 0.5px solid var(--border);
}

.nav-logo { display: flex; align-items: center; }

/* The wordmark is stacked ("market" over "better."), so it needs roughly
   twice the height a single-line lockup would to stay readable. */
.nav-logo img {
  height: 42px;
  width: auto;
}

/* Exactly one logo variant is visible per theme. Keep `display` out of the
   rules above, or their higher specificity wins and both variants render. */
.logo-light { display: block; }
.logo-dark  { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark  { display: block; }

.nav-tag {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ── Theme toggle ── */
.theme-toggle {
  position: absolute;
  right: 1.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0.5px solid var(--border);
  background: var(--card);
  color: var(--ink-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

.theme-toggle svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun  { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }

/* ── Layout ── */
.page-wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 3.5rem 2rem 4rem;
}

.narrow { max-width: 660px; margin-left: auto; margin-right: auto; }

/* ── Hero type ── */
.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  line-height: 1.6;
  margin-bottom: 1.4rem;
}

.headline {
  font-family: 'Archivo', sans-serif;
  font-size: 46px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 1.25rem;
}

.headline em { font-style: normal; color: var(--accent); }

.subheadline {
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--ink-soft);
  margin-bottom: 2.5rem;
}

.section-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.1rem;
}

/* ── Credential bar ── */
.credential-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 0.5px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--card);
}

.cred-item {
  padding: 0.95rem 1.1rem;
  border-right: 0.5px solid var(--border);
}

.cred-item:last-child { border-right: none; }

.cred-label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}

.cred-value {
  display: block;
  font-family: 'Archivo', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  line-height: 1.4;
}

/* ── Card ── */
.form-card {
  background: var(--card);
  border-radius: 12px;
  padding: 2.25rem 2rem 2rem;
  border: 0.5px solid var(--border);
}

.form-eyebrow {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.form-title {
  font-family: 'Archivo', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.5rem;
  line-height: 1.25;
}

.form-subtitle {
  font-size: 13px;
  color: var(--ink-muted);
  margin-bottom: 1.75rem;
  line-height: 1.65;
}

/* ── Form controls ── */
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

.form-row { margin-bottom: 1.15rem; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}

.form-input {
  width: 100%;
  height: 46px;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  padding: 0 1rem;
  font-size: 14px;
  font-family: 'Roboto', sans-serif;
  background: var(--page);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.form-input:focus { border-color: var(--accent); background: var(--card); }
.form-input::placeholder { color: var(--ink-faint); }
.form-input.invalid { border-color: var(--danger); }

/* Native select arrows differ per platform, so the control is reset and the
   chevron is drawn by .select-wrap::after, which can follow the theme. */
.select-wrap { position: relative; }

.select-wrap::after {
  content: '';
  position: absolute;
  right: 1rem;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -6px;
  border-right: 1.5px solid var(--ink-muted);
  border-bottom: 1.5px solid var(--ink-muted);
  transform: rotate(45deg);
  pointer-events: none;
}

select.form-input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.5rem;
  cursor: pointer;
}

select.form-input:invalid,
select.form-input option[value=""] { color: var(--ink-faint); }

.cta-btn {
  width: 100%;
  height: 52px;
  background: var(--accent);
  color: #fffefc;
  border: none;
  border-radius: 10px;
  font-family: 'Roboto', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.15s, transform 0.1s;
  margin-top: 0.5rem;
}

.cta-btn:hover  { background: var(--accent-dark); }
.cta-btn:active { transform: scale(0.99); }

.cta-btn:disabled {
  background: var(--accent-soft);
  cursor: default;
  transform: none;
}

.field-error {
  display: none;
  font-size: 11px;
  color: var(--danger);
  margin-top: 5px;
  line-height: 1.4;
}

.field-error.visible { display: block; }

.consent-note {
  font-size: 10.5px;
  color: var(--ink-muted);
  line-height: 1.6;
  margin-top: 0.85rem;
  text-align: center;
}

.form-status-error {
  display: none;
  font-size: 12px;
  color: var(--danger);
  line-height: 1.55;
  margin-top: 1rem;
  text-align: center;
}

.form-status-error.visible { display: block; }

.trust-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--ink-faint);
  margin-top: 0.85rem;
  letter-spacing: 0.04em;
}

.trust-line svg {
  width: 11px;
  height: 11px;
  stroke: var(--ink-faint);
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.disclaimer {
  margin-top: 1.5rem;
  font-size: 10px;
  color: var(--ink-faint);
  line-height: 1.7;
  text-align: center;
}

/* ── Testimonial band ──
   Lifted from the Market Better brand theme: purple panel, cream cards,
   the heading's full stop in the accent colour. Full-bleed, so it breaks
   out of .page-wrap's max width. */
.band {
  background: var(--band);
  color: #fff;
  padding: 4.5rem 0;
  margin-top: 4.5rem;
}

.band-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 2rem;
}

.band-heading {
  font-family: 'Archivo', sans-serif;
  font-size: 40px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.015em;
  text-align: center;
  margin-bottom: 3rem;
}

.band-heading span { color: var(--accent); }

.quotes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  align-items: stretch;
}

.quote-card {
  display: flex;
  flex-direction: column;
  background: var(--band-card);
  color: var(--band-ink);
  border-radius: 8px;
  padding: 1.75rem 1.6rem;
}

.quote-mark {
  width: 26px;
  height: 26px;
  margin-bottom: 1rem;
  stroke: var(--accent);
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.quote-text {
  font-family: 'Archivo', sans-serif;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 1.5rem;
  flex: 1;
}

.quote-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid var(--band);
  object-fit: cover;
  display: block;
  margin-bottom: 0.7rem;
}

.quote-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--band-ink);
}

.quote-title {
  font-size: 12.5px;
  color: var(--band-muted);
  margin-bottom: 1.25rem;
}

.quote-logo {
  margin-top: auto;
  height: 34px;
  max-width: 155px;
  object-fit: contain;
  object-position: left;
}

@media (max-width: 860px) {
  .band-heading { font-size: 30px; }
  .quotes { grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
  .band { padding: 3rem 0; margin-top: 3rem; }
  .band-inner { padding: 0 1.25rem; }
  .band-heading { font-size: 25px; margin-bottom: 2rem; }
}

/* ── Footer ── */
.page-footer {
  text-align: center;
  padding: 2.5rem 0 0;
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.05em;
  border-top: 0.5px solid var(--border);
  margin-top: 3.5rem;
}

/* ── Responsive ── */
@media (max-width: 860px) {
  .headline { font-size: 36px; }
  .nav { padding: 1rem 1.5rem; }
  .theme-toggle { right: 1rem; }
}

@media (max-width: 540px) {
  .headline { font-size: 29px; }
  .page-wrap { padding: 2.25rem 1.25rem 3rem; }
  .form-card { padding: 1.75rem 1.25rem 1.5rem; }
  .form-grid { grid-template-columns: 1fr; }
  .credential-bar { grid-template-columns: 1fr; }
  .cred-item { border-right: none; border-bottom: 0.5px solid var(--border); }
  .cred-item:last-child { border-bottom: none; }
  .nav-logo img { height: 34px; }
  .theme-toggle { right: 0.75rem; width: 30px; height: 30px; }
}
