:root {
  --background: #0c0c0c;
  --foreground: #f3f1ed;
  --primary: #88bbd6;
  --primary-foreground: #0c0c0c;
  --secondary: #b69714;
  --muted: #a8a29e;
  --muted-strong: #c8c2b8;
  --card: #141414;
  --border: rgba(255, 255, 255, 0.12);
  --input: rgba(255, 255, 255, 0.16);
  --danger: #e26565;
  --danger-bg: rgba(226, 101, 101, 0.06);
  --radius: 8px;
  --font-display: "Fraunces", Georgia, serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--background);
  color: var(--foreground);
}

button,
input,
textarea {
  font: inherit;
}

fieldset {
  min-inline-size: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
}

::selection {
  background: rgba(136, 187, 214, 0.38);
}

.app-root {
  min-height: 100dvh;
}

.shell {
  width: min(100%, 42rem);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.intro-shell {
  width: min(100%, 36rem);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: 5rem;
}

.eyebrow {
  margin: 0 0 1.5rem;
  color: var(--secondary);
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0;
}

.intro-title {
  max-width: 36rem;
  margin-bottom: 1.5rem;
  font-size: clamp(2.45rem, 4vw, 3rem);
  line-height: 1.03;
}

.intro-title em,
.accent {
  color: var(--primary);
  font-style: normal;
}

.intro-copy {
  max-width: 34rem;
  margin: 0 0 1rem;
  color: rgba(243, 241, 237, 0.82);
  font-size: 1.125rem;
  line-height: 1.65;
}

.intro-copy.muted,
.muted {
  color: var(--muted);
}

.small-note {
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 2.75rem;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 0.72rem 1.45rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease, opacity 0.16s ease;
}

.primary-button {
  background: var(--primary);
  color: var(--primary-foreground);
}

.primary-button:hover {
  background: #9bc7df;
}

.primary-button:disabled {
  opacity: 0.62;
}

.secondary-button {
  background: transparent;
  border-color: var(--border);
  color: var(--foreground);
}

.secondary-button:hover {
  border-color: rgba(243, 241, 237, 0.5);
}

.ghost-button {
  background: transparent;
  border-color: transparent;
  color: rgba(243, 241, 237, 0.8);
}

.ghost-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  color: var(--foreground);
}

.ghost-button:disabled {
  color: rgba(168, 162, 158, 0.42);
}

.form-page {
  min-height: 100dvh;
  background: var(--background);
}

.form-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: rgba(12, 12, 12, 0.9);
  backdrop-filter: blur(12px);
}

.header-inner {
  width: min(100%, 42rem);
  margin: 0 auto;
  padding: 1rem 1rem 0.95rem;
}

.top-row,
.progress-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.brand-link {
  border: 0;
  background: transparent;
  color: rgba(243, 241, 237, 0.72);
  font-family: var(--font-display);
  font-size: 0.875rem;
  padding: 0;
}

.brand-link:hover {
  color: var(--foreground);
}

.header-label {
  color: var(--muted);
  font-size: 0.75rem;
}

.progress-region {
  margin-top: 0.75rem;
}

.progress-title {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.progress-number {
  flex: 0 0 auto;
  color: var(--secondary);
  font-family: var(--font-display);
  font-size: 0.875rem;
  letter-spacing: 0.12em;
}

.progress-name {
  overflow: hidden;
  color: rgba(243, 241, 237, 0.9);
  font-size: 0.875rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.75rem;
}

.progress-track {
  height: 3px;
  margin-top: 0.5rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 0.28s ease-out;
}

.form-main {
  width: min(100%, 42rem);
  margin: 0 auto;
  padding: 2.5rem 1rem 3.5rem;
}

.section-head {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.section-kicker {
  margin: 0 0 0.5rem;
  color: var(--secondary);
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.section-title {
  color: var(--foreground);
  font-size: clamp(1.9rem, 5vw, 2.45rem);
  line-height: 1.18;
}

.section-description {
  max-width: 38rem;
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.65;
}

.fields-grid {
  display: grid;
  gap: 2rem;
}

.field-label,
.field-legend {
  display: block;
  color: rgba(243, 241, 237, 0.92);
  font-size: 0.875rem;
  font-weight: 500;
}

.required-mark {
  margin-left: 0.25rem;
  color: var(--secondary);
}

.text-input,
.textarea-input,
.number-input {
  width: 100%;
  margin-top: 0.5rem;
  border: 0;
  border-bottom: 1px solid var(--input);
  border-radius: 0;
  background: transparent;
  color: var(--foreground);
  font-size: 1rem;
  outline: none;
  padding: 0.55rem 0;
  transition: border-color 0.16s ease;
}

.textarea-input {
  min-height: 7rem;
  resize: vertical;
  border: 1px solid var(--input);
  border-radius: 6px;
  background: var(--card);
  padding: 0.75rem;
  line-height: 1.55;
}

.number-input {
  max-width: 10rem;
}

.text-input::placeholder,
.textarea-input::placeholder {
  color: rgba(168, 162, 158, 0.62);
}

.text-input:focus,
.textarea-input:focus,
.number-input:focus {
  border-color: var(--primary);
}

.is-invalid .text-input,
.is-invalid .textarea-input,
.is-invalid .number-input,
.is-invalid.option-card,
.is-invalid.consent-card {
  border-color: rgba(226, 101, 101, 0.78);
}

.helper {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.options-grid {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.options-grid.checkbox-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.option-card,
.consent-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  padding: 0.75rem;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.option-card:hover,
.consent-card:hover {
  border-color: rgba(243, 241, 237, 0.32);
}

.option-card.selected,
.consent-card.selected {
  border-color: var(--primary);
  background: rgba(136, 187, 214, 0.05);
}

.sr-control {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  opacity: 0;
  overflow: hidden;
}

.control-mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 1rem;
  height: 1rem;
  margin-top: 0.12rem;
  border: 1px solid rgba(168, 162, 158, 0.58);
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.radio-mark {
  border-radius: 50%;
}

.checkbox-mark {
  border-radius: 4px;
}

.option-card.selected .control-mark,
.consent-card.selected .control-mark {
  border-color: var(--primary);
}

.option-card.selected .checkbox-mark,
.consent-card.selected .checkbox-mark {
  background: var(--primary);
}

.radio-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--primary);
}

.check-icon {
  width: 0.65rem;
  height: 0.65rem;
  color: var(--primary-foreground);
}

.option-text {
  color: rgba(243, 241, 237, 0.9);
  font-size: 0.94rem;
  line-height: 1.38;
}

.yesno-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.pill-button {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: rgba(243, 241, 237, 0.82);
  font-size: 0.875rem;
  padding: 0.55rem 1.25rem;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.pill-button:hover {
  border-color: rgba(243, 241, 237, 0.38);
}

.pill-button.selected {
  border-color: var(--primary);
  background: rgba(136, 187, 214, 0.1);
  color: var(--primary);
}

.other-block {
  margin-top: 0.75rem;
}

.other-toggle {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.875rem;
  padding: 0;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
}

.other-toggle:hover,
.other-toggle.active {
  color: var(--primary);
  text-decoration-color: currentColor;
}

.honeypot {
  position: absolute;
  top: auto;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.turnstile-wrap {
  display: flex;
  justify-content: center;
  margin-top: 2.5rem;
}

.turnstile-missing {
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 0.85rem 1rem;
}

.form-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.error-box {
  margin-top: 2rem;
  border: 1px solid rgba(226, 101, 101, 0.42);
  border-radius: var(--radius);
  background: var(--danger-bg);
  padding: 1.5rem;
}

.error-title {
  margin-bottom: 0.5rem;
  color: var(--foreground);
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.error-copy {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.55;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.success-shell {
  min-height: 100dvh;
  display: flex;
  align-items: center;
}

.success-copy {
  max-width: 32rem;
  margin: 1.25rem 0 0;
  color: rgba(243, 241, 237, 0.8);
  font-size: 1.05rem;
  line-height: 1.7;
}

.spinner {
  display: inline-block;
  width: 0.82rem;
  height: 0.82rem;
  border: 2px solid rgba(12, 12, 12, 0.35);
  border-top-color: var(--primary-foreground);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 640px) {
  .intro-shell {
    justify-content: flex-start;
    padding-top: 11rem;
  }

  .intro-title {
    font-size: 2.45rem;
  }

  .intro-copy {
    font-size: 1.02rem;
  }

  .header-inner,
  .form-main {
    padding-inline: 1.5rem;
  }

  .form-main {
    padding-top: 2.25rem;
  }

  .top-row {
    align-items: center;
  }

  .options-grid.checkbox-grid {
    grid-template-columns: 1fr;
  }

  .form-nav {
    gap: 0.65rem;
  }

  .form-nav .primary-button,
  .form-nav .ghost-button {
    padding-inline: 1rem;
  }
}

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