/* SRBWI Alabama · My Voting Plan
   Colors come from the approved SRBWI implementation palette. */
:root {
  --wine: #790c28;
  --teal: #006d73;
  --ink: #232b2b;
  --page: #fcfcf8;
  --line: #d9dfda;
  --soft: #f2f5ef;
  --hero: #e8eee6;
  --muted: #535f5c;
  --focus: #9c7417; /* darkened from #b38620 for 3:1+ against every surface */
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 17px/1.6 Arial, "Helvetica Neue", Helvetica, sans-serif; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
a { color: var(--teal); text-underline-offset: 4px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex="-1"]:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 4px;
}
[tabindex="-1"]:focus:not(:focus-visible) { outline: none; }
.choice:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

/* Header and footer */
.site-header, .site-footer { max-width: 1240px; margin: auto; padding: 22px 40px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.site-header { border-bottom: 1px solid var(--line); }
.brand { border: 0; background: none; display: flex; align-items: center; gap: 15px; color: var(--wine); font-weight: 800; text-align: left; line-height: 1.2; padding: 0; }
.brand img { width: 80px; height: 80px; object-fit: contain; }
.brand-divider { height: 40px; border-left: 1px solid var(--line); }
.resource-link, .text-link, .back-button { border: 0; background: none; color: var(--teal); text-decoration: underline; text-underline-offset: 4px; padding: 0; text-align: left; }
.resource-link, .back-button { min-height: 44px; }
.skip { position: absolute; left: -1000px; }
.skip:focus { left: 10px; top: 10px; background: white; padding: 10px 14px; z-index: 10; }
.site-footer { font-size: 12px; border-top: 1px solid var(--line); color: #5a6560; }

main { max-width: 1240px; margin: auto; padding: 35px 40px 70px; }

/* Type */
.eyebrow, .small-caps, .field-caption, .step-count { font-size: 12px; font-weight: 800; letter-spacing: 1.8px; }
.eyebrow { color: var(--teal); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--wine); margin-right: 4px; vertical-align: 1px; }
h1 { font-size: clamp(40px, 5.1vw, 66px); line-height: 1.06; letter-spacing: -2px; margin: 23px 0; color: var(--wine); }
h1 span { color: var(--teal); }
h2 { line-height: 1.2; font-size: 30px; }
p { margin: 12px 0; }
.intro { font-size: 19px; max-width: 480px; }
.small, .reassurance, .local-note, .hint, .privacy-line { font-size: 13px; color: var(--muted); }

/* Buttons */
.button { display: inline-flex; justify-content: center; align-items: center; gap: 20px; min-height: 48px; text-decoration: none; border: 1px solid transparent; border-radius: 6px; padding: 14px 22px; font-weight: 700; }
.primary { background: var(--wine); color: white; }
.primary:hover { background: #5f0920; }
.secondary { border-color: var(--wine); background: white; color: var(--wine); }
.secondary:hover { background: #fbf3f5; }
.button:disabled { opacity: .65; cursor: progress; }
.text-link { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.local-note .text-link, .soft-note .text-link { min-height: 0; display: inline; font-size: inherit; }

/* Welcome */
.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 65px; align-items: center; padding: 28px 0 45px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.election-note { margin-top: 25px; padding: 12px 18px; border-left: 3px solid var(--teal); }
.countdown { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.countdown-label { margin: 0 0 8px; font-size: 12px; font-weight: 800; letter-spacing: 1.8px; text-transform: uppercase; color: var(--teal); }
.countdown-units { display: flex; gap: 10px; }
.countdown-units span { flex: 1; max-width: 104px; background: white; border: 1px solid var(--line); border-radius: 6px; padding: 10px 8px; text-align: center; line-height: 1.1; }
.countdown-units b { display: block; font-size: 34px; color: var(--wine); font-variant-numeric: tabular-nums; }
.countdown-units small { display: block; margin-top: 4px; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.countdown-foot { margin: 10px 0 0; }
.countdown.is-open .countdown-label { color: var(--wine); }
.countdown.is-open .countdown-label::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--wine); margin-right: 6px; vertical-align: 1px; }
.countdown.is-closed .countdown-units { display: none; }
.countdown.is-closed .countdown-label { font-size: 15px; letter-spacing: 0; text-transform: none; color: var(--ink); }
.hero-art { background: var(--hero); padding: 30px; border-radius: 10px; }
.sample-card { background: white; border: 1px solid var(--line); padding: 28px; border-radius: 8px; }
.sample-top, .sample-item, .date-banner { display: flex; gap: 20px; align-items: center; }
.sample-top { justify-content: space-between; color: var(--wine); }
.sample-card h2 { font-size: 32px; margin: 18px 0; }
.mini-mark { color: var(--teal); font-size: 26px; }
.date-banner { background: var(--wine); color: white; padding: 15px; line-height: 1.5; }
.date-number { font-size: 52px; line-height: 1; font-weight: 700; }
.sample-item { border-bottom: 1px solid var(--line); padding: 17px 0; }
.sample-item strong, .field-caption { display: block; }
.field-caption { color: #5f6c65; font-size: 11px; }
.sample-icon { font-size: 13px; color: var(--teal); }
.sample-bottom, .art-caption { font-size: 12px; display: block; padding-top: 18px; }
.art-caption { text-align: center; letter-spacing: 1px; }
.how-row { list-style: none; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 20px 0; gap: 24px; }
.how-row > li { display: flex; gap: 15px; align-items: center; }
.how-row > li > span { font-size: 28px; color: var(--teal); }
.how-row p { font-size: 14px; }
.how-row strong { display: block; font-size: 16px; }
.local-note { margin-top: 22px; }

/* Builder */
.builder { display: grid; grid-template-columns: 280px 1fr; gap: 55px; }
.step-rail { padding: 20px 0; }
.step-rail h2 { font-size: 38px; color: var(--wine); }
.steps { list-style: none; padding: 0; margin: 30px 0; }
.steps li { display: flex; gap: 15px; padding: 14px 0; color: #5f6b65; }
.steps li.active { color: var(--wine); }
.steps li.active strong { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; }
.step-num { flex-shrink: 0; border: 1px solid var(--line); border-radius: 50%; width: 32px; height: 32px; display: grid; place-items: center; }
.steps li.active .step-num { background: var(--wine); border-color: var(--wine); color: white; }
.steps li.done .step-num { border-color: var(--teal); color: var(--teal); }
.steps small, .rail-date span { display: block; }
.rail-date { font-size: 14px; padding-top: 20px; border-top: 1px solid var(--line); }
.form-shell { background: white; border: 1px solid var(--line); border-radius: 10px; padding: 35px; min-width: 0; }
.form-shell h1 { font-size: 36px; letter-spacing: -1px; margin-top: 10px; }
.step-count { color: var(--teal); margin: 0; }
.field, fieldset { margin: 25px 0; }
fieldset { border: 0; padding: 0; min-width: 0; }
label, legend { font-weight: 700; }
legend { padding: 0; }
label > span:not(.choice span) { font-weight: 400; }
label > span { font-size: 14px; }
input:not([type=radio]):not([type=checkbox]), textarea, select {
  display: block; width: 100%; min-height: 48px; padding: 12px; border: 1px solid #8d9a92; border-radius: 5px; margin-top: 7px; background: white; color: var(--ink); font-size: 17px;
}
input[type=date], input[type=time] { min-width: 0; -webkit-appearance: none; appearance: none; text-align: left; }
input::-webkit-date-and-time-value { text-align: left; }
textarea { resize: vertical; }
input[type=radio], input[type=checkbox] { accent-color: var(--wine); width: 20px; height: 20px; flex-shrink: 0; margin: 0; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.choice { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); padding: 13px; border-radius: 5px; font-weight: 400; min-height: 52px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--teal); background: #edf5f1; box-shadow: inset 3px 0 0 var(--teal); }
.choice strong, .choice small { display: block; }
.choice small { font-size: 13px; color: #56635b; }
.check-line { display: flex; align-items: flex-start; gap: 10px; margin-top: 13px; font-weight: 400; cursor: pointer; }
.check-line input { margin-top: 3px; }
.check-line span { font-size: 16px; }
.field-help { font-size: 14px; display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 12px; }
.field-help a { padding: 6px 0; }
.field-help > span { color: #5f6b65; font-size: 13px; }
.soft-note, .official-help { background: var(--soft); padding: 17px; border-radius: 5px; font-size: 15px; }
.soft-note p:first-child { margin-top: 0; }
.soft-note p:last-child { margin-bottom: 0; }
.deadline-title { margin-bottom: 4px; }
.deadline-list { margin: 0; padding-left: 20px; }
.deadline-list li { margin: 4px 0; }
.warn-note { border-left: 3px solid var(--wine); background: #fbf3f5; padding: 10px 14px; font-size: 15px; margin-top: 10px; }
.official-help strong { display: block; }
.official-help a { display: inline-block; margin: 4px 18px 4px 0; padding: 4px 0; }
.counter { text-align: right; margin-top: 6px; }
.form-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; border-top: 1px solid var(--line); padding-top: 22px; }
.privacy-line { margin-top: 20px; }
.mobile-progress { display: none; }

/* Result */
.result-intro { text-align: center; margin: 15px 0 35px; }
.result-intro h1 { font-size: 42px; }
.jump-save { display: none; min-height: 44px; align-items: center; font-weight: 700; }
.result-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 45px; max-width: 980px; margin: auto; align-items: start; }
.personal-card { background: white; border: 2px solid var(--wine); border-radius: 8px; padding: 30px; min-width: 0; }
.card-brand { display: flex; align-items: center; justify-content: space-between; font-weight: 800; color: var(--wine); font-size: 14px; line-height: 1.25; text-align: right; }
.card-brand img { width: 80px; height: 80px; object-fit: contain; }
.card-status { display: inline-flex; align-items: center; gap: 8px; margin: 18px 0 0; padding: 5px 12px; border: 1px solid currentColor; border-radius: 999px; font-size: 13px; font-weight: 700; letter-spacing: .3px; }
.card-status.is-ready { color: var(--teal); }
.card-status.is-progress { color: var(--wine); }
.personal-card h2 { margin: 12px 0 18px; overflow-wrap: anywhere; }
.card-date { display: flex; align-items: center; gap: 18px; background: var(--wine); color: white; padding: 14px 16px; line-height: 1.4; margin-bottom: 8px; }
.card-date .date-number { font-size: 44px; }
.card-date .date-label { margin-left: auto; font-size: 12px; letter-spacing: 1px; text-align: right; }
.plan-row { padding: 14px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.plan-row:first-of-type { border-top: 0; }
.plan-row small { display: block; color: var(--teal); font-weight: 700; text-transform: uppercase; font-size: 12px; letter-spacing: 1px; }
.plan-row p { margin: 4px 0; }
.plan-row .pending { color: var(--muted); font-style: italic; }
.plan-row .row-note { font-size: 13px; color: var(--muted); margin-top: 6px; }
.next-steps { border-top: 2px solid var(--wine); margin-top: 8px; padding: 16px 0 6px; }
.next-steps h3 { margin: 0 0 8px; color: var(--wine); font-size: 18px; }
.next-steps ul { list-style: none; margin: 0; padding: 0; }
.next-steps li { display: flex; gap: 12px; align-items: flex-start; padding: 6px 0; overflow-wrap: anywhere; }
.next-steps li::before { content: ""; flex-shrink: 0; width: 16px; height: 16px; border: 2px solid var(--wine); border-radius: 3px; margin-top: 5px; }
.card-foot { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 14px; font-size: 12px; color: #59665e; line-height: 1.6; }
.save-panel { min-width: 0; }
.save-panel h2 { margin-top: 0; }
.save-panel .button { width: 100%; margin: 7px 0; }
.save-panel p { font-size: 15px; }
.status-line:empty { display: none; }
.status-line { border-left: 3px solid var(--teal); padding: 8px 12px; background: var(--soft); }
.image-fallback { border: 1px solid var(--line); border-radius: 6px; padding: 12px; background: white; }
.image-fallback p { margin-top: 0; }
.image-fallback img { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
.edit-link { margin: 10px 0 0; }
.share-block { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 20px; }
.share-block textarea { font-size: 15px; }

/* Dialogs */
dialog { border: 1px solid var(--line); border-radius: 10px; padding: 35px; max-width: 600px; width: calc(100% - 30px); max-height: calc(100% - 30px); overflow: auto; color: var(--ink); }
dialog::backdrop { background: #13282288; }
dialog h2 { margin-top: 0; }
.dialog-close { float: right; border: 0; background: none; font-size: 32px; line-height: 1; width: 44px; height: 44px; margin: -14px -14px 0 0; color: var(--ink); }
.resource-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.resource-row strong { text-decoration: underline; text-underline-offset: 4px; }
.resource-row small { display: block; color: var(--muted); font-size: 14px; }

@media (max-width: 960px) and (min-width: 751px) {
  .builder { grid-template-columns: 220px 1fr; gap: 32px; }
  .step-rail h2 { font-size: 32px; }
  .choice-grid.methods { grid-template-columns: 1fr; }
  .hero { gap: 40px; }
}
@media (max-width: 750px) {
  main { padding: 20px 16px 40px; }
  .site-header, .site-footer { padding: 12px 16px; }
  .resource-link { font-size: 14px; text-align: right; white-space: nowrap; }
  .jump-save { display: inline-flex; }
  .brand { font-size: 13px; gap: 10px; }
  .brand img { width: 60px; height: 60px; }
  .hero { grid-template-columns: 1fr; gap: 25px; padding-top: 0; }
  h1 { font-size: 44px; letter-spacing: -1.5px; }
  .desktop-break { display: none; }
  .hero-actions .button { width: 100%; }
  .hero-art { padding: 16px; }
  .sample-card { padding: 20px; }
  .how-row { grid-template-columns: 1fr; gap: 0; }
  .builder { display: block; }
  .step-rail { display: none; }
  .form-shell { padding: 22px 17px; }
  .form-shell h1 { font-size: 32px; }
  .step-count { display: none; }
  .mobile-progress { display: block; margin-bottom: 4px; }
  #mobile-step { margin: 0 0 8px; font-size: 14px; font-weight: 700; color: var(--teal); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
  #mobile-step-next { font-weight: 400; color: var(--muted); }
  .progress-track { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
  #progress-fill { display: block; height: 100%; background: var(--wine); width: 33.33%; transition: width .2s; }
  .choice-grid { grid-template-columns: 1fr; }
  .form-actions .button { flex: 1; }
  .result-grid { grid-template-columns: 1fr; gap: 30px; }
  .result-intro h1 { font-size: 34px; }
  .personal-card { padding: 20px; }
  .card-date .date-number { font-size: 38px; }
  .site-footer { display: block; }
  .site-footer span { display: block; }
  .field-help { display: block; }
  .field-help > span { display: none; }
  .result-intro { margin-top: 0; }
  dialog { padding: 24px 20px; }
}
@media (max-width: 360px) {
  h1 { font-size: 38px; }
  .card-date { flex-wrap: wrap; }
  .card-date .date-label { margin-left: 0; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

@page { size: letter; margin: 0.6in; }
@media print {
  body { background: white; font-size: 12pt; }
  body.view-result header, body.view-result footer, body.view-result .save-panel, body.view-result .result-intro, body.view-result .welcome, body.view-result .builder, dialog, .skip { display: none !important; }
  body.view-result main { padding: 0; max-width: none; }
  body.view-result .result-grid { display: block; max-width: none; }
  .personal-card { border: 1.5pt solid var(--wine); max-width: 6.5in; margin: 0 auto; padding: 0.35in; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
  .card-date, .card-status, .next-steps li::before { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .plan-row, .next-steps li, .card-date, .card-brand { break-inside: avoid; }
  .next-steps h3 { break-after: avoid; }
  a { color: inherit; }
}
