/* =============================================================================
   sponsor.css - shared by /sponsor (intake) and /sponsor/pay (payment).
   Moved VERBATIM from pages/sponsor.html's page-local <style>, so the two
   pages cannot drift apart. Each page links it through its head_extra, which
   build.js places AFTER site.css - so the equal-specificity overrides below
   still win on source order, exactly as they did inline.
   ============================================================================= */

/* Compact hero: on a form page the levels are what a business came for, so
   they must clear the fold at 1280x900 - the standard hero left only the
   step bar showing. Top and bottom only, so the sitewide phone band keeps
   its side padding. Equal-specificity rules win here by coming after
   site.css. */
.page-hero.sp-hero { padding-top: clamp(22px, 2.6vw, 34px); padding-bottom: clamp(20px, 2.2vw, 28px); }
.sp-hero .breadcrumb { margin-bottom: 12px; }
.sp-hero h1 { font-size: clamp(1.9rem, 3.6vw, 2.75rem); margin-bottom: 8px; }
.sp-hero p { font-size: clamp(1rem, 1.2vw, 1.08rem); max-width: 900px; }
.sp-section { padding: clamp(18px, 2.4vw, 28px) 28px clamp(48px, 7vw, 80px); background: var(--bg-warm); }
.sp-inner { max-width: 760px; margin: 0 auto; }
.sp-card { background: white; border-radius: 24px; box-shadow: 0 30px 60px -20px rgba(31,78,155,0.18), 0 8px 24px -8px rgba(0,0,0,0.08); overflow: hidden; scroll-margin-top: 112px; }
/* Fail-closed safety net: several blocks below set their own display, and a
   same-specificity author rule beats the browser's [hidden] - the exact bug
   that once left gated header controls visible. */
.sp-card [hidden], .sp-banner[hidden] { display: none !important; }

/* ---- step bar ---- */
.sp-steps { list-style: none; margin: 0; padding: 22px 30px 0; display: flex; align-items: center; gap: 8px; }
.sp-step { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ink-mute); white-space: nowrap; }
.sp-step-n { width: 24px; height: 24px; border-radius: 50%; background: var(--bg-warm); color: var(--ink-mute); font-size: 11.5px; font-weight: 800; display: grid; place-items: center; flex-shrink: 0; }
.sp-step.is-current { color: var(--blue); }
.sp-step.is-current .sp-step-n { background: var(--blue); color: white; }
.sp-step.is-done { color: var(--green); }
.sp-step.is-done .sp-step-n { background: var(--green); color: white; }
.sp-step-line { flex: 1; height: 1px; background: var(--line); min-width: 12px; }
.sp-step-short { display: none; }

.sp-body { padding: 22px 30px 30px; }

/* ---- panels ---- */
.sp-panel { border: 0; margin: 0; padding: 0; min-width: 0; }
.sp-legend { display: block; width: 100%; padding: 0; font-family: 'Bricolage Grotesque', sans-serif; font-size: 1.25rem; font-weight: 800; color: var(--ink); letter-spacing: -0.01em; margin-bottom: 4px; }
.sp-legend:focus { outline: none; }
.sp-sub { font-size: 14px; color: var(--ink-soft); line-height: 1.55; margin: 0 0 16px; }

/* ---- tiers (from /config) ---- */
.sp-tiers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.sp-tier { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1.5px solid var(--line); border-radius: 14px; padding: 16px 18px; cursor: pointer; background: white; transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
.sp-tier:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -12px rgba(31,78,155,0.25); }
.sp-tier input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.sp-tier:focus-within { outline: 3px solid rgba(31,78,155,0.35); outline-offset: 2px; }
.sp-tier.is-selected { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31,78,155,0.12); }
.sp-tier-name { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 16px; color: var(--ink); }
.sp-tier-price { font-weight: 800; font-size: 16px; color: var(--orange-deep); white-space: nowrap; }
.sp-year { font-size: 13px; color: var(--ink-mute); margin: 14px 0 0; }

/* ---- fields ---- */
.sp-field { margin-bottom: 16px; }
.sp-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.sp-label { display: block; font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.sp-req { color: #B42318; margin-left: 2px; }
.sp-opt { font-size: 12px; font-weight: 500; color: var(--ink-mute); margin-left: 6px; }
.sp-input { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1.5px solid var(--line); font-size: 15px; font-family: inherit; color: var(--ink); background: white; transition: border-color 0.2s; }
.sp-input:focus { outline: none; border-color: var(--blue); }
textarea.sp-input { resize: vertical; min-height: 88px; line-height: 1.5; }
.sp-input[aria-invalid="true"] { border-color: #B42318; }
.sp-file { display: block; width: 100%; padding: 14px; border: 1.5px dashed var(--line); border-radius: 10px; font-size: 14px; font-family: inherit; color: var(--ink-soft); background: var(--bg-warm); }
.sp-file[aria-invalid="true"] { border-color: #B42318; }
.sp-hint { font-size: 12.5px; color: var(--ink-mute); margin: 6px 0 0; }
.sp-err { font-size: 12.5px; font-weight: 700; color: #B42318; margin: 6px 0 0; }

/* ---- review ---- */
.sp-summary { margin: 0 0 16px; padding: 16px 18px; background: var(--bg-warm); border-radius: 14px; }
.sp-row { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; font-size: 14px; }
.sp-row dt { color: var(--ink-soft); }
.sp-row dd { margin: 0; font-weight: 700; color: var(--ink); text-align: right; overflow-wrap: anywhere; }
.sp-row.is-total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; font-size: 16px; }
.sp-row.is-total dt, .sp-row.is-total dd { font-weight: 800; color: var(--ink); }
.sp-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: var(--bg-warm); border-radius: 10px; font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; margin: 0 0 18px; }
.sp-note strong { color: var(--ink); }

/* ---- actions ---- */
.sp-actions { display: flex; gap: 10px; justify-content: space-between; margin-top: 22px; }
.sp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--blue); color: white; border: none; padding: 13px 24px; border-radius: 12px; font-weight: 800; font-size: 15px; cursor: pointer; font-family: inherit; text-decoration: none; transition: background 0.2s, transform 0.2s; }
.sp-btn:hover { background: var(--blue-deep); transform: translateY(-1px); }
.sp-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.sp-btn-primary { margin-left: auto; }
.sp-btn-go { background: var(--orange); box-shadow: 0 8px 20px rgba(226,115,40,0.3); }
.sp-btn-go:hover { background: var(--orange-deep); }
.sp-btn-ghost { background: var(--bg-warm); color: var(--ink-soft); }
.sp-btn-ghost:hover { background: #F3ECDD; color: var(--ink); }

/* ---- messages + states ---- */
.sp-msg { font-size: 13.5px; padding: 12px 14px; border-radius: 10px; margin: 0 0 16px; line-height: 1.5; background: #FDEDED; color: #B42318; border: 1px solid #F5C2C0; }
.sp-state { padding: 30px; }
.sp-state h2 { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 1.45rem; color: var(--ink); margin: 0 0 10px; letter-spacing: -0.01em; }
.sp-state p { font-size: 15px; color: var(--ink-soft); line-height: 1.6; margin: 0 0 12px; }
.sp-state p strong { color: var(--ink); }
.sp-state .sp-btn { margin-top: 6px; }
.sp-state-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.sp-done-mark { width: 44px; height: 44px; border-radius: 50%; background: var(--green-soft); color: #1e7e34; display: grid; place-items: center; margin-bottom: 14px; }
.sp-warn-mark { width: 44px; height: 44px; border-radius: 50%; background: var(--orange-soft); color: var(--orange-deep); display: grid; place-items: center; margin-bottom: 14px; }
.sp-logo-status { font-size: 14px; padding: 10px 12px; border-radius: 10px; background: var(--bg-warm); color: var(--ink-soft); margin: 0 0 12px; }
.sp-logo-status.is-bad { background: #FDEDED; color: #B42318; }
.sp-loading { padding: 34px 30px; font-size: 15px; color: var(--ink-mute); }
.sp-sent { margin: 14px 0; padding: 14px 16px; background: var(--bg-warm); border-radius: 12px; font-size: 14px; color: var(--ink-soft); }
.sp-sent dt { font-weight: 700; color: var(--ink); }
.sp-sent dd { margin: 0 0 6px; }
.sp-banner { display: flex; gap: 12px; align-items: flex-start; background: var(--sand-light); border-left: 4px solid var(--orange); border-radius: 0 12px 12px 0; padding: 14px 16px; margin: 0 0 18px; font-size: 14px; color: var(--ink); line-height: 1.55; }
.sp-banner button { margin-left: auto; flex-shrink: 0; background: none; border: none; color: var(--blue); font-weight: 700; font-size: 13px; cursor: pointer; font-family: inherit; padding: 2px 4px; }
/* A business's own email or name can be one long unbroken word. The card
   clips overflow, so without this the rig showed "contact you at <email>"
   cut off 127px short on a 375px phone - the one detail they need to read. */
.sp-state p, .sp-sent dd, .sp-banner > div, .sp-msg { overflow-wrap: anywhere; }
.sp-footnote { text-align: center; font-size: 13.5px; color: var(--ink-mute); margin: 18px 0 0; line-height: 1.55; }
.sp-footnote a { color: var(--orange-deep); font-weight: 700; }

@media (max-width: 880px) { .sp-card { scroll-margin-top: 80px; } }
@media (max-width: 640px) {
  .sp-section { padding-left: 18px; padding-right: 18px; }
  .sp-steps { padding: 18px 20px 0; }
  .sp-body, .sp-state { padding-left: 20px; padding-right: 20px; }
  .sp-loading { padding-left: 20px; padding-right: 20px; }
}
/* Phone: tiers stack, fields go one per row, the step bar shortens. Must stay
   AFTER the wider bands - equal specificity resolves by source order. */
@media (max-width: 560px) {
  .sp-tiers { grid-template-columns: 1fr; }
  .sp-two { grid-template-columns: 1fr; }
  .sp-step-long { display: none; }
  .sp-step-short { display: inline; }
  .sp-actions { flex-wrap: wrap-reverse; }
  .sp-actions .sp-btn { flex: 1 1 auto; }
  /* Under 16px, iOS zooms the page on focus - nine fields of that is a mess. */
  .sp-input { font-size: 16px; }
}
/* Smallest phones: the step bar overflowed its own box by 11px at 320. */
@media (max-width: 380px) {
  .sp-steps { gap: 5px; }
  .sp-step { gap: 5px; font-size: 12px; }
  .sp-step-line { min-width: 6px; }
}
