/* =========================================================================
   Roseville Durable Skills Survey — RJUHSD-branded, Poppins + League Spartan
   ========================================================================= */

:root {
  --rjuhsd-red:        #DC142C;
  --rjuhsd-blue:       #014CA7;
  --rjuhsd-blue-deep:  #012F6B;
  --rjuhsd-blue-light: #8DADD9;
  --accent-gold:       #E1B948;
  --ink:               #0b1a33;
  --ink-soft:          #3a4a66;
  --ink-mute:          #6e7a90;
  --cream:             #fdfaf4;
  --cream-deep:        #f5eede;
  --line:              #e3ddd0;
  --white:             #ffffff;

  --radius:            3px;
  --radius-lg:         6px;

  --font-head: "League Spartan", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-body: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  --shadow-ghost: 0 1px 0 rgba(1, 76, 167, 0.06), 0 8px 24px -12px rgba(1, 76, 167, 0.18);
  --shadow-lift:  0 2px 0 rgba(1, 76, 167, 0.08), 0 16px 40px -16px rgba(1, 76, 167, 0.28);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(1.9rem, 4vw, 2.75rem); line-height: 1.08; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.3rem, 2.2vw, 1.6rem); line-height: 1.2; }
h3 { font-size: 1.05rem; line-height: 1.3; }

p { margin: 0 0 1em; }

a { color: var(--rjuhsd-blue); text-decoration: none; border-bottom: 1px solid currentColor; }
a:hover { color: var(--rjuhsd-red); }

/* =========================================================================
   Top bar: logo + district name
   ========================================================================= */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.topbar img {
  height: 48px;
  width: auto;
  display: block;
}
.topbar-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.topbar-name {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  color: var(--rjuhsd-blue);
  text-transform: uppercase;
}
.topbar-sub {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--ink-mute);
  text-transform: uppercase;
  margin-top: 2px;
}

/* =========================================================================
   Hero — navy, two-column (SVG + primer)
   ========================================================================= */
.hero {
  background:
    radial-gradient(ellipse 80% 60% at 85% 0%, rgba(255,255,255,0.08), transparent 60%),
    linear-gradient(180deg, var(--rjuhsd-blue) 0%, var(--rjuhsd-blue-deep) 100%);
  color: var(--white);
}
.hero-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 56px 24px 64px;
  display: grid;
  grid-template-columns: minmax(320px, 5fr) minmax(320px, 6fr);
  gap: 48px;
  align-items: center;
}
.hero-svg {
  width: 100%;
  max-width: 520px;
  aspect-ratio: 8 / 5;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.6);
}
.hero-eyebrow {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.26em;
  color: var(--accent-gold);
  text-transform: uppercase;
  margin-bottom: 18px;
}
.hero h1 {
  color: var(--white);
  font-weight: 900;
  margin-bottom: 18px;
}
.hero-lede {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 22px;
  max-width: 48ch;
}
.hero-primer {
  background: rgba(255, 255, 255, 0.06);
  border-left: 3px solid var(--accent-gold);
  padding: 18px 22px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.6;
}
.hero-primer strong {
  color: var(--white);
  font-weight: 600;
}

@media (max-width: 820px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 40px 20px 48px;
  }
  .hero-svg { max-width: 460px; margin: 0 auto; max-height: 260px; }
}

/* =========================================================================
   Main / form container
   ========================================================================= */
main {
  max-width: 880px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

.intro-rule {
  width: 48px;
  height: 3px;
  background: var(--rjuhsd-red);
  margin: 0 0 16px;
  border: 0;
}

.section {
  margin-bottom: 48px;
}
.section-eyebrow {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.26em;
  color: var(--rjuhsd-blue);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.section-title {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.section-sub {
  color: var(--ink-soft);
  font-size: 0.98rem;
  margin-bottom: 24px;
}

/* =========================================================================
   Role tabs — Student / Parent / Staff
   ========================================================================= */
.role-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
@media (max-width: 640px) {
  .role-tabs { grid-template-columns: 1fr; }
  .role-tab { padding: 16px 16px; }
}
.role-tab {
  appearance: none;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  color: var(--ink);
  transition: all 0.16s ease;
  box-shadow: var(--shadow-ghost);
}
.role-tab:hover {
  border-color: var(--rjuhsd-blue-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lift);
}
.role-tab[aria-pressed="true"] {
  border-color: var(--rjuhsd-blue);
  background: linear-gradient(180deg, var(--white) 0%, #f4f8ff 100%);
  box-shadow: 0 0 0 1px var(--rjuhsd-blue) inset, var(--shadow-lift);
}
.role-tab-label {
  display: block;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
  color: var(--rjuhsd-blue);
}
.role-tab[aria-pressed="true"] .role-tab-label { color: var(--rjuhsd-red); }
.role-tab-hint {
  font-size: 0.82rem;
  color: var(--ink-mute);
  line-height: 1.35;
}

/* =========================================================================
   Context fields
   ========================================================================= */
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (max-width: 560px) { .field-grid { grid-template-columns: 1fr; } }

.field label {
  display: block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 13px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--rjuhsd-blue);
  box-shadow: 0 0 0 3px rgba(1, 76, 167, 0.12);
}

/* =========================================================================
   Skill cards (Q1–Q6) — Likert rating
   ========================================================================= */
.skill-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 3px solid var(--rjuhsd-red);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-ghost);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.skill-card:focus-within {
  box-shadow: var(--shadow-lift);
  transform: translateY(-1px);
}
.skill-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.skill-card-name {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.15rem;
  color: var(--rjuhsd-blue);
  letter-spacing: -0.005em;
}
.skill-card-index {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  color: var(--ink-mute);
  text-transform: uppercase;
}
.skill-card-def {
  color: var(--ink-soft);
  font-size: 0.96rem;
  margin-bottom: 14px;
  max-width: 68ch;
}
.skill-card-question {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.35;
  color: var(--ink);
  margin: 4px 0 16px;
  max-width: 62ch;
  letter-spacing: -0.005em;
}
.likert {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
}
@media (max-width: 560px) {
  .likert {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .likert-label { font-size: 0.72rem; }
  .likert-label.end { text-align: left; }
  .skill-card { padding: 18px 16px; }
  .skill-card-question { font-size: 1rem; }
  main { padding: 40px 16px 72px; }
  .hero-inner { padding: 32px 16px 40px; }
}
.likert-label {
  font-size: 0.78rem;
  color: var(--ink-mute);
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.likert-label.end { text-align: right; }
.likert-scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.likert-scale input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.likert-scale label {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink-mute);
  cursor: pointer;
  transition: all 0.12s ease;
}
.likert-scale label:hover {
  border-color: var(--rjuhsd-blue-light);
  color: var(--rjuhsd-blue);
}
.likert-scale input[type="radio"]:checked + label {
  background: var(--rjuhsd-blue);
  border-color: var(--rjuhsd-blue);
  color: var(--white);
  box-shadow: 0 2px 0 var(--rjuhsd-blue-deep);
}
.likert-scale input[type="radio"]:focus-visible + label {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}

/* =========================================================================
   Top-3 checklist (Q7)
   ========================================================================= */
.top3-card {
  background: linear-gradient(180deg, #eaf1fc 0%, var(--cream) 100%);
  border: 1px solid var(--line);
  border-left: 3px solid var(--rjuhsd-blue);
  border-radius: var(--radius);
  padding: 24px 24px 22px;
}
.top3-card .section-eyebrow { color: var(--rjuhsd-blue) !important; }
.top3-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 16px;
}
@media (max-width: 560px) { .top3-grid { grid-template-columns: 1fr; } }

.top3-option {
  position: relative;
}
.top3-option input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.top3-option label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  cursor: pointer;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink-soft);
  transition: all 0.12s ease;
}
.top3-option label::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-radius: 3px;
  flex: 0 0 18px;
  transition: all 0.12s ease;
}
.top3-option input[type="checkbox"]:checked + label {
  border-color: var(--rjuhsd-blue);
  background: #eef4ff;
  color: var(--rjuhsd-blue-deep);
}
.top3-option input[type="checkbox"]:checked + label::before {
  background: var(--rjuhsd-blue);
  border-color: var(--rjuhsd-blue);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' d='M2 7.5 L6 11 L12 3.5'/%3E%3C/svg%3E");
  background-size: 70%;
  background-repeat: no-repeat;
  background-position: center;
}
.top3-option input[type="checkbox"]:disabled + label {
  opacity: 0.45;
  cursor: not-allowed;
}
.top3-count {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 12px;
}
.top3-count strong { color: var(--rjuhsd-blue); font-size: 1rem; }

/* =========================================================================
   Textareas for open-ended
   ========================================================================= */
.field textarea {
  min-height: 100px;
  resize: vertical;
}

/* =========================================================================
   Consent + submit
   ========================================================================= */
.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 22px;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.consent input { margin-top: 4px; }

.submit-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 0.92rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 16px 32px;
  border-radius: var(--radius);
  transition: all 0.14s ease;
}
.btn-primary {
  background: var(--rjuhsd-blue);
  color: var(--white);
  box-shadow: 0 3px 0 var(--rjuhsd-blue-deep);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--rjuhsd-blue-deep); }
.btn-primary:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--rjuhsd-blue-deep); }
.btn-primary:disabled {
  background: var(--ink-mute);
  box-shadow: 0 3px 0 var(--ink-soft);
  cursor: not-allowed;
  opacity: 0.6;
}

.privacy-note {
  font-size: 0.82rem;
  color: var(--ink-mute);
  max-width: 44ch;
}

/* =========================================================================
   Validation / error states
   ========================================================================= */
.error-banner {
  display: none;
  background: #fff5f7;
  border: 1.5px solid var(--rjuhsd-red);
  border-left-width: 4px;
  color: var(--rjuhsd-red);
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 0.95rem;
}
.error-banner.visible { display: block; }

.field-error {
  color: var(--rjuhsd-red);
  font-size: 0.82rem;
  margin-top: 6px;
  display: none;
}
.field-error.visible { display: block; }

/* =========================================================================
   Success state
   ========================================================================= */
.success-state {
  display: none;
  text-align: center;
  padding: 80px 24px 120px;
  max-width: 620px;
  margin: 0 auto;
}
.success-state.visible { display: block; }
.success-state img {
  width: 96px;
  height: auto;
  margin: 0 auto 24px;
  display: block;
}
.success-state h2 {
  font-size: 2rem;
  color: var(--rjuhsd-blue);
  margin-bottom: 12px;
}
.success-state p { color: var(--ink-soft); font-size: 1rem; }
.success-footnote {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* Hide the form when success is active */
body.submitted .topbar,
body.submitted .hero,
body.submitted main form { display: none; }
body.submitted .success-state { display: block; }

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px;
  text-align: center;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* =========================================================================
   Reduced motion — stop hero animation
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  .hero-svg * { animation-duration: 0s !important; animation-iteration-count: 1 !important; }
  .hero-svg animate,
  .hero-svg animateTransform { display: none; }
  * { transition-duration: 0s !important; }
}
