:root {
  --terra: #a9746a;
  --terra-dark: #8f6158;
  --wine: #6e4a43;
  --wine-deep: #4e342e;
  --cream: #f5ece8;
  --cream-2: #fffaf6;
  --sky: #b9d7d9;
  --sky-light: #d9f0f2;
  --ink: #321f1b;
  --muted: #795c55;
  --white: #fff;
  --danger: #8d2821;
  --shadow: 0 26px 80px rgba(61, 34, 30, .24);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--cream);
  background:
    radial-gradient(circle at 82% 2%, rgba(185, 215, 217, .42), transparent 28rem),
    radial-gradient(circle at 8% 18%, rgba(255, 255, 255, .12), transparent 23rem),
    linear-gradient(135deg, var(--terra) 0%, var(--terra-dark) 46%, var(--wine) 100%);
  font-family: "Trebuchet MS", "Gill Sans", "Avenir Next", sans-serif;
  line-height: 1.55;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .17;
  background-image:
    linear-gradient(rgba(255,255,255,.28) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.22) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: linear-gradient(180deg, #000, transparent 78%);
}

a { color: inherit; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; }

.topbar {
  padding: 14px clamp(16px, 4vw, 34px);
  border-bottom: 1px solid rgba(255,255,255,.11);
  background: rgba(143,97,88,.88);
  backdrop-filter: blur(18px);
}

.topbar-inner,
.page-shell {
  width: min(100% - 28px, 980px);
  margin-inline: auto;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
  text-decoration: none;
}

.brand-logo {
  width: 52px;
  height: 52px;
  padding: 6px;
  border-radius: 18px;
  background: var(--cream);
  box-shadow: 0 16px 36px rgba(38,22,19,.22);
}

.brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.brand-copy { display: grid; line-height: 1.08; }
.brand-copy strong { font-family: Georgia, serif; font-size: 1.15rem; }
.brand-copy small { color: rgba(255,255,255,.72); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; }

.back-link {
  padding: 9px 14px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  color: var(--white);
  text-decoration: none;
  font-weight: 800;
}

.page-shell { padding: clamp(42px, 7vw, 76px) 0 72px; }

.intro { max-width: 760px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 12px; color: var(--sky-light); font-size: .8rem; font-weight: 950; letter-spacing: .16em; text-transform: uppercase; }
h1, h2 { font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; }
h1 { margin: 0; color: var(--white); font-size: clamp(3rem, 9vw, 6.2rem); line-height: .94; letter-spacing: -.05em; }
.intro > p:last-child { max-width: 700px; margin: 20px 0 0; color: rgba(255,255,255,.82); font-size: 1.08rem; }

.alert {
  margin: 0 0 18px;
  padding: 15px 18px;
  border-radius: 16px;
  color: #5f1915;
  background: #ffe2da;
  font-weight: 800;
}

.connection-form {
  padding: clamp(22px, 5vw, 46px);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 34px;
  color: var(--ink);
  background: rgba(255,250,246,.97);
  box-shadow: var(--shadow);
}

.form-section + .form-section {
  margin-top: 32px;
  padding-top: 30px;
  border-top: 1px solid rgba(110,74,67,.18);
}

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head h2 { margin: 0; color: var(--wine-deep); font-size: clamp(1.7rem, 4vw, 2.35rem); line-height: 1; }
.section-head p { margin: 0; color: var(--muted); font-size: .9rem; }

.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label, fieldset legend { color: var(--wine-deep); font-weight: 900; }
.optional { color: var(--muted); font-size: .8rem; font-weight: 500; }

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid rgba(110,74,67,.27);
  border-radius: 14px;
  padding: 13px 14px;
  color: var(--ink);
  background: var(--white);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.field textarea { min-height: 122px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--terra-dark); box-shadow: 0 0 0 4px rgba(169,116,106,.16); }

fieldset { margin: 0; padding: 0; border: 0; }
fieldset + fieldset { margin-top: 25px; }
fieldset legend { margin-bottom: 12px; font-size: 1.02rem; }

.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.choice-grid.ages { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid rgba(110,74,67,.18);
  border-radius: 14px;
  color: var(--wine-deep);
  background: rgba(169,116,106,.07);
  cursor: pointer;
}

.choice input { width: 18px; height: 18px; margin: 0; accent-color: var(--terra-dark); flex: 0 0 auto; }
.choice:has(input:checked) { border-color: var(--terra-dark); background: rgba(169,116,106,.16); }

.consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 28px;
  padding: 16px;
  border-radius: 16px;
  color: var(--wine-deep);
  background: rgba(185,215,217,.34);
  cursor: pointer;
}

.consent input { width: 19px; height: 19px; margin-top: 3px; accent-color: var(--terra-dark); flex: 0 0 auto; }
.consent span { font-size: .92rem; }

.form-actions { display: flex; align-items: center; gap: 18px; margin-top: 26px; }
.submit-button {
  min-height: 52px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  color: var(--white);
  background: var(--wine-deep);
  box-shadow: 0 14px 32px rgba(78,52,46,.2);
  font-weight: 950;
  cursor: pointer;
}
.submit-button:hover, .submit-button:focus-visible { background: var(--terra-dark); outline: 3px solid rgba(169,116,106,.24); }
.submit-button:disabled { opacity: .68; cursor: wait; }
.required-note { color: var(--muted); font-size: .84rem; }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.thank-shell { min-height: calc(100vh - 81px); display: grid; place-items: center; }
.thank-card { width: min(100% - 28px, 900px); padding: clamp(18px, 4vw, 34px); border: 1px solid rgba(255,255,255,.18); border-radius: 34px; background: rgba(78,52,46,.38); box-shadow: var(--shadow); text-align: center; }
.thank-image { width: 100%; border-radius: 22px; box-shadow: 0 20px 50px rgba(49,30,28,.25); }
.thank-card h1 { margin-top: 28px; font-size: clamp(2.3rem, 7vw, 4.4rem); }
.thank-card p { max-width: 620px; margin: 14px auto 0; color: rgba(255,255,255,.82); font-size: 1.06rem; }
.thank-card .back-link { display: inline-flex; margin-top: 24px; background: var(--sky); color: var(--wine-deep); border-color: transparent; }

@media (max-width: 700px) {
  .brand-copy small { display: none; }
  .fields, .choice-grid, .choice-grid.ages { grid-template-columns: 1fr; }
  .section-head { display: block; }
  .section-head p { margin-top: 7px; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .submit-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
