:root {
  --page-bg: #eef1df;
  --paper: #fbfaf4;
  --paper-soft: #f4f3e8;
  --ink: #2f382b;
  --muted: #6e745d;
  --gold: #9f7b37;
  --gold-dark: #725821;
  --blue: #7db8cf;
  --line: rgba(114, 88, 33, 0.22);
  --shadow: 0 22px 60px rgba(47, 56, 43, 0.15);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.flyer-screen {
  display: grid;
  min-height: 100svh;
  overflow: hidden;
  place-items: center;
  background: var(--page-bg);
}

.flyer-image {
  display: block;
  width: 100%;
  height: 100svh;
  object-fit: cover;
  object-position: center top;
}

.form-section {
  padding: 42px 18px max(42px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 16% 6%, rgba(125, 184, 207, 0.18), transparent 26%),
    linear-gradient(180deg, var(--page-bg), #f8f6ea 36%, #f5f0df);
}

.form-shell {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 28px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(251, 250, 244, 0.9);
  box-shadow: var(--shadow);
}

.form-kicker {
  margin: 0 0 8px;
  color: var(--gold-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: 0;
}

h1 {
  margin-bottom: 24px;
  color: var(--ink);
  font-size: clamp(2rem, 9vw, 3.2rem);
  line-height: 1.05;
  text-align: center;
}

h2 {
  margin-bottom: 14px;
  color: var(--gold-dark);
  font-size: 1.35rem;
}

.participation-form {
  display: grid;
  gap: 18px;
}

.participation-form[hidden],
.participation-form.is-submitted {
  display: none !important;
}

.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.field,
fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

label,
legend {
  display: block;
  margin-bottom: 8px;
  color: var(--gold-dark);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffef8;
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input,
select {
  min-height: 50px;
  padding: 0 14px;
}

textarea {
  min-height: 118px;
  padding: 14px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(125, 184, 207, 0.22);
}

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

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

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

.choice input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.choice span {
  display: grid;
  min-height: 50px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffef8;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

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

.choice input:focus-visible + span {
  box-shadow: 0 0 0 4px rgba(125, 184, 207, 0.24);
}

.field-grid {
  display: grid;
  gap: 18px;
}

.field-error {
  min-height: 1.1rem;
  margin: 6px 0 0;
  color: #a33b35;
  font-size: 0.86rem;
  line-height: 1.25;
}

.submit-button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}

.submit-button {
  width: 100%;
  margin-top: 2px;
  background: var(--gold);
  color: #fffdf5;
}

.submit-button:focus-visible {
  outline: 4px solid rgba(125, 184, 207, 0.32);
  outline-offset: 3px;
}

.result-panel {
  margin-top: 24px;
  padding: 22px;
  border: 1px solid rgba(172, 137, 68, 0.28);
  border-radius: var(--radius);
  background: rgba(252, 249, 237, 0.78);
  text-align: center;
}

.result-panel.is-error {
  border-color: rgba(151, 59, 49, 0.32);
  background: rgba(255, 246, 244, 0.78);
}

.result-panel h2 {
  margin: 0 0 8px;
  color: var(--gold-dark);
}

.result-message {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.45;
}

.site-footer {
  padding: 0 18px 30px;
  background: #f5f0df;
  color: rgba(110, 116, 93, 0.72);
  font-size: 0.78rem;
  letter-spacing: 0;
  text-align: center;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(110, 116, 93, 0.32);
}

.site-footer a:focus-visible,
.site-footer a:hover {
  color: var(--gold-dark);
  border-bottom-color: rgba(114, 88, 33, 0.58);
}

@media (min-width: 720px) {
  .flyer-screen {
    padding: 0 24px;
  }

  .flyer-image {
    width: auto;
    max-width: min(100%, 620px);
    object-fit: contain;
    box-shadow: var(--shadow);
  }

  .form-section {
    padding: 64px 24px 72px;
  }

  .form-shell {
    padding: 42px;
  }

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