/* =====================================================================
   ElectionValidation – responsive styles
   ===================================================================== */
:root {
  --navy:        #0c0052;   /* landing background */
  --navy-footer: #00264a;
  --blue:        #104b8f;   /* form pages background */
  --blue-footer: #2975c1;
  --card:        #fafbfd;
  --ink:         #2b2b2b;
  --muted:       #5c6470;
  --line:        #e1e6ee;
  --red:         #f00041;   /* form buttons */
  --red-dark:    #c80036;
  --pink:        #ed4266;   /* landing CTA */
  --danger:      #c4002f;
  --focus:       #ffb400;
  --gop:         #b3202a;
  --dem:         #1f4fa3;
  --radius:      2px;
  --font-body:   'Lato', 'Open Sans', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  border: 0; border-radius: var(--radius); cursor: pointer;
  font: 700 16px/1 var(--font-body);
  text-decoration: none; color: #fff;
  padding: 15px 25px; min-height: 46px;
  transition: background-color .2s, transform .1s, box-shadow .2s;
}
.btn:active { transform: translateY(1px); }
.btn-red { background: var(--red); font-weight: 400; }
.btn-red:hover { background: var(--red-dark); }
.btn[disabled] { opacity: .7; cursor: progress; }

/* =====================================================================
   Landing page
   ===================================================================== */
.page-home { background: var(--navy); color: #fff; }
.hero {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 46%) minmax(0, 1fr);
  min-height: calc(100vh - 96px);
}
.hero-art {
  position: relative;
  background: var(--navy) url('../img/hero-art.jpg') 78% 100% / cover no-repeat;
}
.hero-art::after { /* soften the edge where the artwork meets the navy panel */
  content: ''; position: absolute; inset: 0 0 0 auto; width: 90px;
  background: linear-gradient(to right, rgba(12, 0, 82, 0), var(--navy));
}
.hero-content {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: clamp(40px, 7vw, 120px) clamp(24px, 5vw, 90px) clamp(48px, 6vw, 100px);
}
.logo-box {
  background: #fff;
  padding: 14px 18px;
  width: min(375px, 80%);
  margin-bottom: clamp(36px, 5vw, 76px);
}
.hero h1 {
  font-family: 'Work Sans', var(--font-body);
  font-weight: 700;
  font-size: clamp(24px, 2.25vw, 37px);
  line-height: 1.24;
  letter-spacing: .005em;
  max-width: 660px;
  margin: 0 0 clamp(22px, 2.5vw, 40px);
}
.hero-copy { max-width: 680px; font-family: 'Open Sans', var(--font-body); font-size: clamp(15px, 1.05vw, 18px); line-height: 1.75; }
.hero-copy p { margin: 0 0 14px; }
.hero-copy strong { font-weight: 700; }
.btn-cta {
  margin-top: clamp(40px, 5vw, 100px);
  background: var(--pink);
  font-family: 'Work Sans', var(--font-body);
  font-size: clamp(20px, 1.6vw, 28px);
  padding: 24px 56px;
  min-width: min(390px, 100%);
}
.btn-cta:hover { background: #d92d53; box-shadow: 0 8px 24px rgba(237, 66, 102, .35); }

.page-home .site-footer { background: var(--navy-footer); }

/* =====================================================================
   Form pages (Petition, Cast Your Vote, Thank you)
   ===================================================================== */
.page-form { background: var(--blue); }
.form-wrap { flex: 1; padding: clamp(24px, 5vw, 100px) 16px clamp(40px, 6vw, 100px); }
.form-shell { max-width: 1110px; margin: 0 auto; }
.card {
  background: var(--card);
  padding: clamp(24px, 4.5vw, 50px) clamp(18px, 4.5vw, 50px) clamp(32px, 5vw, 60px);
  box-shadow: 0 10px 40px rgba(0, 20, 60, .18);
}
.card-logo { display: block; width: min(300px, 70%); margin: 0 auto 18px; background: #fff; padding: 10px 14px; }
.card-title {
  text-align: center;
  font-family: var(--font-body);
  font-size: clamp(24px, 2.6vw, 34px);
  font-weight: 700;
  letter-spacing: .01em;
  color: #222;
  margin: 8px 0 22px;
}

/* step indicator */
.steps { list-style: none; display: flex; justify-content: center; gap: 10px 28px; flex-wrap: wrap; padding: 0; margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.steps li { display: inline-flex; align-items: center; gap: 8px; }
.steps span { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid #b9c2cf; font-size: 12px; font-weight: 700; }
.steps .is-current { color: var(--ink); font-weight: 700; }
.steps .is-current span { background: var(--blue); border-color: var(--blue); color: #fff; }
.steps .is-done span { background: #1f9d55; border-color: #1f9d55; color: #fff; }

/* petition copy */
.petition-text { font-size: 15.5px; line-height: 1.68; color: #333; margin-bottom: 32px; }
.petition-text h2 { font-size: 18px; font-weight: 700; color: #222; margin: 0 0 4px; }
.petition-text p { margin: 0 0 14px; }
.petition-text .from { margin-bottom: 14px; }
.petition-options { margin: 0 0 14px; padding-left: 1.3em; }
.petition-options li { padding-left: .2em; margin-bottom: 2px; }

/* fields */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.field { margin-bottom: 18px; min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field label { display: block; font-size: 14.5px; color: #333; margin-bottom: 6px; }
.field input, .field select {
  width: 100%;
  height: 50px;
  padding: 0 15px;
  font: 16px/1.2 var(--font-body);   /* 16px prevents iOS zoom */
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(16, 40, 80, .04);
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
}
.field select {
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23555' stroke-width='1.8'/%3E%3C/svg%3E") right 16px center no-repeat;
  padding-right: 40px;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(16, 75, 143, .18); }
.field input::placeholder { color: #9aa3ae; }
.signature-input { font-family: 'Brush Script MT', 'Segoe Script', 'Lucida Handwriting', cursive !important; font-size: 21px !important; }
.field-note { display: flex; align-items: flex-end; }
.field-note p { margin: 0 0 14px; font-size: 13px; color: var(--muted); }

.has-error input, .has-error select { border-color: var(--danger); background-color: #fff7f8; }
.field-error { color: var(--danger); font-size: 13px; margin: 5px 0 0; }

/* checkboxes */
.check { margin: 4px 0 18px; }
.check label { display: flex; align-items: flex-start; gap: 9px; font-size: 14.5px; line-height: 1.55; color: #333; cursor: pointer; }
.check input { flex: none; width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--blue); }
.check.has-error label { color: var(--danger); }

.alert { background: #fff1f3; border-left: 4px solid var(--danger); color: #8a0020; padding: 12px 16px; margin: 0 0 24px; font-size: 15px; }
.alert-info { background: #eef5ff; border-color: var(--blue); color: #123a6b; }
.alert:focus { outline: none; }

/* honeypot */
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* actions below the card */
.shell-actions { display: flex; justify-content: space-between; gap: 16px; margin-top: 30px; }
.card-submit { display: flex; justify-content: flex-end; margin-top: 8px; }
.card-submit .btn { min-width: 100px; }

/* ---------- Vote page ---------- */
.race { border: 0; padding: 0; margin: 10px 0 34px; min-width: 0; }
.race legend { font-size: 14.5px; color: #333; padding: 0; margin-bottom: 14px; }
.candidates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 28px; }
.candidate {
  position: relative;
  display: grid;
  grid-template-columns: 24px 110px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 12px 14px 12px 0;
  border: 2px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.candidate:hover { background: #f0f4fa; }
.candidate input { width: 20px; height: 20px; margin: 0; accent-color: var(--blue); justify-self: center; }
.candidate:has(input:checked) { border-color: var(--blue); background: #eef4fc; }
.candidate:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.candidate-photo {
  width: 110px; height: 110px; border-radius: 50%;
  overflow: hidden; display: grid; place-items: center;
  background: #8a93a0; color: #fff;
  font: 700 34px/1 'Work Sans', var(--font-body); letter-spacing: .02em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.candidate-photo img { width: 100%; height: 100%; object-fit: cover; }
.candidate-photo.party-r { background: linear-gradient(135deg, #c8323c, var(--gop)); }
.candidate-photo.party-d { background: linear-gradient(135deg, #2f63bd, var(--dem)); }
.candidate-info strong { display: block; font-weight: 700; font-size: 15.5px; color: #222; }
.candidate-info small { display: block; font-size: 14.5px; color: #444; }
.is-disabled .candidate { opacity: .45; pointer-events: none; }

/* ---------- Thank-you ---------- */
.card-thanks { text-align: center; }
.thanks-icon { color: #1f9d55; display: flex; justify-content: center; margin: 12px 0 0; }
.card-thanks .lead { font-size: 18px; margin: 0 0 10px; }

/* =====================================================================
   Footer & back-to-top
   ===================================================================== */
.site-footer {
  background: var(--blue-footer);
  color: #fff;
  text-align: center;
  font-size: 15px;
  padding: 30px 16px;
}
.site-footer p { margin: 0; }
.site-footer .footer-note { margin-top: 6px; font-size: 12.5px; opacity: .78; }
.to-top {
  position: fixed; right: 18px; bottom: 18px; z-index: 10;
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--red); color: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .25s, transform .25s, visibility .25s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 1024px) {
  .hero { grid-template-columns: minmax(0, 40%) minmax(0, 1fr); }
  .candidate { grid-template-columns: 22px 84px minmax(0, 1fr); gap: 14px; }
  .candidate-photo { width: 84px; height: 84px; font-size: 26px; }
}

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-art { aspect-ratio: 1000 / 560; background-position: 70% 100%; order: 2; }
  .hero-art::after { display: none; }
  .hero-content { order: 1; padding-top: 36px; padding-bottom: 40px; }
  .hero-content .btn-cta { margin-top: 32px; }
  .logo-box { margin-bottom: 30px; }
}

@media (max-width: 640px) {
  .grid, .candidates { grid-template-columns: 1fr; }
  .field-note { display: block; margin-top: -10px; }
  .candidates { gap: 10px; }
  .candidate { padding-right: 10px; }
  .shell-actions { flex-direction: column-reverse; }
  .shell-actions .btn, .card-submit .btn { width: 100%; }
  .petition-text { font-size: 15px; }
  .btn-cta { padding: 20px 28px; width: 100%; }
  .to-top { right: 12px; bottom: 12px; width: 42px; height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
