:root {
  --bg: #0b1220;
  --surface: #121a2b;
  --card: #182236;
  --text: #e8eef9;
  --muted: #9fb0cc;
  --accent: #5b8cff;
  --accent-2: #3dd6c6;
  --warn: #f5b942;
  --danger: #ff6b6b;
  --radius: 12px;
  --font: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  background: linear-gradient(160deg, #0b1220 0%, #101c34 45%, #0d1528 100%);
  color: var(--text);
  min-height: 100vh;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11,18,32,0.85);
}

.logo { font-weight: 700; font-size: 1.15rem; letter-spacing: 0.02em; }
.logo span { color: var(--accent-2); }

nav a { margin-left: 1rem; color: var(--muted); font-size: 0.95rem; }
nav a.active { color: var(--text); }

h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.1; margin: 0 0 1rem; }
.lead { color: var(--muted); font-size: 1.1rem; line-height: 1.6; }

.btn {
  display: inline-block;
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: white;
}
.btn.secondary { background: transparent; border: 1px solid rgba(255,255,255,0.2); color: var(--text); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.panel {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.grid-3, .grid-4 {
  display: grid;
  gap: 1rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem 3rem;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card h3 { margin-top: 0; }
.muted { color: var(--muted); }

#app-view { display: none; max-width: 1100px; margin: 0 auto; padding: 1.5rem; }
#app-view.visible { display: block; }

.tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tab {
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  color: var(--muted);
}
.tab.active { color: var(--text); border-color: var(--accent); }

form label { display: block; margin: 0.6rem 0 0.25rem; font-size: 0.9rem; color: var(--muted); }
input, select, textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: var(--surface);
  color: var(--text);
}
textarea { min-height: 140px; font-family: inherit; }

.match-list { display: grid; gap: 0.75rem; }
.match-item {
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.06);
}
.score { color: var(--accent-2); font-weight: 700; }

.pricing .price { font-size: 1.8rem; font-weight: 700; }
.hidden { display: none !important; }

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.hidden { display: none !important; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(4, 8, 18, 0.78);
  cursor: pointer;
}
.modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
}
body.modal-open { overflow: hidden; }
.error { color: var(--danger); font-size: 0.9rem; }
.success { color: var(--accent-2); font-size: 0.9rem; }

footer {
  text-align: center;
  color: var(--muted);
  padding: 2rem 1rem 3rem;
  font-size: 0.9rem;
}

.nav-toggle { display: none; margin-left: 1rem; }
@media (max-width: 768px) {
  .nav-toggle { display: inline-block; }
  header nav { display: none; flex-direction: column; gap: 0.5rem; padding: 1rem 0; }
  header nav.open { display: flex; }
  header { flex-wrap: wrap; }
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 300;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
}
.toast.error { border-color: var(--danger); color: var(--danger); }
.warn-banner { border-color: var(--warn); color: var(--warn); }

.modal-wide { max-width: 640px; }
.onboarding-wizard { margin-bottom: 1rem; }
.wizard-steps { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.wizard-step {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.85rem;
  color: var(--muted);
}
.wizard-step.active { color: var(--accent-2); border: 1px solid var(--accent-2); }
.tab:focus-visible, .btn:focus-visible, .tab.active { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* Scholarship hub / SEO landing pages */
main .panel { margin-bottom: 1.25rem; }
.breadcrumb { margin: 0 0 1rem; font-size: 0.85rem; }
.breadcrumb a { color: var(--muted); }
.hub-stats { display: flex; flex-wrap: wrap; gap: 1.5rem; margin: 1rem 0 1.25rem; }
.hub-stats .stat { display: flex; flex-direction: column; }
.hub-stats .stat-num { font-size: 1.5rem; font-weight: 700; color: var(--accent-2); }
.hub-stats .stat-label { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.hub-intro p { line-height: 1.6; margin: 0.75rem 0; }
.deadline-list { list-style: none; padding: 0; display: grid; gap: 0.5rem; }
.deadline-list li { padding: 0.5rem 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.faq-item { padding: 0.6rem 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.faq-item summary { cursor: pointer; font-weight: 600; }
.faq-item p { margin: 0.5rem 0 0; color: var(--muted); line-height: 1.55; }
.related-hubs { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; }
.related-hubs li a {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 0.9rem;
}

/* ============ Landing page (marketing) ============ */
.landing-shell {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.25rem 2.5rem;
}

@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }

.hero {
  max-width: none;
  margin: 0;
  padding: 1rem 0 0.25rem;
  display: grid;
  grid-template-columns: 1.15fr minmax(0, 300px);
  gap: 1.25rem 1.5rem;
  align-items: center;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding-top: 0.75rem;
  }
  .hero-visual { max-width: 100%; }
}

.hero-copy { animation: fadeUp 0.5s ease both; }
.hero-title {
  font-size: clamp(1.65rem, 2.8vw, 2.2rem);
  line-height: 1.12;
  margin: 0 0 0.65rem;
}
.hero-lead {
  font-size: 0.98rem;
  line-height: 1.55;
  margin: 0;
  max-width: 36rem;
}
.grad-text {
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent));
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: shimmer 4s linear infinite;
}
.badge-beta {
  display: inline-block; margin-bottom: 0.65rem;
  padding: 0.25rem 0.65rem; border-radius: 999px; font-size: 0.72rem; font-weight: 600;
  color: var(--accent-2); background: rgba(61,214,198,0.12);
  border: 1px solid rgba(61,214,198,0.35);
}
.btn-lg { padding: 0.7rem 1.35rem; font-size: 0.95rem; }
.hero-cta { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 1rem 0 0.5rem; }
.hero-checks {
  display: flex; gap: 0.85rem; flex-wrap: wrap;
  list-style: none; padding: 0; margin: 0.5rem 0 0; font-size: 0.82rem;
}
.hero-checks li::before { content: "✓ "; color: var(--accent-2); font-weight: 700; }
.hero-note { font-size: 0.85rem; color: var(--accent-2); margin-top: 0.5rem; }

.hero-visual {
  max-width: 300px;
  margin-left: auto;
  margin-right: 0;
}
.hero-img-wrap {
  position: relative;
  line-height: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 8px 28px rgba(0,0,0,0.3);
}
.hero-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  object-position: center 25%;
  display: block;
  animation: fadeUp 0.7s ease both;
}
@media (max-width: 900px) {
  .hero-visual { margin: 0 auto; max-width: 280px; }
  .hero-img { height: 150px; }
}
.hero-fit-chip {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.55rem;
  background: rgba(11, 18, 32, 0.9);
  border: 1px solid rgba(61, 214, 198, 0.35);
  border-radius: 999px;
  font-size: 0.7rem;
  backdrop-filter: blur(8px);
  max-width: calc(100% - 16px);
}
.hero-fit-pct {
  font-weight: 700;
  color: var(--accent-2);
  font-size: 0.78rem;
  flex-shrink: 0;
}
.hero-fit-detail {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-band {
  margin: 0.85rem 0 1rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
}
@media (max-width: 760px) { .stat-band { grid-template-columns: repeat(2, 1fr); } }
.stat-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  text-align: center;
}
.stat-value { display: block; font-size: 1.25rem; font-weight: 700; color: var(--accent-2); line-height: 1.2; }
.stat-label { font-size: 0.72rem; color: var(--muted); line-height: 1.3; }

.landing-section { margin: 1.5rem 0; padding: 0; }
.landing-block {
  margin: 1.25rem 0;
  padding: 1.15rem 1.25rem;
}
.landing-block h2 { margin-top: 0; font-size: 1.35rem; }
.landing-meta {
  text-align: center;
  font-size: 0.85rem;
  margin: 0.5rem 0 1rem;
}
.section-head { text-align: center; margin-bottom: 1rem; }
.section-head h2 { margin: 0 0 0.3rem; font-size: 1.35rem; }
.section-head p { margin: 0; font-size: 0.92rem; }

.feature-grid,
.pricing-grid {
  display: grid;
  gap: 0.75rem;
}
.feature-grid { grid-template-columns: repeat(3, 1fr); }
.pricing-grid { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .feature-grid, .pricing-grid { grid-template-columns: 1fr; }
}
.feature-grid .panel,
.pricing-grid .panel { padding: 1rem; }
.feature-grid h3,
.pricing-grid h3 { margin: 0 0 0.35rem; font-size: 1rem; }
.feature-grid p,
.pricing-grid p { font-size: 0.88rem; margin: 0; }
.pricing-grid .price { font-size: 1.5rem; margin: 0.25rem 0; }

.landing-newsletter form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.landing-newsletter input[type=email] {
  flex: 1 1 200px;
  max-width: 320px;
}

.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 760px) { .demo-grid { grid-template-columns: 1fr; } }
.demo-controls label { margin-top: 0.65rem; font-weight: 600; color: var(--text); font-size: 0.9rem; }
.demo-controls output { color: var(--accent-2); font-weight: 700; }
.demo-controls input[type=range] { accent-color: var(--accent); }
.demo-result { display: flex; flex-direction: column; justify-content: center; }
.fit-meter { position: relative; display: flex; align-items: center; gap: 0.75rem; }
.fit-bar {
  height: 18px; border-radius: 999px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.5s cubic-bezier(0.22,1,0.36,1); flex: 1;
}
.fit-num { font-size: 1.65rem; font-weight: 700; color: var(--accent-2); min-width: 2.5ch; text-align: right; }
.demo-bars { margin-top: 0.75rem; display: grid; gap: 0.45rem; }
.demo-bar-row { display: grid; grid-template-columns: 100px 1fr; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--muted); }
.demo-bar-track { background: rgba(255,255,255,0.08); border-radius: 999px; height: 8px; overflow: hidden; }
.demo-bar-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.5s ease; }

.ai-card { max-width: 640px; margin: 0 auto; padding: 1rem; }
.ai-prompt { color: var(--muted); margin-bottom: 0.65rem; font-size: 0.9rem; }
.ai-chip { display: inline-block; background: rgba(91,140,255,0.15); color: var(--accent); border-radius: 6px; padding: 0.1rem 0.45rem; font-size: 0.72rem; font-weight: 700; margin-right: 0.35rem; }
.ai-output {
  white-space: pre-wrap; font-family: var(--font); line-height: 1.55; font-size: 0.92rem;
  background: var(--surface); border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius); padding: 0.85rem; min-height: 5.5rem; margin: 0;
  border-left: 3px solid var(--accent-2);
}
.ai-output::after { content: "▋"; color: var(--accent-2); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.ai-foot { margin-top: 0.65rem; font-size: 0.85rem; }

.beta-banner { background: rgba(61,214,198,0.1); border: 1px solid rgba(61,214,198,0.3); color: var(--accent-2); }
.beta-note { color: var(--accent-2); }

#faq details { padding: 0.45rem 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
#faq details summary { cursor: pointer; font-size: 0.95rem; }
#faq details p { margin: 0.4rem 0 0; font-size: 0.9rem; }

@media (prefers-reduced-motion: reduce) {
  .grad-text, .hero-copy, .hero-img, .ai-output::after { animation: none; }
}
