:root {
  color-scheme: light;
  --green: #3e603e;
  --green-deep: #314d31;
  --green-muted: #527052;
  --green-border: #708870;
  --green-faint: rgb(62 96 62 / 12%);
  --gold: #d2a44f;
  --white: #f4fcf4;
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--white);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--green);
  background: var(--white);
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

button,
select,
summary,
input[type="checkbox"] {
  cursor: pointer;
}

button,
input,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}

:where(button, input, select, summary):focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
}

::selection {
  color: var(--green-deep);
  background: rgb(210 164 79 / 38%);
}

.page-shell::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  height: 5px;
  background: var(--gold);
}

.page-shell {
  position: relative;
  display: flex;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-y: auto;
  scroll-padding-block: 88px;
  align-items: stretch;
  justify-content: center;
  padding-block-start: max(88px, calc(env(safe-area-inset-top) + 78px));
  padding-block-end: max(14px, env(safe-area-inset-bottom));
  padding-inline: clamp(16px, 4.5vw, 24px);
}

.language-picker {
  position: absolute;
  z-index: 1;
  inset-block-start: max(10px, env(safe-area-inset-top));
  inset-inline-end: max(12px, env(safe-area-inset-right));
}

html[dir="rtl"] .language-picker {
  inset-inline-end: max(12px, env(safe-area-inset-left));
}

#language-select {
  max-width: min(188px, calc(100vw - 32px));
  min-height: 44px;
  border: 1px solid var(--green-border);
  border-radius: 12px;
  padding: 8px 11px;
  color: var(--green);
  background: rgb(244 252 244 / 94%);
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.2;
  transition: border-color 160ms ease, background-color 160ms ease;
}

#language-select:hover {
  border-color: var(--gold);
  background: var(--green-faint);
}

#language-select option {
  color: var(--green);
  background: var(--white);
}

.content-stack {
  display: grid;
  width: min(100%, 520px);
  height: 100%;
  min-width: 0;
  grid-template-rows: auto auto minmax(24px, 1fr);
  align-items: center;
  align-content: stretch;
  row-gap: clamp(12px, 1.7dvh, 20px);
}

.content-stack::after {
  content: "";
  grid-row: 3;
}

.hero-zone {
  display: grid;
  grid-row: 1;
  width: 100%;
  align-self: center;
  justify-items: center;
  gap: clamp(7px, 1.1dvh, 11px);
}

.brand-logo {
  display: block;
  width: min(560px, 89vw);
  max-width: none;
  height: auto;
  justify-self: center;
}

.view-container {
  display: grid;
  grid-row: 2;
  width: min(100%, 440px);
  min-width: 0;
  justify-self: center;
}

/* All views share one cell: the container holds the tallest view's height
   permanently, so switching views never shifts the page. Inactive views are
   kept in layout but invisible and inert. */
.view-container > [data-view] {
  grid-area: 1 / 1;
}

.view-container > .state[hidden] {
  display: flex !important;
  visibility: hidden;
  pointer-events: none;
}

.view-container > form[hidden] {
  display: grid !important;
  visibility: hidden;
  pointer-events: none;
}

/* The CTA under the logo keeps its space when the form view is away. */
.context-line[hidden] {
  display: block !important;
  visibility: hidden;
}

/* Animations must not run while a view is invisible; applying them only when
   visible also restarts them the moment the view appears. */
.view-container > [hidden] .spinner,
.view-container > [hidden] .success-mark--animated,
.view-container > [hidden] .success-mark--animated .success-mark__tick {
  animation: none;
}

.attestation-form {
  display: grid;
  align-content: start;
  gap: clamp(8px, 1.25dvh, 12px);
  width: 100%;
}

.context-line {
  margin: clamp(18px, 3.2dvh, 32px) 0 0;
  max-width: 48ch;
  color: var(--green);
  font-size: clamp(1.45rem, 1.15rem + 1.7dvh, 1.85rem);
  font-weight: 800;
  letter-spacing: .01em;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-align: center;
  text-wrap: balance;
}

.context-line::after {
  content: "";
  display: block;
  width: 58px;
  height: 4px;
  margin: clamp(9px, 1.5dvh, 14px) auto 0;
  border-radius: 2px;
  background: var(--gold);
}

.name-field {
  display: grid;
  gap: 6px;
}

.name-field label {
  font-size: 1.05rem;
  font-size: clamp(1.05rem, 1.01rem + .15dvh, 1.1rem);
  font-weight: 780;
  line-height: 1.3;
}

input[type="text"] {
  width: 100%;
  min-height: 53px;
  border: 1px solid var(--green-border);
  border-radius: 13px;
  padding: 10px 13px;
  color: var(--green-deep);
  background: rgb(244 252 244 / 58%);
  font-size: 17px;
  line-height: 1.3;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input[type="text"]:hover {
  border-color: var(--green-muted);
}

input[type="text"]:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgb(210 164 79 / 32%);
}

.agreement {
  display: grid;
  gap: 0;
}

.check-row {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 11px;
  padding-block: 2px;
  color: var(--green);
  font-size: 1rem;
  font-size: clamp(1rem, .97rem + .12dvh, 1.05rem);
  font-weight: 720;
  line-height: 1.35;
}

.check-row input {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--green);
}

.attestation-details {
  margin-inline-start: 35px;
  color: var(--green-muted);
  font-size: .95rem;
  font-size: clamp(.95rem, .92rem + .12dvh, 1rem);
  line-height: 1.45;
}

.attestation-details summary {
  width: fit-content;
  min-height: 44px;
  border-radius: 5px;
  padding: 10px 3px 9px 1px;
  font-weight: 680;
}

.attestation-details summary::marker {
  color: var(--green);
}

.attestation-details summary::-webkit-details-marker {
  color: var(--green);
}

.attestation-details p {
  margin: 7px 0 4px;
  padding-inline-start: 10px;
  border-inline-start: 2px solid var(--gold);
}

.turnstile-box:empty {
  display: none;
}

.turnstile-box {
  display: flex;
  justify-content: center;
  margin: 1px 0;
}

#submit-button,
.state-action {
  width: 100%;
  min-height: 55px;
  border: 0;
  border-block-end: 3px solid var(--gold);
  border-radius: 14px;
  padding: 11px 16px;
  color: var(--white);
  background: var(--green);
  font-size: 1.15rem;
  font-size: clamp(1.15rem, 1.1rem + .18dvh, 1.2rem);
  font-weight: 800;
  line-height: 1.2;
  transition: background-color 160ms ease, transform 160ms ease;
}

#submit-button:hover,
.state-action:hover {
  background: var(--green-deep);
}

#submit-button:active,
.state-action:active {
  transform: scale(.99);
}

#submit-button:disabled {
  cursor: wait;
  opacity: .75;
}

.state {
  display: flex;
  min-height: 220px;
  min-height: clamp(220px, 34dvh, 300px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}

.state h2,
.state p {
  margin: 0;
}

.state h2 {
  font-size: 1.45rem;
  font-size: clamp(1.45rem, 1.25rem + .8dvh, 1.8rem);
  line-height: 1.12;
  text-wrap: balance;
}

.state p {
  max-width: 34ch;
  color: var(--green-muted);
  font-size: 1rem;
  font-size: clamp(1rem, .94rem + .2dvh, 1.08rem);
  line-height: 1.45;
  text-wrap: balance;
}

.state-action {
  max-width: 300px;
  margin-top: 9px;
}

.state--busy {
  gap: 16px;
}

.state--busy p {
  color: var(--green);
  font-size: clamp(1.3rem, 1.15rem + .7dvh, 1.55rem);
  font-weight: 750;
}

.state--result {
  gap: 9px;
}

.state--result h2 {
  font-size: 1.75rem;
  font-size: clamp(1.75rem, 1.5rem + 1dvh, 2.1rem);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--green-faint);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 750ms linear infinite;
}

.success-mark {
  display: block;
  width: 72px;
  width: clamp(72px, 9dvh, 80px);
  height: 72px;
  height: clamp(72px, 9dvh, 80px);
  margin-bottom: 5px;
  overflow: visible;
  fill: none;
  stroke: var(--gold);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.success-mark__circle {
  stroke-width: 2;
  opacity: .42;
}

.success-mark__tick {
  stroke-width: 4;
  stroke-dasharray: 48;
}

.success-mark--animated {
  animation: check-settle 900ms cubic-bezier(.2, .8, .2, 1) both;
}

.success-mark--animated .success-mark__tick {
  stroke-dashoffset: 48;
  animation: check-draw 700ms ease-out 100ms forwards;
}

.success-mark--static .success-mark__tick {
  stroke-dashoffset: 0;
}

.honeypot,
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  border: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}

[hidden] {
  display: none !important;
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

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

@keyframes check-settle {
  0% {
    transform: scale(.88);
  }
  72% {
    transform: scale(1.045);
  }
  100% {
    transform: scale(1);
  }
}

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

  .success-mark--animated .success-mark__tick {
    stroke-dashoffset: 0;
  }
}

@media (max-height: 680px) {
  .page-shell {
    padding-block-start: max(74px, calc(env(safe-area-inset-top) + 66px));
    padding-block-end: max(10px, env(safe-area-inset-bottom));
  }

  .content-stack {
    grid-template-rows: auto auto minmax(16px, 1fr);
    row-gap: 8px;
  }

  .attestation-form {
    gap: 8px;
  }

  .state {
    min-height: 190px;
  }
}
