:root {
  --red: #b9362b;
  --red-dark: #8f271f;
  --blue: #203e63;
  --blue-soft: #eaf0f7;
  --gold: #e7b83f;
  --gold-light: #f8df91;
  --green: #4b7735;
  --cream: #fff9e9;
  --paper: #fffdf7;
  --ink: #2b2b2b;
  --muted: #656565;
  --border: #e8d6a5;
  --shadow: 0 16px 44px rgba(54, 42, 20, .14);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font-family: "Source Sans 3", system-ui, sans-serif;
  background:
    radial-gradient(circle at 10% 10%, rgba(231,184,63,.18), transparent 28%),
    radial-gradient(circle at 90% 16%, rgba(185,54,43,.10), transparent 25%),
    linear-gradient(180deg, #fff7dd 0%, #f8e9c5 100%);
  min-height: 100vh;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.skip-link { position: absolute; left: -999px; top: 0; background: #fff; padding: .75rem 1rem; z-index: 99; }
.skip-link:focus { left: .5rem; top: .5rem; }
.survey-hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  color: #fff;
  padding: 2.1rem 1rem 0;
  background:
    linear-gradient(115deg, rgba(32,62,99,.98), rgba(38,79,125,.94)),
    repeating-linear-gradient(45deg, transparent 0 22px, rgba(255,255,255,.04) 22px 44px);
  border-bottom: 7px solid var(--gold);
}
.survey-hero::before, .survey-hero::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border: 24px solid rgba(255,255,255,.04);
  border-radius: 50%;
  top: -110px;
}
.survey-hero::before { left: -90px; }
.survey-hero::after { right: -90px; }
.hero-stars { color: var(--gold-light); letter-spacing: .7rem; opacity: .9; font-size: .85rem; }
.hero-content { max-width: 850px; margin: 0 auto; position: relative; z-index: 1; }
.ribbon-mark {
  width: 68px; height: 82px; margin: .8rem auto .25rem; background: var(--red); position: relative;
  box-shadow: 0 5px 12px rgba(0,0,0,.25); display: grid; place-items: center; font-weight: 800;
}
.ribbon-mark::after { content: ""; position: absolute; bottom: -18px; left: 0; border-left: 34px solid var(--red); border-right: 34px solid var(--red); border-bottom: 18px solid transparent; }
.ribbon-mark span { margin-top: -4px; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-weight: 800; color: var(--gold-light); margin: 1rem 0 .2rem; }
h1, h2, h3 { font-family: "Baloo 2", system-ui, sans-serif; line-height: 1.1; }
h1 { font-size: clamp(2rem, 5vw, 3.65rem); margin: .2rem 0 .5rem; }
.survey-hero p:not(.eyebrow) { font-size: clamp(1rem, 2vw, 1.25rem); margin: 0 0 1.3rem; }
.field-border { height: 48px; display: flex; align-items: end; justify-content: center; gap: clamp(1rem, 7vw, 5rem); color: var(--gold-light); font-size: 1.45rem; opacity: .95; }
.survey-shell { width: min(900px, calc(100% - 2rem)); margin: 2rem auto 4rem; }
.intro-card, .survey-card, .success-card {
  background: var(--paper); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); padding: clamp(1.25rem, 4vw, 2.5rem);
}
.intro-card, .success-card { text-align: center; }
.intro-card h2, .success-card h2 { color: var(--blue); font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 .7rem; }
.deadline-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin: 1.5rem 0; }
.deadline-grid div { background: var(--blue-soft); border-radius: 12px; padding: .9rem; border-top: 4px solid var(--gold); }
.deadline-grid strong, .deadline-grid span { display: block; }
.deadline-grid strong { color: var(--blue); }
.fine-print { color: var(--muted); font-size: .92rem; }
.btn { border: 0; border-radius: 999px; padding: .8rem 1.4rem; font-weight: 800; min-height: 46px; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: #fff; background: var(--red); box-shadow: 0 5px 14px rgba(185,54,43,.27); }
.btn-primary:hover { background: var(--red-dark); }
.btn-secondary { background: #fff; color: var(--blue); border: 2px solid #cbd5e1; }
.progress-wrap { margin-bottom: 1.8rem; }
.progress-meta { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .9rem; margin-bottom: .4rem; }
.progress-track { height: 10px; background: #e7e9ed; border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--red), var(--gold)); transition: width .25s ease; }
.step { display: none; }
.step.active { display: block; animation: reveal .22s ease; }
@keyframes reveal { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.step h2 { margin: 0; color: var(--blue); font-size: clamp(1.65rem, 4vw, 2.2rem); }
.step-intro { color: var(--muted); margin: .35rem 0 1.4rem; }
.question { margin: 0 0 1.55rem; }
.question-label, legend { display: block; font-weight: 800; margin-bottom: .6rem; color: #303030; }
.required::after { content: " *"; color: var(--red); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.choice-grid { display: grid; gap: .65rem; }
.choice-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.choice-card { position: relative; }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card span {
  display: flex; align-items: center; min-height: 48px; padding: .68rem .9rem; border: 2px solid #d9dce1; border-radius: 12px; background: #fff; transition: .15s ease;
}
.choice-card input:focus-visible + span { outline: 3px solid rgba(32,62,99,.3); outline-offset: 2px; }
.choice-card input:checked + span { border-color: var(--blue); background: var(--blue-soft); box-shadow: inset 4px 0 0 var(--gold); }
input[type="text"], input[type="email"], input[type="tel"], textarea, select {
  width: 100%; border: 2px solid #d9dce1; border-radius: 12px; padding: .75rem .85rem; background: #fff; color: var(--ink);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(32,62,99,.17); border-color: var(--blue); }
.rating-row { display: flex; flex-wrap: wrap; gap: .45rem; }
.rating-row label { position: relative; }
.rating-row input { position: absolute; opacity: 0; }
.rating-row span { width: 46px; height: 46px; border-radius: 50%; border: 2px solid #d7dbe0; display: grid; place-items: center; background: #fff; font-weight: 800; }
.rating-row input:checked + span { background: var(--gold); border-color: #be8d13; color: #3e2d00; }
.matrix { overflow-x: auto; }
.matrix table { width: 100%; border-collapse: collapse; min-width: 550px; }
.matrix th, .matrix td { padding: .55rem .35rem; border-bottom: 1px solid #e8e3d5; text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; font-weight: 700; }
.matrix input { width: 20px; height: 20px; accent-color: var(--blue); }
.note-box { background: #fff5d6; border-left: 5px solid var(--gold); padding: .85rem 1rem; border-radius: 10px; margin-bottom: 1.25rem; }
.conditional { display: none; margin-top: .8rem; }
.conditional.show { display: block; }
.error-message { color: var(--red-dark); font-weight: 700; margin: -.8rem 0 1rem; }
.form-actions { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid #eee4c9; padding-top: 1.25rem; margin-top: 1.6rem; }
.success-ribbon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 1rem; background: var(--gold); color: var(--blue); font-size: 2rem; border: 6px double #fff; box-shadow: 0 0 0 3px var(--gold); }
footer { text-align: center; padding: 0 1rem 2rem; color: #5f5b52; display: flex; justify-content: center; gap: .6rem; }
footer a { color: var(--blue); font-weight: 700; }
.is-hidden { display: none !important; }
@media (max-width: 680px) {
  .deadline-grid, .choice-grid.two { grid-template-columns: 1fr; }
  .survey-shell { width: min(100% - 1rem, 900px); margin-top: 1rem; }
  .intro-card, .survey-card, .success-card { border-radius: 14px; }
  .progress-meta { flex-direction: column; gap: .15rem; }
  .form-actions .btn { flex: 1; padding-inline: .7rem; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }


#saveStatus.is-loading::before {
  content: ""; display: inline-block; width: .8rem; height: .8rem; margin-right: .4rem;
  border: 2px solid rgba(32,62,99,.25); border-top-color: var(--blue); border-radius: 50%;
  vertical-align: -.1rem; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.submission-overlay {
  position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; padding: 1rem;
  background: rgba(20,35,55,.82); backdrop-filter: blur(3px);
}
.submission-dialog {
  width: min(440px, 100%); text-align: center; background: var(--paper); border-radius: 20px;
  padding: 2.2rem 1.5rem; box-shadow: 0 24px 70px rgba(0,0,0,.35); border: 2px solid var(--gold);
}
.submission-dialog h2 { color: var(--blue); margin: 1rem 0 .45rem; }
.submission-dialog p { margin: 0; color: var(--muted); }
.large-spinner {
  width: 58px; height: 58px; margin: 0 auto; border: 7px solid #e4e8ed;
  border-top-color: var(--red); border-right-color: var(--gold); border-radius: 50%;
  animation: spin .8s linear infinite;
}
body.submission-locked { overflow: hidden; }
.btn:disabled { cursor: not-allowed; opacity: .72; transform: none; }
