:root {
  color-scheme: dark;
  --background: #171717;
  --surface: #f7f4ec;
  --field: #fffdf8;
  --ink: #252525;
  --muted: #6e6e69;
  --line: #dad7ce;
  --accent: #2d2d2b;
  --accent-hover: #171717;
  --error: #923e36;
  --error-bg: #f8e9e5;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: #f4f3ef;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page-shell {
  width: min(620px, calc(100% - 28px));
  margin: 0 auto;
  padding: 48px 0 64px;
}

.page-header {
  margin-bottom: 26px;
}

.site-name {
  margin: 0 0 28px;
  color: #c6c6c1;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

h1 {
  margin: 0;
  font-size: clamp(38px, 8vw, 52px);
  font-weight: 620;
  line-height: 1;
  letter-spacing: -0.05em;
}

.page-header > p:last-child {
  max-width: 500px;
  margin: 14px 0 0;
  color: #bfbfba;
  font-size: 14px;
  line-height: 1.55;
}

.form-card {
  border: 1px solid #deded8;
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}

.form-section {
  margin: 0;
  padding: 24px 28px;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.form-section legend {
  float: left;
  width: 100%;
  margin: 0 0 18px;
  padding: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.form-section legend + * {
  clear: both;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field-wide {
  grid-column: 1 / -1;
}

.field label,
.field-label {
  display: block;
  margin: 0 0 6px;
  color: #525252;
  font-size: 11px;
  font-weight: 650;
}

input {
  width: 100%;
  height: 46px;
  border: 1px solid #cecec9;
  border-radius: 6px;
  outline: none;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

input {
  padding: 0 13px;
}

input::placeholder {
  color: #92928e;
}

input:focus {
  border-color: #747474;
  box-shadow: 0 0 0 3px rgba(45, 45, 43, 0.1);
}

input[aria-invalid="true"] {
  border-color: #ac554c;
}

.choice-field {
  margin: 0;
}

.choice-grid {
  display: grid;
  gap: 6px;
}

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

.three-choices {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.four-choices {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.choice {
  margin: 0;
  cursor: pointer;
}

.choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.choice span {
  display: grid;
  place-items: center;
  min-height: 38px;
  padding: 6px 8px;
  border: 1px solid #cecec9;
  border-radius: 6px;
  background: var(--field);
  color: #505050;
  font-size: 12px;
  font-weight: 580;
  text-align: center;
  transition: border-color 130ms ease, background 130ms ease, color 130ms ease;
}

.choice input:checked + span {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.choice input:focus-visible + span {
  outline: 3px solid rgba(45, 45, 43, 0.16);
  outline-offset: 2px;
}

.choice input[aria-invalid="true"] + span {
  border-color: #ac554c;
}

.check-option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  color: #434343;
  cursor: pointer;
  font-size: 13px;
  font-weight: 550;
}

.pitom-option {
  margin-top: 8px;
}

.check-option input {
  appearance: none;
  display: grid;
  flex: 0 0 auto;
  place-content: center;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  border: 1px solid #b0b0ab;
  border-radius: 4px;
  background: var(--field);
  cursor: pointer;
}

.check-option input::before {
  width: 9px;
  height: 5px;
  border-bottom: 2px solid #fff;
  border-left: 2px solid #fff;
  content: "";
  opacity: 0;
  transform: translateY(-1px) rotate(-45deg) scale(0.6);
  transition: opacity 120ms ease, transform 120ms ease;
}

.check-option input:checked {
  border-color: var(--accent);
  background: var(--accent);
}

.check-option input:checked::before {
  opacity: 1;
  transform: translateY(-1px) rotate(-45deg) scale(1);
}

.check-option input:focus-visible {
  outline: 3px solid rgba(45, 45, 43, 0.16);
  outline-offset: 2px;
}

.extras-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 12px;
}

.aravos-note {
  margin: 15px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.aravos-note strong {
  color: #444;
  font-weight: 680;
}

.form-footer {
  padding: 22px 28px 26px;
}

.turnstile-wrap {
  min-height: 65px;
  margin-bottom: 12px;
}

.form-message {
  display: none;
  margin: 0 0 12px;
  padding: 9px 11px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
}

.form-message.error,
.form-message.success {
  display: block;
}

.form-message.error {
  color: var(--error);
  background: var(--error-bg);
}

button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 48px;
  padding: 0 15px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 680;
  transition: background 140ms ease, transform 140ms ease;
}

button:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

button:focus-visible {
  outline: 3px solid rgba(45, 45, 43, 0.24);
  outline-offset: 3px;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

button svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.success-state {
  display: grid;
  min-height: 430px;
  padding: 40px 28px;
  align-content: center;
  justify-items: center;
  text-align: center;
  animation: success-in 350ms ease-out both;
}

.success-check {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 23px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
}

.success-check svg {
  width: 43px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.success-check path {
  stroke-dasharray: 46;
  stroke-dashoffset: 46;
  animation: check-draw 430ms 150ms ease-out forwards;
}

.success-state h2 {
  margin: 0;
  font-size: clamp(32px, 7vw, 42px);
  font-weight: 620;
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.success-state p {
  max-width: 380px;
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

@keyframes success-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes check-draw {
  to { stroke-dashoffset: 0; }
}

@media (max-width: 560px) {
  .page-shell {
    width: min(100% - 18px, 620px);
    padding: 30px 0 40px;
  }

  .site-name {
    margin-bottom: 22px;
  }

  .form-section,
  .form-footer {
    padding-right: 18px;
    padding-left: 18px;
  }

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

  .field-wide {
    grid-column: auto;
  }

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

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

@media (max-width: 360px) {
  .extras-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }

  .success-state,
  .success-check path {
    animation: none !important;
  }

  .success-check path {
    stroke-dashoffset: 0;
  }
}
