:root {
  --bg: #fafbfc;
  --ink: #1a1a2e;
  --muted: #6b7280;
  --accent: #2d54d4;
  --accent-light: #eef1ff;
  --accent-ink: #ffffff;
  --card: #ffffff;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---- Typography ---- */
h1 { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }
h3 { font-size: 1.15rem; font-weight: 600; line-height: 1.3; }
p { margin: 0 0 1rem; color: var(--muted); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Layout ---- */
.container { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
.section { padding: 64px 0; }
.section-sm { padding: 40px 0; }

/* ---- Header ---- */
.site-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 24px; background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.site-header .logo { font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.site-header nav { display: flex; gap: 24px; }
.site-header nav a { color: var(--muted); font-size: 0.9rem; font-weight: 500; text-decoration: none; }
.site-header nav a:hover { color: var(--ink); text-decoration: none; }

/* ---- Hero ---- */
.hero { text-align: center; padding: 80px 24px 48px; }
.hero h1 { max-width: 720px; margin: 0 auto 12px; }
.hero .subtitle { font-size: 1.2rem; color: var(--muted); max-width: 520px; margin: 0 auto 32px; }

/* ---- Search ---- */
.search-wrap { position: relative; max-width: 520px; margin: 0 auto; }
.search-wrap input {
  width: 100%; padding: 16px 20px; font-size: 1.05rem;
  border: 2px solid var(--border); border-radius: var(--radius);
  background: var(--card); transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.search-wrap input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(45,84,212,0.1); }
.search-results {
  list-style: none; margin: 6px 0 0; padding: 6px 0;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  position: absolute; left: 0; right: 0; max-height: 360px; overflow-y: auto;
  z-index: 20; box-shadow: var(--shadow-hover);
}
.search-results a { display: block; padding: 12px 16px; color: var(--ink); text-decoration: none; font-weight: 500; }
.search-results a:hover { background: var(--accent-light); text-decoration: none; }

/* ---- Cloud section ---- */
.cloud-section { margin: 0; padding: 0 24px; }
#school-cloud { width: 100%; height: 55vh; min-height: 420px; max-height: 650px; display: block; }

/* ---- School grid ---- */
.school-grid-section { padding: 24px 24px 64px; }
.school-grid-section h2 { text-align: center; margin-bottom: 8px; }
.school-grid-section .grid-intro { text-align: center; color: var(--muted); margin-bottom: 32px; }
.school-card-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  max-width: 1100px; margin: 0 auto;
}
.school-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  cursor: pointer; transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  text-decoration: none; color: var(--ink);
}
.school-card:hover {
  transform: translateY(-2px); box-shadow: var(--shadow-hover);
  border-color: var(--accent); text-decoration: none;
}
.school-card-logo {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 10px;
  overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: white; font-weight: 700; font-size: 0.85rem;
}
.school-card-logo img { width: 100%; height: 100%; object-fit: contain; }
.school-card-title { font-weight: 600; font-size: 0.95rem; line-height: 1.3; }
.school-card-location { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }

/* ---- School page ---- */
.school-page { max-width: 760px; margin: 0 auto; padding: 48px 24px; }
.school-page .school-hero { text-align: center; margin-bottom: 48px; }
.school-page .school-hero .school-badge {
  display: inline-block; padding: 4px 14px; border-radius: 999px;
  background: var(--accent-light); color: var(--accent);
  font-size: 0.82rem; font-weight: 600; margin-bottom: 12px;
}
.school-page .school-hero h1 { margin-bottom: 8px; }
.school-page .school-hero .location { color: var(--muted); font-size: 1rem; }

.school-overview {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; margin-bottom: 40px;
  line-height: 1.7;
}
.school-overview img { max-width: 100%; border-radius: 8px; margin: 16px 0; }
.school-overview h2, .school-overview h3 { margin: 20px 0 8px; }
.school-overview a { color: var(--accent); }

.prompts-section { margin-bottom: 48px; }
.prompts-section h2 { margin-bottom: 24px; }
.prompt-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin-bottom: 16px;
  transition: box-shadow 0.15s;
}
.prompt-card:hover { box-shadow: var(--shadow); }
.prompt-card .prompt-head { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600;
}
.badge.required { background: #fef3c7; color: #92400e; }
.badge.optional { background: #f3f4f6; color: var(--muted); }
.badge.tag { background: var(--accent-light); color: var(--accent); }
.word-limit { font-size: 0.8rem; color: var(--muted); align-self: center; }

.prompt-card .prompt-text {
  font-size: 1.05rem; font-weight: 500; margin-bottom: 12px; line-height: 1.5;
}
.prompt-toggle {
  background: none; border: none; color: var(--accent);
  font-size: 0.88rem; font-weight: 600; cursor: pointer; padding: 0;
  display: flex; align-items: center; gap: 4px;
}
.prompt-toggle:hover { text-decoration: underline; }
.prompt-toggle .arrow { transition: transform 0.2s; display: inline-block; }
.prompt-card.expanded .prompt-toggle .arrow { transform: rotate(180deg); }

.prompt-analysis { display: none; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.prompt-card.expanded .prompt-analysis { display: block; }
.prompt-analysis .analysis-block { margin-bottom: 18px; }
.prompt-analysis .analysis-block h4 { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); margin-bottom: 6px; }
.prompt-analysis .analysis-block .rich-text { line-height: 1.7; color: var(--ink); }

/* CTA */
.cta-section {
  background: linear-gradient(135deg, var(--accent), #1f3aa8);
  color: white; text-align: center; padding: 48px 24px;
  border-radius: var(--radius);
}
.cta-section h2 { color: white; margin-bottom: 8px; }
.cta-section p { color: rgba(255,255,255,0.85); margin-bottom: 20px; }
.btn-primary {
  display: inline-block; background: white; color: var(--accent);
  padding: 14px 32px; border-radius: 8px; font-weight: 700;
  text-decoration: none; font-size: 1rem;
}
.btn-primary:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

/* ---- Advice wizard ---- */
.advice-wizard { max-width: 600px; margin: 0 auto; padding: 48px 24px; }
.advice-wizard h1 { text-align: center; margin-bottom: 8px; }
.advice-wizard .wizard-intro { text-align: center; color: var(--muted); margin-bottom: 32px; }

.wizard-progress { display: flex; justify-content: center; gap: 8px; margin-bottom: 40px; }
.wizard-step-indicator {
  width: 32px; height: 4px; border-radius: 2px; background: var(--border);
  transition: background 0.3s;
}
.wizard-step-indicator.done { background: var(--accent); }
.wizard-step-indicator.active { background: var(--accent); }

.wizard-step { display: none; animation: fadeIn 0.3s ease; }
.wizard-step.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.wizard-step h2 { margin-bottom: 8px; }
.wizard-step .step-hint { color: var(--muted); font-size: 0.9rem; margin-bottom: 24px; }

.school-picker { width: 100%; padding: 14px 16px; border: 2px solid var(--border); border-radius: var(--radius); font: inherit; font-size: 1rem; background: var(--card); margin-bottom: 24px; }
.school-picker:focus { border-color: var(--accent); outline: none; }

.wizard-step textarea, .wizard-step input[type="email"] {
  width: 100%; padding: 14px 16px; border: 2px solid var(--border);
  border-radius: var(--radius); font: inherit; font-size: 1rem;
  background: var(--card); resize: vertical; margin-bottom: 16px;
}
.wizard-step textarea:focus, .wizard-step input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(45,84,212,0.1); }

.wizard-step .char-count { text-align: right; font-size: 0.8rem; color: var(--muted); margin-top: -12px; margin-bottom: 12px; }

.wizard-buttons { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
.btn-secondary {
  padding: 12px 24px; border: 2px solid var(--border); border-radius: 8px;
  background: var(--card); color: var(--ink); font-weight: 600; cursor: pointer;
  font-size: 0.95rem;
}
.btn-secondary:hover { border-color: var(--accent); }
.btn-accent {
  padding: 12px 28px; border: none; border-radius: 8px;
  background: var(--accent); color: white; font-weight: 600; cursor: pointer;
  font-size: 0.95rem;
}
.btn-accent:hover { background: #1f3aa8; }
.btn-accent:disabled { opacity: 0.5; cursor: not-allowed; }

.wizard-step .checkbox-label {
  display: flex; align-items: center; gap: 8px; font-size: 0.9rem;
  color: var(--muted); margin-bottom: 12px; cursor: pointer;
}
.wizard-step .checkbox-label input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }

.result-msg { padding: 16px; border-radius: var(--radius); margin-top: 24px; text-align: center; font-weight: 500; }
.result-msg.success { background: #ecfdf5; color: #047857; }
.result-msg.error { background: #fef2f2; color: #991b1b; }

/* ---- Parents page ---- */
.info-page { max-width: 700px; margin: 0 auto; padding: 48px 24px; }
.info-page h1 { margin-bottom: 12px; }
.info-page .lede { font-size: 1.15rem; color: var(--muted); margin-bottom: 32px; line-height: 1.7; }
.info-page h2 { margin: 40px 0 12px; }
.info-page p { line-height: 1.7; margin-bottom: 16px; }
.info-page ul { margin: 0 0 24px 24px; color: var(--muted); line-height: 1.7; }
.info-page ul li { margin-bottom: 8px; }
.insight-box {
  background: var(--accent-light); border-radius: var(--radius);
  padding: 24px; margin: 24px 0;
}
.insight-box h3 { margin-bottom: 8px; color: var(--accent); }
.insight-box p { color: var(--ink); }

/* ---- Footer ---- */
.site-footer {
  text-align: center; padding: 32px 24px;
  color: var(--muted); font-size: 0.85rem;
  border-top: 1px solid var(--border); margin-top: 64px;
}
.site-footer a { color: var(--muted); }

/* ---- Responsive ---- */
@media (max-width: 720px) {
  .site-header nav { gap: 16px; }
  .site-header nav a { font-size: 0.82rem; }
  .hero { padding: 48px 16px 32px; }
  .school-card-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .school-card { padding: 12px; gap: 10px; }
  .school-card-logo { width: 36px; height: 36px; }
  .school-card-title { font-size: 0.85rem; }
  .school-page { padding: 32px 16px; }
  .prompt-card { padding: 16px; }
  .section { padding: 40px 0; }
}
