/* St. Vincent Catholic School — online enrollment demo */
:root {
  /* St. Vincent brand (from the logo): navy + antique gold. Red is kept only for warnings. */
  --accent: #8b6f2e;
  --accent-dark: #6f5824;
  --accent-pale: #f6f0e1;
  --red: #b3122e;
  --red-dark: #8c0d23;
  --red-pale: #fbecee;
  --navy: #133f6e;
  --navy-soft: #2f5a8a;
  --cream: #fbf8f3;
  --paper: #ffffff;
  --ink: #1f2430;
  --muted: #667085;
  --line: #e4e0d8;
  --green: #1f7a4d;
  --green-pale: #e8f5ee;
  --amber: #a15c07;
  --amber-pale: #fdf3e2;
  --blue-pale: #eef2fa;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 20, 40, .05), 0 8px 24px rgba(20, 20, 40, .06);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); color: var(--navy); line-height: 1.15; margin: 0 0 .4em; }
h1, h2, h3, .stat .v, .tcard .v, .pay-amount { font-variant-numeric: lining-nums; }
h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 600; }
h2 { font-size: 1.8rem; font-weight: 600; }
h3 { font-size: 1.3rem; font-weight: 600; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- Top bar ---------- */
.demo-ribbon {
  background: var(--navy);
  color: #dfe5f3;
  font-size: .78rem;
  text-align: center;
  padding: 6px 16px;
  letter-spacing: .02em;
}
.demo-ribbon b { color: #fff; }
.demo-ribbon { display: flex; justify-content: center; align-items: center; gap: 6px 18px; flex-wrap: wrap; }
.demo-switch { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.demo-switch a { color: #dfe5f3; text-decoration: none; padding: 2px 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,.18); }
.demo-switch a:hover { background: rgba(255,255,255,.1); color: #fff; }
.demo-switch a.on { background: #fff; color: var(--navy); font-weight: 600; border-color: #fff; }
.topbar {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar-inner {
  max-width: 1120px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 20px; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand-logo { height: 48px; width: auto; display: block; }
.brand-tag {
  font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--navy-soft);
  border-left: 1px solid var(--line); padding-left: 12px; margin-left: 2px;
}
@media (max-width: 640px) { .brand-logo { height: 40px; } }
.brand-mark {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); color: #fff; display: grid; place-items: center;
  font-family: var(--serif); font-size: 1.5rem; font-weight: 700;
}
.brand-text strong { display: block; font-family: var(--serif); font-size: 1.35rem; color: var(--accent); line-height: 1; }
.brand-text span { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--navy-soft); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  text-decoration: none; color: var(--navy); font-size: .88rem; font-weight: 500;
  padding: 7px 12px; border-radius: 999px;
}
.nav a:hover { background: var(--blue-pale); }
.nav a.active { background: var(--navy); color: #fff; }
.nav a.staff { border: 1px solid #cfd5e3; margin-left: 8px; color: var(--navy-soft); }
.nav a.staff::before { content: "🔒 "; font-size: .8em; }

/* ---------- Layout ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 32px 20px 80px; }
.narrow { max-width: 820px; }
.page-head { margin-bottom: 24px; }
.eyebrow {
  display: inline-block; font-size: .74rem; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 6px;
}
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px;
}
.card + .card { margin-top: 20px; }

/* ---------- Hero (hub) ---------- */
.hero {
  background:
    radial-gradient(circle at 85% 20%, rgba(201, 170, 100, .35), transparent 45%),
    linear-gradient(135deg, var(--navy) 0%, #0f3359 60%, #0a2440 100%);
  color: #fff;
}
.hero-inner { max-width: 1120px; margin: 0 auto; padding: 64px 20px 72px; }
.hero h1 { color: #fff; max-width: 720px; }
.hero p { color: #d7ddeb; max-width: 620px; font-size: 1.08rem; }
.hero .eyebrow { color: #e3cf9a; }

.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: -40px; }
.flow-step {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 6px; transition: transform .15s, box-shadow .15s;
}
.flow-step:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(20, 20, 40, .12); }
.flow-num {
  width: 30px; height: 30px; border-radius: 50%; background: var(--accent-pale); color: var(--accent);
  display: grid; place-items: center; font-weight: 700; font-size: .9rem;
}
.flow-step h3 { margin: 6px 0 0; }
.flow-step p { margin: 0; color: var(--muted); font-size: .9rem; }
.flow-step .who { margin-top: auto; padding-top: 10px; font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--navy-soft); }
.flow-step.office { background: var(--navy); border-color: var(--navy); }
.flow-step.office h3, .flow-step.office p { color: #fff; }
.flow-step.office p { color: #c9d1e4; }
.flow-step.office .who { color: #e3cf9a; }
.flow-step.office .flow-num { background: rgba(255,255,255,.12); color: #fff; }

.wins { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 40px; }
.win { padding: 20px 22px; border-left: 3px solid var(--accent); background: var(--paper); border-radius: 0 var(--radius) var(--radius) 0; }
.win h3 { font-size: 1.15rem; }
.win p { margin: 0; color: var(--muted); font-size: .92rem; }

/* ---------- Wizard ---------- */
.stepper { display: flex; gap: 6px; margin-bottom: 24px; flex-wrap: wrap; }
.stepper button {
  flex: 1 1 0; min-width: 110px; border: 0; background: transparent; padding: 0; cursor: pointer;
  text-align: left; font: inherit; color: var(--muted);
}
.stepper .bar { display: block; height: 5px; border-radius: 3px; background: var(--line); margin-bottom: 8px; transition: background .2s; }
.stepper .lbl { font-size: .8rem; font-weight: 500; }
.stepper button.done .bar { background: var(--navy-soft); }
.stepper button.current .bar { background: var(--accent); }
.stepper button.current { color: var(--ink); }
.stepper button.current .lbl { font-weight: 600; }

.step { display: none; }
.step.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.step-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }

/* ---------- Form controls ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: .82rem; font-weight: 600; color: var(--navy); }
.field .hint { font-size: .78rem; color: var(--muted); }
.req::after { content: " *"; color: var(--red); }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=number], select, textarea {
  font: inherit; color: var(--ink); background: #fff;
  border: 1px solid #d5d0c6; border-radius: 10px; padding: 10px 12px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy-soft); box-shadow: 0 0 0 3px rgba(51, 69, 111, .15); }
input.prefilled, select.prefilled, textarea.prefilled { background: var(--blue-pale); border-color: #c9d4ea; }
.invalid { border-color: var(--red) !important; box-shadow: 0 0 0 3px rgba(179, 18, 46, .12) !important; }

.section-title {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin: 28px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.section-title:first-child { margin-top: 0; }
.section-title h3 { margin: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block; padding: 8px 14px; border: 1px solid #d5d0c6; border-radius: 999px;
  font-size: .88rem; cursor: pointer; background: #fff; transition: all .15s; user-select: none;
}
.chip span:hover { border-color: var(--navy-soft); }
.chip input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip input:focus-visible + span { box-shadow: 0 0 0 3px rgba(51, 69, 111, .3); }
.chip input:disabled + span { opacity: .35; cursor: not-allowed; }

.check {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer;
}
.check:has(input:checked) { border-color: var(--navy-soft); background: var(--blue-pale); }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--navy); flex-shrink: 0; }
.check + .check { margin-top: 10px; }

.yn { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.yn:last-child { border-bottom: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 .92rem var(--sans); padding: 11px 20px; border-radius: 999px; cursor: pointer;
  border: 1px solid transparent; text-decoration: none; transition: all .15s; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: #142040; }
.btn-ghost { background: transparent; color: var(--navy); border-color: #cfd5e3; }
.btn-ghost:hover { background: var(--blue-pale); }
.btn-light { background: #fff; color: var(--navy); }
.btn-sm { padding: 7px 14px; font-size: .82rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }

/* ---------- Repeating blocks ---------- */
.repeat {
  border: 1px solid var(--line); border-radius: 12px; padding: 20px; background: #fdfcfa; position: relative;
}
.repeat + .repeat { margin-top: 14px; }
.repeat-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.repeat-head strong { font-family: var(--serif); font-size: 1.2rem; color: var(--navy); }
.add-row {
  margin-top: 14px; width: 100%; border: 1.5px dashed #c9c3b6; background: transparent; border-radius: 12px;
  padding: 14px; font: 600 .9rem var(--sans); color: var(--navy); cursor: pointer;
}
.add-row:hover { border-color: var(--navy-soft); background: var(--blue-pale); }

/* ---------- Callouts ---------- */
.note {
  display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; font-size: .88rem;
  background: var(--blue-pale); color: var(--navy); margin-bottom: 18px;
}
.note.warn { background: var(--amber-pale); color: var(--amber); }
.note.ok { background: var(--green-pale); color: var(--green); }
.note.red { background: var(--red-pale); color: var(--red-dark); }
.note-icon { font-weight: 700; flex-shrink: 0; }
.age-msg { font-size: .8rem; margin-top: 6px; }
.age-msg.ok { color: var(--green); }
.age-msg.warn { color: var(--amber); }

/* ---------- Review / summary ---------- */
.review dl { display: grid; grid-template-columns: 200px 1fr; gap: 6px 16px; margin: 0 0 8px; font-size: .92rem; }
.review dt { color: var(--muted); }
.review dd { margin: 0; }
.review h4 { margin: 18px 0 8px; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }

.pay-box {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; background: #fff; margin-top: 18px;
}
.pay-amount { font-family: var(--serif); font-size: 2rem; color: var(--navy); font-weight: 600; }

.success { text-align: center; padding: 48px 24px; }
.success-icon {
  width: 64px; height: 64px; border-radius: 50%; background: var(--green-pale); color: var(--green);
  display: grid; place-items: center; margin: 0 auto 16px; font-size: 1.8rem;
}

/* ---------- Agreement ---------- */
.contract {
  max-height: 420px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px;
  padding: 24px 28px; background: #fffefb; font-family: Georgia, serif; font-size: .95rem; line-height: 1.65;
}
.contract h4 { font-family: var(--sans); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--navy); margin: 22px 0 8px; }
.contract ul { padding-left: 20px; }
.contract .shout { font-weight: 700; }
.merge { background: #fff4c7; padding: 0 4px; border-radius: 4px; font-family: var(--sans); font-size: .9em; font-weight: 600; }
.scroll-hint { font-size: .8rem; color: var(--muted); margin-top: 8px; }
.scroll-hint.done { color: var(--green); }

.tuition-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.tcard { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: #fff; }
.tcard .k { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.tcard .v { font-family: var(--serif); font-size: 1.6rem; color: var(--navy); font-weight: 600; }

.sig-wrap { border: 1px solid #d5d0c6; border-radius: 12px; background: #fff; position: relative; }
.sig-wrap canvas { width: 100%; height: 150px; display: block; touch-action: none; cursor: crosshair; }
.sig-line { position: absolute; left: 24px; right: 24px; bottom: 34px; border-bottom: 1px solid #ccc; pointer-events: none; }
.sig-x { position: absolute; left: 24px; bottom: 38px; color: #aaa; font-size: 1.2rem; pointer-events: none; }
.sig-tools { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
.audit { font-family: ui-monospace, Consolas, monospace; font-size: .78rem; background: #f6f5f1; border-radius: 10px; padding: 14px 16px; color: #444; text-align: left; }
.audit div { display: flex; gap: 12px; }
.audit span:first-child { color: #888; min-width: 120px; }

/* ---------- Admin ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat .k { font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.stat .v { font-family: var(--serif); font-size: 2.1rem; font-weight: 600; color: var(--navy); line-height: 1.1; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input[type=text] { max-width: 260px; }
.toolbar select { width: auto; }
.toolbar .spacer { flex: 1; }
.table-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fbfaf7; }
td { padding: 12px 16px; border-bottom: 1px solid #f0ede7; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #fbfaf7; }
tr.is-new td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.badge { display: inline-block; font-size: .74rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.b-applied { background: var(--amber-pale); color: var(--amber); }
.b-accepted { background: var(--blue-pale); color: var(--navy-soft); }
.b-enrolled { background: #efe9f7; color: #5b3a8a; }
.b-signed { background: var(--green-pale); color: var(--green); }
.dots { display: flex; gap: 4px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); display: inline-block; }
.dots i.on { background: var(--green); }
.flag { color: var(--red); font-weight: 600; font-size: .8rem; }

.drawer-bg { position: fixed; inset: 0; background: rgba(20, 25, 40, .4); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40; }
.drawer-bg.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: var(--paper);
  transform: translateX(100%); transition: transform .25s ease; z-index: 50; overflow-y: auto; padding: 28px;
  box-shadow: -10px 0 40px rgba(0,0,0,.15); visibility: hidden;
}
.drawer.open { transform: none; visibility: visible; }
.drawer-close { position: absolute; top: 16px; right: 16px; }
.drawer .review dl { grid-template-columns: 150px 1fr; }
.drawer-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 8px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--navy); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: .9rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); transition: all .25s; z-index: 100; pointer-events: none; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.footer { text-align: center; font-size: .8rem; color: var(--muted); padding: 24px 16px 40px; border-top: 1px solid var(--line); }
.footer-credit { display: inline-flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); text-decoration: none; }
.footer-credit img { height: 34px; width: auto; display: block; opacity: .9; }
.footer-credit:hover span { color: var(--navy); text-decoration: underline; }
.footer-credit:hover img { opacity: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .flow { grid-template-columns: repeat(2, 1fr); }
  .wins { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .tuition-cards { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .topbar-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
  .grid, .grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .flow { grid-template-columns: 1fr; margin-top: -30px; }
  .card { padding: 20px 16px; }
  .wrap { padding: 24px 16px 64px; }
  .review dl, .drawer .review dl { grid-template-columns: 1fr; gap: 0 0; }
  .review dd { margin-bottom: 8px; }
  .stepper button { min-width: 0; }
  .stepper .lbl { display: none; }
  .yn { flex-direction: column; align-items: flex-start; gap: 8px; }
  .step-actions .btn { flex: 1; }
}
@media print {
  .demo-ribbon, .topbar, .step-actions, .stepper, .btn { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 0; }
}
