:root {
  --ink: #1e1d1a;
  --paper: #f7f0e6;
  --paper-deep: #eadbc8;
  --glass: rgba(255, 250, 244, 0.64);
  --glass-strong: rgba(255, 250, 244, 0.78);
  --accent: #264653;
  --accent-soft: #d7e4e4;
  --earth: #9b6b4f;
  --sand: #f1e6d6;
  --line: rgba(30, 29, 26, 0.14);
  --success: #2d6a4f;
  --danger: #9d2a2a;
  --shadow: 0 22px 70px rgba(30, 29, 26, 0.12);
  --radius-lg: 30px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --max-width: 1180px;
}

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

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(155, 107, 79, 0.24), transparent 28%),
    radial-gradient(circle at 85% 10%, rgba(38, 70, 83, 0.22), transparent 24%),
    linear-gradient(180deg, rgba(251, 246, 239, 0.92) 0%, rgba(247, 240, 230, 0.9) 45%, rgba(248, 241, 231, 0.94) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.08)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.8;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(115deg, rgba(251, 246, 239, 0.82) 10%, rgba(251, 246, 239, 0.55) 35%, rgba(251, 246, 239, 0.82) 75%),
    url("/assets/images/IMG_4712.jpg") left center / cover no-repeat,
    url("/assets/images/IMG_4710.jpg") right center / cover no-repeat;
  filter: saturate(0.94) blur(8px);
  transform: scale(1.04);
  opacity: 0.92;
}

body[data-experience-variant="plain-quiz"] {
  background: linear-gradient(180deg, #fbf6ef 0%, var(--paper) 45%, #f8f1e7 100%);
}

body[data-experience-variant="plain-quiz"]::after {
  background: none;
  filter: none;
  opacity: 0;
}

a {
  color: inherit;
}

.page-shell {
  position: relative;
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
  padding: 1.2rem 0 3.5rem;
}

.page-shell::before,
.page-shell::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
  border-radius: 36px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.page-shell::before {
  top: 8rem;
  left: max(1rem, calc(50% - 760px));
  width: 240px;
  height: 360px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.04)),
    url("/assets/images/IMG_3688.webp") center / cover no-repeat;
  border: 1px solid rgba(255, 255, 255, 0.34);
  box-shadow: 0 28px 90px rgba(38, 70, 83, 0.16);
  opacity: 0.78;
}

.page-shell::after {
  right: max(1rem, calc(50% - 760px));
  bottom: 4rem;
  width: 280px;
  height: 220px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.03)),
    url("/assets/images/IMG_3693.webp") center / cover no-repeat;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 24px 80px rgba(155, 107, 79, 0.15);
  opacity: 0.72;
}

body[data-experience-variant="plain-quiz"] .page-shell::before,
body[data-experience-variant="plain-quiz"] .page-shell::after {
  display: none;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0 1.5rem;
}

.brand {
  display: inline-flex;
  flex-direction: column;
  gap: 0.15rem;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.55rem;
}

.brand-logo {
  display: block;
  height: auto;
  object-fit: contain;
}

.brand-home-link {
  display: inline-flex;
}

.brand-logo-appleby {
  width: 96px;
}

.brand-logo-bm {
  width: 116px;
}

.brand-divider {
  width: 1px;
  height: 34px;
  background: rgba(30, 29, 26, 0.2);
}

.brand-kicker,
.panel-label,
.eyebrow,
.strip-label {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 800;
  color: rgba(30, 29, 26, 0.62);
}

.brand-title {
  font-family: "Fraunces", serif;
  font-size: 1.35rem;
  font-weight: 700;
}

.header-link,
.secondary-link {
  font-weight: 700;
  text-decoration: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 1.5rem;
  align-items: stretch;
  margin-bottom: 2rem;
}

.hero-copy,
.hero-panel,
.local-help-section,
.form-section,
.support-strip,
.thank-you-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  box-shadow: var(--shadow);
}

.hero-copy {
  position: relative;
  overflow: hidden;
  padding: clamp(2rem, 3vw, 3rem);
}

.hero-copy::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255, 250, 244, 0.97) 10%, rgba(255, 250, 244, 0.9) 44%, rgba(255, 250, 244, 0.96) 88%),
    url("/assets/images/IMG_4711.jpg") center right / cover no-repeat;
  opacity: 0.94;
  z-index: 0;
}

body[data-experience-variant="plain-quiz"] .hero-copy::before {
  background: linear-gradient(120deg, rgba(255, 250, 244, 0.94) 12%, rgba(255, 250, 244, 0.88) 45%, rgba(255, 250, 244, 0.94) 88%);
}

.hero-copy > * {
  position: relative;
  z-index: 1;
}

.hero-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.6rem;
  background:
    linear-gradient(160deg, rgba(38, 70, 83, 0.92), rgba(44, 55, 58, 0.9)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05)),
    url("/assets/images/IMG_3683.webp") center / cover no-repeat;
  color: #f7f2eb;
}

body[data-experience-variant="plain-quiz"] .hero-panel {
  background:
    linear-gradient(160deg, rgba(38, 70, 83, 0.92), rgba(44, 55, 58, 0.95)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
}

.hero-panel .panel-label,
.hero-panel .panel-proof {
  color: rgba(247, 242, 235, 0.82);
}

.local-help-section {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 1.2rem;
  align-items: stretch;
  padding: clamp(1.4rem, 2.4vw, 2rem);
  margin-bottom: 1.5rem;
  background:
    linear-gradient(135deg, rgba(255, 250, 244, 0.9), rgba(255, 250, 244, 0.68)),
    radial-gradient(circle at 90% 15%, rgba(38, 70, 83, 0.13), transparent 30%);
}

.local-help-copy {
  max-width: 46rem;
}

.local-help-copy p {
  margin: 1rem 0 0;
  font-size: 1rem;
  line-height: 1.7;
}

.local-help-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem;
  border: 1px solid rgba(38, 70, 83, 0.14);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.56);
}

.local-help-list {
  display: grid;
  gap: 0.75rem;
  padding-left: 1.1rem;
  margin: 0;
  line-height: 1.55;
}

.local-help-button {
  width: 100%;
}

h1,
h2,
h3,
legend {
  margin: 0;
  font-family: "Fraunces", serif;
  line-height: 0.98;
  letter-spacing: -0.02em;
}

h1 {
  max-width: 11ch;
  font-size: clamp(3rem, 7vw, 5.8rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
  font-size: 1.7rem;
}

.hero-text,
.section-head p,
.strip-text,
.feedback,
.privacy-copy,
.submission-hint,
.panel-proof,
.panel-steps,
.next-step-panel p,
.submission-meta dd {
  font-size: 1rem;
  line-height: 1.7;
}

.hero-text {
  max-width: 60ch;
  margin: 1.2rem 0 0;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.6rem;
}

.hero-points span {
  padding: 0.75rem 1rem;
  border: 1px solid rgba(38, 70, 83, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  font-size: 0.92rem;
  font-weight: 700;
}

.panel-steps {
  padding-left: 1.2rem;
  margin: 0.8rem 0 0;
}

.panel-steps li + li {
  margin-top: 0.7rem;
}

.form-section {
  padding: clamp(1.6rem, 2vw, 2rem);
}

.section-head {
  max-width: 58rem;
  margin-bottom: 1.8rem;
}

.form-progress {
  display: grid;
  gap: 0.7rem;
  margin-bottom: 1.4rem;
}

.form-progress-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.progress-step-title {
  font-family: "Fraunces", serif;
  font-size: 1.25rem;
}

.progress-track {
  position: relative;
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(38, 70, 83, 0.11);
}

.progress-bar {
  display: block;
  height: 100%;
  width: 25%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent), #2f5f73);
  transition: width 220ms ease;
}

.flow-steps {
  position: relative;
  min-height: 34rem;
}

.flow-step {
  display: none;
  animation: stepFade 220ms ease;
}

.flow-step.is-active {
  display: block;
}

.step-intro {
  margin: 0.5rem 0 1rem;
  font-size: 0.98rem;
  line-height: 1.6;
}

.input-group {
  min-width: 0;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--glass-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

body[data-experience-variant="plain-quiz"] .hero-copy,
body[data-experience-variant="plain-quiz"] .hero-panel,
body[data-experience-variant="plain-quiz"] .local-help-section,
body[data-experience-variant="plain-quiz"] .form-section,
body[data-experience-variant="plain-quiz"] .support-strip,
body[data-experience-variant="plain-quiz"] .thank-you-card,
body[data-experience-variant="plain-quiz"] .input-group {
  background: rgba(255, 250, 244, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

body[data-experience-variant="plain-quiz"] .form-section::before,
body[data-experience-variant="plain-quiz"] .support-strip::before {
  display: none;
}

legend {
  padding: 0 0.5rem 0 0;
  font-size: 1.25rem;
}

label,
.checkbox {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  font-weight: 700;
}

.input-group > label + label,
.notes-field textarea {
  margin-top: 0.95rem;
}

label span,
.notes-field span {
  font-size: 0.92rem;
}

.field-error {
  display: block;
  min-height: 1.1rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--danger);
}

.checkbox-error {
  margin-top: -0.15rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(30, 29, 26, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.95);
  padding: 0.9rem 1rem;
  font: inherit;
  color: var(--ink);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(38, 70, 83, 0.72);
  box-shadow: 0 0 0 5px rgba(38, 70, 83, 0.12);
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: rgba(157, 42, 42, 0.6);
  box-shadow: 0 0 0 5px rgba(157, 42, 42, 0.1);
}

.consent-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.6rem;
  margin-top: 1.2rem;
}

.contact-step {
  position: relative;
}

.contact-step-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem 0.9rem;
  align-items: start;
}

.contact-fields {
  display: contents;
}

.contact-fields label,
.contact-review .notes-field {
  margin-top: 0;
}

.contact-review {
  display: contents;
}

.contact-review .notes-field textarea {
  min-height: 10.5rem;
}

.contact-review .notes-field,
.consent-row {
  grid-column: 1 / -1;
}

.checkbox {
  flex-direction: row;
  align-items: flex-start;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.7);
}

.checkbox input {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.15rem;
  flex: 0 0 auto;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  align-items: flex-start;
  margin-top: 1.4rem;
}

.form-actions-quiz {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
}

.form-actions-quiz #prev-step-button {
  grid-column: 1;
  justify-self: start;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0.95rem 1.4rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #2f5f73);
  color: #fcfaf6;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
  box-shadow: 0 14px 26px rgba(38, 70, 83, 0.28);
}

.form-actions-quiz .primary-button,
.form-actions-quiz .secondary-button {
  min-width: 148px;
}

.primary-button:hover,
.primary-button:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0.95rem 1.4rem;
  border: 1px solid rgba(38, 70, 83, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.form-actions-quiz .secondary-button {
  box-shadow: none;
}

.form-actions-quiz #next-step-button,
.form-actions-quiz #submit-step-button {
  grid-column: 2;
  justify-self: end;
  margin-left: 0;
}

.secondary-button[hidden],
.primary-button[hidden] {
  display: none;
}

@keyframes stepFade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.feedback {
  min-height: 1.5rem;
  margin-top: 0.8rem;
}

.feedback.is-error {
  color: var(--danger);
}

.feedback.is-success {
  color: var(--success);
}

.support-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding: 1.3rem 1.5rem;
  margin-top: 1.5rem;
}

.support-strip,
.form-section {
  position: relative;
  overflow: hidden;
}

.support-strip::before,
.form-section::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 42%, rgba(38, 70, 83, 0.06) 100%);
}

.thank-you-shell {
  display: grid;
  min-height: 100vh;
  align-items: center;
}

.thank-you-layout {
  display: grid;
  place-items: center;
}

.thank-you-card {
  width: min(100%, 780px);
  padding: clamp(1.8rem, 4vw, 3rem);
}

.next-step-panel {
  margin-top: 1.5rem;
  padding: 1.2rem 1.3rem;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(38, 70, 83, 0.1), rgba(38, 70, 83, 0.04));
  border: 1px solid rgba(38, 70, 83, 0.14);
}

.thank-you-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-top: 1.6rem;
}

.submission-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.8rem 0 0;
}

.submission-meta div {
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.submission-meta dt {
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 800;
  color: rgba(30, 29, 26, 0.62);
}

.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 920px) {
  .hero,
  .local-help-section,
  .support-strip,
  .submission-meta {
    grid-template-columns: 1fr;
  }

  .contact-step-layout,
  .contact-fields {
    grid-template-columns: 1fr;
  }

  .contact-review {
    display: contents;
  }

  .page-shell::before,
  .page-shell::after {
    display: none;
  }

  body::after {
    background:
      linear-gradient(180deg, rgba(251, 246, 239, 0.84), rgba(251, 246, 239, 0.9)),
      url("/assets/images/IMG_4712.jpg") center / cover no-repeat;
    filter: saturate(0.95) blur(6px);
  }

  h1 {
    max-width: 12ch;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(calc(100% - 1rem), var(--max-width));
    padding-bottom: 2rem;
  }

  .site-header {
    padding-top: 0.5rem;
  }

  .brand-lockup {
    gap: 0.6rem;
    flex-wrap: wrap;
  }

  .brand-logo-appleby {
    width: 78px;
  }

  .brand-logo-bm {
    width: 96px;
  }

  .hero-copy,
  .local-help-section,
  .form-section,
  .hero-panel,
  .support-strip,
  .thank-you-card {
    border-radius: 22px;
  }

  .hero-copy::before {
    background:
      linear-gradient(180deg, rgba(255, 250, 244, 0.94), rgba(255, 250, 244, 0.88)),
      url("/assets/images/IMG_4711.jpg") center / cover no-repeat;
  }

  .input-group {
    padding: 1rem;
  }

  .flow-steps {
    min-height: auto;
  }

  .form-actions-quiz {
    grid-template-columns: 1fr;
  }

  .form-actions-quiz #prev-step-button,
  .form-actions-quiz #next-step-button,
  .form-actions-quiz .primary-button {
    grid-column: 1;
    justify-self: stretch;
    margin-left: 0;
  }

  .thank-you-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .thank-you-actions .secondary-link {
    text-align: center;
  }
}
