/* =========================
   BASE RESETS & TOKENS
========================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --navy:        #0f2444;
  --navy-mid:    #1a3a6b;
  --navy-light:  #2455a4;
  --accent:      #3b82f6;
  --accent-glow: rgba(59,130,246,0.15);
  --white:       #ffffff;
  --off-white:   #f5f7fb;
  --slate-100:   #e8edf5;
  --slate-300:   #c4cdd9;
  --slate-500:   #64748b;
  --slate-700:   #334155;
  --text:        #0f172a;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--off-white);
  color: var(--text);
  min-height: 100vh;
}

/* =========================
   SCREEN UTILITIES (unchanged for JS compatibility)
========================= */

.screen         { display: none; }
.screen.active  { display: block; }
.hidden         { display: none !important; }
.tab-content    { display: none; }
.tab-content.active { display: block; }

/* =========================
   PAGE SECTIONS (home vs tool)
========================= */

.page-section          { display: none; }
.page-section.active   { display: block; }

/* =========================
   GLOBAL NAV
========================= */

#site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--navy);
  border-bottom: 1px solid var(--navy-mid);
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.nav-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.02em;
}

.nav-tabs {
  display: flex;
  gap: 20px;
}

.nav-tab {
  border: none;
  padding: 8px 20px;
  border-radius: 8px;
  background: transparent;
  color: rgba(255,255,255,0.65);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all .2s ease;
  font-family: inherit;
}

.nav-tab:hover {
  color: var(--white);
  background: rgba(255,255,255,0.08);
}

.nav-tab.active {
  background: var(--accent);
  color: var(--white);
}

/* =========================
   HOME — HERO
========================= */

.home-hero {
  background: var(--navy);
  padding: 80px 24px 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 100px;
  flex-wrap: wrap;
}

.home-hero-inner {
  max-width: 700px;
}

.home-eyebrow {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

.home-headline {
  font-size: 3.2rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin-bottom: 20px;
}

.home-sub {
  font-size: 1.1rem;
  line-height: 1.75;
  color: rgba(255,255,255,0.65);
  margin-bottom: 32px;
}

.home-cta {
  display: inline-block;
  border: none;
  padding: 16px 32px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--white);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: transform .2s ease, box-shadow .2s ease;
  box-shadow: 0 4px 20px rgba(59,130,246,0.4);
}

.home-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(59,130,246,0.5);
}

/* Hero visual cards */
.home-hero-visual {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

.hero-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 210px;
  backdrop-filter: blur(4px);
}

.hero-card-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.5);
}

.hero-card-amount {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--white);
}

.hero-card-note {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
}

.hero-card--free  .hero-card-amount { color: #4ade80; }
.hero-card--debt  .hero-card-amount { color: #f87171; }
.hero-card--cost  { border-color: var(--accent); background: rgba(59,130,246,0.12); }
.hero-card--cost  .hero-card-amount { color: var(--white); }

/* =========================
   HOME — HOW IT WORKS
========================= */

.how-section {
  padding: 72px 24px;
  background: var(--white);
}

.how-inner {
  max-width: 1000px;
  margin: 0 auto;
}

.section-heading {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 40px;
  letter-spacing: -0.02em;
}

.how-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.how-step {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.how-step-icon {
  font-size: 2rem;
  margin-bottom: 4px;
}

.how-step h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
}

.how-step p {
  font-size: 0.92rem;
  color: var(--slate-500);
  line-height: 1.65;
}

/* =========================
   HOME — ABOUT
========================= */

.about-section {
  padding: 72px 24px;
  background: var(--off-white);
}

.about-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 90px;
  align-items: start;
}

.about-text p {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--slate-700);
  margin-bottom: 16px;
}

.about-text p:last-child { margin-bottom: 0; }

.about-text strong {
  color: var(--navy);
}

.about-stat-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.about-stat {
  background: var(--white);
  border: 1px solid var(--slate-100);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.about-stat-num {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.03em;
  line-height: 1;
}

.about-stat-label {
  font-size: 0.82rem;
  color: var(--slate-500);
  line-height: 1.45;
}

/* =========================
   FOOTER
========================= */

.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.5);
  text-align: center;
  padding: 28px 24px;
  font-size: 0.85rem;
}

.footer-link {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  padding: 0;
}

.footer-link:hover { text-decoration: underline; }

/* =========================
   TOOL PAGE WRAPPER
========================= */

#page-tool {
  padding: 40px 20px;
}

.page {
  max-width: 1000px;
  margin: auto;
}

/* =========================
   TOOL HERO
========================= */

.hero {
  text-align: center;
  margin-bottom: 40px;
}

.hero h1 {
  font-size: 2.6rem;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.1;
  color: var(--navy);
}

.hero p {
  color: var(--slate-500);
  max-width: 650px;
  margin: auto;
  font-size: 1.05rem;
  line-height: 1.7;
}

/* =========================
   MAIN CARD
========================= */

.card {
  background: var(--white);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 8px 30px rgba(15,23,42,0.07);
}

/* =========================
   TABS
========================= */

.tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.tab {
  border: none;
  padding: 14px 24px;
  border-radius: 12px;
  background: var(--off-white);
  cursor: pointer;
  font-weight: 600;
  transition: all .25s ease;
  font-family: inherit;
  color: var(--slate-700);
}

.tab:hover {
  background: var(--slate-100);
}

.tab.active {
  background: var(--navy);
  color: var(--white);
}

/* =========================
   TEXTAREA
========================= */

#letterText {
  width: 100%;
  min-height: 320px;
  border: 2px solid var(--slate-100);
  border-radius: 16px;
  padding: 20px;
  resize: vertical;
  font-size: 15px;
  line-height: 1.6;
  outline: none;
  font-family: inherit;
  color: var(--text);
}

#letterText:focus {
  border-color: var(--accent);
}

/* =========================
   UPLOAD AREA
========================= */

#uploadArea {
  border: 2px dashed var(--slate-300);
  border-radius: 18px;
  padding: 60px 20px;
  text-align: center;
  transition: all .25s ease;
  cursor: pointer;
}

#uploadArea:hover {
  border-color: var(--accent);
  background: #f0f5ff;
}

#uploadArea p:first-child {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

#uploadArea p:last-child {
  color: var(--slate-500);
}

#fileInput {
  margin-top: 20px;
}

#fileName {
  margin-top: 14px;
  color: var(--slate-700);
  font-weight: 500;
}

/* =========================
   ANALYZE BUTTON
========================= */

#analyzeBtn {
  width: 100%;
  margin-top: 24px;
  border: none;
  border-radius: 16px;
  padding: 18px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--white);
  background: var(--navy);
  transition: transform .2s ease, background .2s ease;
  font-family: inherit;
}

#analyzeBtn:hover {
  transform: translateY(-2px);
  background: var(--navy-mid);
}

.btn-loading {
  background: var(--slate-300) !important;
  color: var(--slate-700) !important;
  cursor: default !important;
  transform: none !important;
  pointer-events: none !important;
}

/* =========================
   LOADING
========================= */

#screen-loading {
  display: none;
  text-align: center;
  padding: 80px 20px;
}

#screen-loading.active {
  display: block;
}

#loadingMessage {
  font-size: 1.1rem;
  color: var(--slate-500);
  font-weight: 500;
}

/* =========================
   RESULTS
========================= */

#screen-results {
  max-width: 820px;
  margin: 0 auto;
  padding-bottom: 48px;
}

.results-header {
  margin: 28px 0 32px;
}

.results-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

#schoolName {
  font-size: 2rem;
  font-weight: 800;
  color: var(--navy);
  margin: 0;
}

.results-summary {
  color: var(--slate-700);
  font-size: 1rem;
  line-height: 1.75;
  margin-top: 12px;
}

/* Net price hero */

.net-price-hero {
  background: var(--navy);
  border-radius: 24px;
  padding: 36px 40px;
  text-align: center;
  margin-bottom: 24px;
  color: var(--white);
}

.nph-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.7;
  margin-bottom: 10px;
}

#netPrice {
  font-size: 3.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 10px;
}

.nph-note {
  font-size: 0.78rem;
  opacity: 0.6;
  line-height: 1.5;
}

/* =========================
   AID GRID
========================= */

.aid-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.aid-col {
  border-radius: 20px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.aid-col--grants {
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
}

.aid-col--loans {
  background: #fef2f2;
  border: 1.5px solid #fecaca;
}

.aid-col-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}

.aid-badge {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 3px 8px;
  border-radius: 6px;
  margin-top: 3px;
  flex-shrink: 0;
}

.aid-badge--green {
  background: #bbf7d0;
  color: #065f46;
}

.aid-badge--red {
  background: #fecaca;
  color: #991b1b;
}

.aid-col-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.aid-col-sub {
  font-size: 0.78rem;
  color: var(--slate-500);
  line-height: 1.4;
}

#grantsList,
#loansList {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#grantsList > div {
  background: var(--white);
  border-left: 4px solid #10b981;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text);
}

#loansList > div {
  background: var(--white);
  border-left: 4px solid #ef4444;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text);
}

#noLoans {
  color: #94a3b8;
  font-size: 0.88rem;
  padding: 4px 0;
  margin: 0;
}

/* =========================
   WORK STUDY
========================= */

#workStudy {
  background: var(--off-white);
  border-left: 4px solid var(--slate-300);
  padding: 12px 16px;
  border-radius: 12px;
  margin: 4px 0 20px;
  font-size: 0.88rem;
  color: var(--slate-700);
  line-height: 1.65;
}

/* =========================
   CONFIDENCE WARNING
========================= */

#confidenceWarning {
  background: #fff7ed;
  color: #9a3412;
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 20px;
  border-left: 5px solid #f97316;
}

/* =========================
   CHECKS & RED FLAGS
========================= */

#checksCard {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 16px;
  padding: 24px;
  margin: 24px 0;
}

#checksCard h3 {
  color: #92400e;
  margin-bottom: 12px;
}

#checksList li {
  margin-bottom: 10px;
  line-height: 1.6;
}

#redFlagsCard {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 16px;
  padding: 24px;
  margin: 24px 0;
}

#redFlagsCard h3 {
  color: #b91c1c;
  margin-bottom: 12px;
}

#redFlagsList li {
  margin-bottom: 8px;
}

/* Bullet indent fix: global * reset removes default ul padding */
#checksList,
#redFlagsList {
  padding-left: 20px;
}

/* Accordion closed/open states for checks & flags */
#checksCard.accordion h3,
#redFlagsCard.accordion h3 {
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
}

.accordion-chevron {
  font-size: 0.7rem;
  opacity: 0.5;
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-left: 8px;
}

#checksCard.accordion.open .accordion-chevron,
#redFlagsCard.accordion.open .accordion-chevron {
  transform: rotate(180deg);
}

#checksCard.accordion ul,
#redFlagsCard.accordion ul {
  display: none;
  margin-top: 14px;
}

#checksCard.accordion.open ul,
#redFlagsCard.accordion.open ul {
  display: block;
}

/* =========================
   NEXT STEPS
========================= */

.steps-section {
  margin: 24px 0;
}

.steps-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--slate-500);
  margin-bottom: 14px;
}

#nextStepsList {
  background: var(--white);
  border: 1.5px solid var(--slate-100);
  border-radius: 18px;
  padding: 22px 24px 22px 44px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

#nextStepsList li {
  margin-bottom: 14px;
  line-height: 1.7;
  color: var(--text);
  font-size: 0.93rem;
}

#nextStepsList li:last-child {
  margin-bottom: 0;
}

/* =========================
   SCORECARD CARD
========================= */

#scorecardCard {
  background: var(--off-white);
  border: 1px solid var(--slate-100);
  border-radius: 16px;
  padding: 20px 24px;
  margin: 16px 0;
  font-size: 0.88rem;
  color: var(--slate-700);
}

#scorecardCard h3 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #94a3b8;
  margin-bottom: 10px;
}

.scorecard-match {
  color: var(--slate-700);
  margin-bottom: 10px;
  font-size: 0.88rem;
}

.scorecard-loading {
  color: #94a3b8;
  font-style: italic;
}

.scorecard-checks {
  padding-left: 18px;
  margin: 10px 0;
}

.scorecard-checks li {
  margin-bottom: 8px;
  line-height: 1.6;
  color: var(--slate-700);
}

.income-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 0.84rem;
}

.income-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--off-white);
  color: var(--slate-700);
}

.income-table td:last-child {
  text-align: right;
  font-weight: 600;
  color: var(--text);
}

.income-table tr:last-child td {
  border-bottom: none;
}

.scorecard-note {
  color: var(--slate-700);
  font-size: 0.84rem;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--off-white);
}

.scorecard-source {
  color: #94a3b8;
  font-size: 0.78rem;
  margin-top: 8px;
}

.scorecard-source a {
  color: var(--slate-500);
  text-decoration: underline;
}

/* =========================
   RESOURCES
========================= */

#resourcesSection {
  border: 1px solid var(--slate-100);
  border-radius: 16px;
  padding: 20px 24px;
  margin: 16px 0;
}

#resourcesSection h3 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #94a3b8;
  margin-bottom: 12px;
}

#resourcesList {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#resourcesList a {
  color: var(--accent);
  text-decoration: underline;
  line-height: 1.5;
  font-size: 0.88rem;
}

#resourcesList a:hover {
  color: var(--navy);
}

/* =========================
   BACK BUTTONS
========================= */

button[onclick="goBack()"],
button[onclick="goBackToCompare()"] {
  margin-bottom: 0;
  border: none;
  background: var(--off-white);
  padding: 12px 18px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  color: var(--slate-700);
}

button[onclick="goBack()"]:hover,
button[onclick="goBackToCompare()"]:hover {
  background: var(--slate-100);
}

/* =========================
   MODE SWITCHER
========================= */

#mode-switcher {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 28px;
}

.mode-btn {
  border: 2px solid var(--slate-100);
  padding: 12px 28px;
  border-radius: 12px;
  background: var(--white);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all .25s ease;
  color: var(--slate-700);
  font-family: inherit;
}

.mode-btn:hover {
  border-color: var(--accent);
  color: var(--navy);
}

.mode-btn.active {
  background: var(--navy);
  color: var(--white);
  border-color: transparent;
}

/* =========================
   COMPARE INPUT
========================= */

.compare-subtitle {
  color: var(--slate-500);
  margin-bottom: 24px;
  line-height: 1.6;
}

#compareSlotContainer {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 20px;
}

.compare-slot {
  border: 2px solid var(--slate-100);
  border-radius: 16px;
  padding: 20px;
  background: var(--off-white);
}

.slot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.slot-label {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.slot-remove-btn {
  border: none;
  background: #fee2e2;
  color: #dc2626;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background .2s ease;
}

.slot-remove-btn:hover {
  background: #fecaca;
}

.slot-textarea {
  width: 100%;
  min-height: 160px;
  border: 2px solid var(--slate-100);
  border-radius: 12px;
  padding: 14px;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  background: var(--white);
  font-family: inherit;
}

.slot-textarea:focus {
  border-color: var(--accent);
}

.slot-file-row {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--slate-500);
}

.slot-file-name {
  margin-left: 8px;
  color: var(--navy);
  font-weight: 500;
}

#addSlotBtn {
  width: 100%;
  padding: 14px;
  border: 2px dashed var(--slate-300);
  border-radius: 14px;
  background: var(--white);
  cursor: pointer;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 16px;
  transition: all .2s ease;
  font-family: inherit;
  font-size: 0.95rem;
}

#addSlotBtn:hover {
  border-color: var(--accent);
  color: var(--navy);
}

#compareBtn {
  width: 100%;
  padding: 18px;
  border: none;
  border-radius: 16px;
  background: var(--navy);
  color: var(--white);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease;
  font-family: inherit;
}

#compareBtn:hover {
  transform: translateY(-2px);
  background: var(--navy-mid);
}

#compareBtn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* =========================
   COMPARE RESULTS
========================= */

#screen-compare-results {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

#screen-compare-results h2 {
  font-size: 2rem;
  font-weight: 800;
  margin: 0;
  color: var(--navy);
}

.compare-scroll {
  overflow-x: auto;
  margin-bottom: 32px;
  border-radius: 16px;
  border: 1px solid var(--slate-100);
  box-shadow: 0 4px 16px rgba(15,23,42,0.06);
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.compare-table thead tr {
  background: var(--off-white);
}

.compare-table th {
  padding: 16px 20px;
  text-align: center;
  font-weight: 700;
  color: var(--text);
  border-bottom: 2px solid var(--slate-100);
  white-space: nowrap;
}

.compare-table th:first-child {
  text-align: left;
}

.compare-table td {
  padding: 14px 20px;
  text-align: center;
  border-bottom: 1px solid var(--off-white);
  font-weight: 500;
}

.compare-table td.row-label {
  text-align: left;
  font-weight: 600;
  color: var(--slate-700);
  background: var(--off-white);
  white-space: nowrap;
}

.compare-table tr.sub-row td {
  color: var(--slate-500);
  font-size: 0.9rem;
}

.compare-table tr.sub-row td.row-label {
  padding-left: 36px;
  font-weight: 500;
}

.compare-table tr:last-child td {
  border-bottom: none;
}

.compare-table td.cell-best {
  background: #ecfdf5;
  color: #065f46;
  font-weight: 700;
}

.compare-table td.cell-worst {
  background: #fef2f2;
  color: #991b1b;
  font-weight: 700;
}

/* =========================
   GRANT DETAILS
========================= */

.compare-grant-details {
  background: var(--white);
  border: 1px solid var(--slate-100);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
}

.compare-grant-details h3 {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate-500);
  margin-bottom: 16px;
}

.compare-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.compare-detail-col h4 {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.detail-grant {
  background: #ecfdf5;
  border-left: 4px solid #10b981;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.detail-grant.none {
  background: var(--off-white);
  border-left-color: var(--slate-300);
  color: #94a3b8;
}

/* =========================
   PER-SCHOOL CARDS
========================= */

.compare-school-details {
  margin-bottom: 32px;
}

.compare-school-details > h3 {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate-500);
  margin-bottom: 20px;
}

.school-detail-card {
  background: var(--white);
  border: 1px solid var(--slate-100);
  border-radius: 20px;
  padding: 28px;
  margin-bottom: 24px;
}

.school-detail-name {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--off-white);
}

.school-detail-warning {
  background: #fff7ed;
  color: #9a3412;
  border-left: 5px solid #f97316;
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-weight: 500;
  line-height: 1.6;
}

.school-detail-section {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--off-white);
}

.school-detail-section h4 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slate-500);
  margin-bottom: 10px;
}

.school-detail-summary p {
  line-height: 1.7;
  color: var(--slate-700);
}

.school-detail-checks {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 14px;
  padding: 18px 20px;
  margin-top: 20px;
}

.school-detail-checks h4 { color: #92400e; }
.school-detail-checks ul { padding-left: 20px; }
.school-detail-checks li { line-height: 1.6; margin-bottom: 10px; color: var(--text); }

.school-detail-redflags {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 14px;
  padding: 18px 20px;
  margin-top: 20px;
}

.school-detail-redflags h4 { color: #b91c1c; }
.school-detail-redflags ul { padding-left: 20px; }
.school-detail-redflags li { line-height: 1.6; margin-bottom: 8px; color: var(--text); }

/* Accordion for per-school compare cards */
.school-detail-checks.accordion h4,
.school-detail-redflags.accordion h4 {
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
}

.school-detail-checks.accordion ul,
.school-detail-redflags.accordion ul {
  display: none;
  margin-top: 14px;
}

.school-detail-checks.accordion.open ul,
.school-detail-redflags.accordion.open ul {
  display: block;
}

.school-detail-checks.accordion.open .accordion-chevron,
.school-detail-redflags.accordion.open .accordion-chevron {
  transform: rotate(180deg);
}

.school-detail-nextsteps ol { padding-left: 20px; }
.school-detail-nextsteps li { line-height: 1.6; margin-bottom: 12px; color: var(--text); }

.school-detail-resources {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 14px;
  padding: 18px 20px;
  margin-top: 20px;
}

.school-detail-resources h4 { color: #0c4a6e; }
.school-detail-resources ul { list-style: none; padding-left: 0; display: flex; flex-direction: column; gap: 8px; }
.school-detail-resources a { color: var(--accent); text-decoration: underline; line-height: 1.5; }
.school-detail-resources a:hover { color: var(--navy); }

/* =========================
   CONFIDENCE METER
========================= */

#confidenceMeter,
#compareConfidenceMeter {
  border: 1px solid var(--slate-100);
  border-radius: 16px;
  padding: 20px 24px;
  margin: 16px 0 32px;
  background: var(--white);
}

.conf-meter-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}

.conf-meter-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #94a3b8;
}

.conf-meter-score {
  font-size: 0.88rem;
  font-weight: 700;
}

.conf-bar-outer {
  margin-bottom: 4px;
}

.conf-bar {
  height: 18px;
  border-radius: 9px;
  background: linear-gradient(to right, #ef4444 0%, #f59e0b 50%, #22c55e 100%);
}

.conf-arrow-row {
  position: relative;
  height: 18px;
}

.conf-arrow {
  position: absolute;
  transform: translateX(-50%);
  font-size: 18px;
  color: var(--text);
  line-height: 1.2;
  top: 0;
}

.conf-region-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--slate-500);
  padding: 0 2px;
}

/* =========================
   MOBILE
========================= */

@media (max-width: 768px) {
  .home-hero {
    padding: 56px 20px 64px;
    gap: 40px;
  }

  .home-headline {
    font-size: 2.4rem;
  }

  .home-hero-visual {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero-card {
    min-width: 140px;
    flex: 1;
  }

  .how-steps {
    grid-template-columns: 1fr;
  }

  .about-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .card {
    padding: 24px;
  }

  .tabs {
    flex-direction: column;
  }

  .net-price-hero {
    padding: 28px 24px;
  }

  #netPrice {
    font-size: 2.8rem;
  }

  .aid-grid {
    grid-template-columns: 1fr;
  }

  #mode-switcher {
    flex-direction: column;
  }

  .compare-detail-grid {
    grid-template-columns: 1fr;
  }

  .nav-logo {
    font-size: 1rem;
  }
}

/* =========================
   FOOTER
========================= */

.site-footer {
    border-top: 1px solid #e2e8f0;
    margin-top: 64px;
    padding: 32px 20px;
    background: var(--navy);
}

.footer-inner {
    max-width: 90vw;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-logo {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--off-white);
    letter-spacing: -0.02em;
}

.footer-copy {
    color: var(--slate-100);
    font-size: 0.85rem;
}

.footer-privacy {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--slate-300);
    font-size: 0.85rem;
    line-height: 1.6;
    max-width: 45vw;
}

.footer-shield {
    width: 16px;
    height: 16px;
    color: #10b981;
    flex-shrink: 0;
    margin-top: 2px;
}