/* Brand tokens, taken from teachersoftomorrow.org */
:root {
  --navy: #003a71;
  --navy-deep: #00224a;
  --sky: #12a7e6;
  --sky-dark: #0b8cc4;
  --red: #b62a39;
  --mist: #a9cbdf;
  --mist-light: #eaf3f9;
  --ink: #333;
  --muted: #6b7a89;
  --line: #d9e3ec;
  --bg: #f4f8fb;
  --card: #fff;
  --ok: #1b8a5a;
  --serif: "EB Garamond", "AGaramondPro", Garamond, Baskerville, serif;
  --sans: "Nunito Sans", "Avenir Next", Avenir, Futura, system-ui, sans-serif;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(0, 34, 74, .08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--bg); font-size: 17px; line-height: 1.55; display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; }
a { color: var(--navy); }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0 0 .5em; color: var(--navy); }
h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.3rem; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 780px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
[hidden] { display: none !important; }

/* Header */
.site-header { background: var(--navy-deep); color: #fff; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 78px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 18px; text-decoration: none; color: #fff; }
.partner-wordmark { font-family: var(--serif); font-size: 1.3rem; letter-spacing: .05em; text-transform: uppercase; line-height: 1.02; }
.partner-wordmark em { font-style: italic; text-transform: none; font-size: .85em; letter-spacing: 0; }
.brand-x { width: 1px; height: 40px; background: rgba(255, 255, 255, .35); }
.mc-logo { height: 44px; width: auto; display: block; }

/* Hero (ToT's deep blue sweep) */
.hero { color: #fff; padding: 56px 0 72px;
  background: radial-gradient(1200px 500px at 85% 20%, rgba(18, 167, 230, .55), transparent 60%),
              linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 45%, #0b62a8 100%); }
.hero h1 { color: #fff; }
.hero-short { padding: 56px 0 64px; }
.hero-inner { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-weight: 700; font-size: .8rem; color: var(--sky); margin: 0 0 12px; }
.hero .eyebrow { color: var(--mist); }
.lede { font-size: 1.15rem; opacity: .95; max-width: 40ch; }
.hero-short .lede { margin: 0 auto; max-width: 52ch; }
.hero strong { color: #fff; border-bottom: 2px solid var(--sky); }

/* Cards & forms */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; margin: 0 0 20px; color: var(--ink); }
.start-card h2 { margin-bottom: 18px; }
.field { display: block; margin: 0 0 16px; border: 0; padding: 0; }
.field > span, .field legend { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; color: var(--navy); }
.req { color: var(--red); font-weight: 700; }
input[type=email], input[type=text], input[type=password], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: 1rem; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 3px rgba(18, 167, 230, .2); }
textarea { resize: vertical; }
.err { color: var(--red); font-weight: 600; display: block; margin-top: 6px; }
.fine { font-size: .8rem; color: var(--muted); margin: 12px 0 0; text-align: center; }

.role-option { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; margin-bottom: 8px; cursor: pointer; }
.role-option:has(input:checked) { border-color: var(--sky); background: var(--mist-light); }
.role-option input { margin-top: 5px; accent-color: var(--navy); }

/* Buttons: ToT's uppercase pills */
.btn { display: inline-block; font-family: var(--sans); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: .85rem;
  padding: 13px 30px; border-radius: 999px; border: 2px solid transparent; cursor: pointer; text-decoration: none; text-align: center; transition: background .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--sky); color: #fff; }
.btn-primary:hover { background: var(--sky-dark); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-ghost:hover { background: var(--mist-light); }
.btn-light { background: #fff; color: var(--navy); }
.btn-danger { background: #fff; color: var(--red); border-color: var(--red); }
.btn-small { padding: 8px 18px; font-size: .75rem; }
.btn-block { width: 100%; }
.linklike { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: .85rem; }

/* Survey */
.survey-head { background: linear-gradient(135deg, var(--navy-deep), var(--navy)); padding: 28px 0 22px; margin-bottom: 28px; }
.survey-head .eyebrow { color: var(--mist); }
.progress { height: 6px; background: rgba(255, 255, 255, .18); border-radius: 99px; overflow: hidden; display: none; }
.progress-bar { height: 100%; width: 0; background: var(--sky); transition: width .3s; }
.progress-label { color: #fff; font-size: .85rem; margin: 8px 0 0; opacity: .85; }
body.js .progress { display: block; }
.step-num { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 700; color: var(--red); margin: 0 0 6px; }
.question { margin: 22px 0; }
.question fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.q-text { display: block; font-size: 1.08rem; margin: 0 0 14px; padding: 0; }
.question .err { display: none; }
.question.has-error > fieldset > .err { display: block; }
.question.has-error > fieldset > .yesno label span { border-color: var(--red); }
.yesno { display: flex; gap: 12px; }
.yesno label { flex: 1; max-width: 180px; }
.yesno input { position: absolute; opacity: 0; pointer-events: none; }
.yesno span { display: block; text-align: center; padding: 13px 0; border: 2px solid var(--line); border-radius: 999px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--navy); cursor: pointer; transition: all .15s; }
.yesno span:hover { border-color: var(--sky); }
.yesno input:focus-visible + span { box-shadow: 0 0 0 3px rgba(18, 167, 230, .35); }
.yesno input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.followup { margin: 18px 0 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--sky); }
.step-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.alert { background: #fbecee; color: var(--red); border-radius: 10px; padding: 12px 16px; margin: 0 0 18px; font-weight: 600; }
.alert-info { background: var(--mist-light); color: var(--navy); }
.restart { text-align: center; margin: 4px 0 40px; }
.contact-card { text-align: center; }
.after-hero { margin-top: -36px; position: relative; }
.contacts { list-style: none; padding: 0; margin: 0; font-size: 1.05rem; }
.contacts li { margin: 6px 0; }


/* Admin */
body.admin { font-size: 15px; }
.admin-wrap { padding-top: 28px; padding-bottom: 40px; }
.admin-nav { display: flex; align-items: center; gap: 20px; }
.admin-nav a { color: #fff; text-decoration: none; font-weight: 600; font-size: .9rem; }
.admin-nav a:hover { color: var(--sky); }
.login-card { max-width: 420px; margin: 40px auto; }
.admin-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-top h1 { font-size: 2.2rem; margin: 0; }
.stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stats div { background: #fff; border-radius: 10px; box-shadow: var(--shadow); padding: 10px 16px; min-width: 110px; }
.stats b { display: block; font-size: 1.5rem; color: var(--navy); font-family: var(--serif); }
.stats span { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.summary summary { cursor: pointer; list-style: none; }
.summary summary h2 { display: inline; }
.summary summary small { font-family: var(--sans); font-size: .8rem; color: var(--muted); }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 16px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.num { text-align: right; width: 48px; }
.bar-col { width: 130px; white-space: nowrap; font-size: .85rem; }
.mini-bar { display: inline-block; width: 70px; height: 8px; background: var(--mist-light); border-radius: 9px; overflow: hidden; vertical-align: middle; }
.mini-bar i { display: block; height: 100%; background: var(--sky); }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 14px; }
.filters input[type=search] { max-width: 280px; }
.filters select { width: auto; }
.spacer { flex: 1; }
.table-card { padding: 4px 8px; overflow-x: auto; }
.responses tbody tr { cursor: pointer; }
.responses tbody tr:hover { background: var(--mist-light); }
.right { text-align: right; }
.pill { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 3px 10px; border-radius: 99px; background: #eef1f4; color: var(--muted); }
.pill-ok { background: #e3f4ec; color: var(--ok); }
.pill-no { background: #fbecee; color: var(--red); }
.meta { display: grid; grid-template-columns: 120px 1fr; gap: 6px 16px; margin: 0; }
.meta dt { color: var(--muted); font-weight: 600; }
.meta dd { margin: 0; }
.answers { padding-left: 20px; }
.answers li { margin-bottom: 18px; }
.answers .q-text { font-size: .98rem; margin-bottom: 6px; }
.answers li.unanswered .q-text { color: var(--muted); }
blockquote { margin: 0; padding: 10px 14px; background: var(--mist-light); border-radius: 8px; white-space: pre-wrap; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }

@media (max-width: 820px) {
  .hero { padding: 32px 0 40px; }
  .hero-inner, .summary-grid, .two-col { grid-template-columns: 1fr; gap: 24px; }
  .card { padding: 20px; }
  .partner-wordmark { font-size: 1.05rem; }
  .mc-logo { height: 28px; }
  .yesno label { max-width: none; }
  .admin-nav { gap: 12px; }
  .filters input[type=search] { max-width: none; }
}

/* Multiple-choice questions */
.choices { display: grid; gap: 8px; }
.choices input { position: absolute; opacity: 0; pointer-events: none; }
.choices span { display: block; padding: 12px 16px; border: 2px solid var(--line); border-radius: 10px; cursor: pointer; color: var(--navy); font-weight: 600; }
.choices span:hover { border-color: var(--sky); }
.choices input:focus-visible + span { box-shadow: 0 0 0 3px rgba(18, 167, 230, .35); }
.choices input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.question.has-error > fieldset > .choices span { border-color: var(--red); }
.question.has-error > label > .err { display: block; }
.question.has-error > label > textarea { border-color: var(--red); }

/* Survey list (more than one published) */
.survey-list { margin-top: -36px; position: relative; }
.survey-link { display: flex; justify-content: space-between; align-items: center; gap: 16px; text-decoration: none; }
.survey-link h2 { margin: 0; font-size: 1.4rem; }
.survey-link:hover { box-shadow: 0 8px 30px rgba(0, 34, 74, .16); }
.lede p { margin: 0 0 .6em; }

/* Admin: surveys */
.survey-row h2 { font-size: 1.5rem; margin: 6px 0 2px; }
.survey-row h2 a { text-decoration: none; }
.survey-row-main { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.survey-actions { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.status-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.two-col.tight { margin-top: 0; gap: 16px; }
.slug-input { display: flex; align-items: center; gap: 4px; }
.slug-input .muted { white-space: nowrap; font-size: .9rem; }
textarea.code { font-family: Consolas, "Courier New", monospace; font-size: .85rem; line-height: 1.45; tab-size: 2; }
.help summary { cursor: pointer; list-style: none; }
.help summary h2 { display: inline; font-size: 1.3rem; }
.help li { margin-bottom: 6px; }
code { background: var(--mist-light); padding: 1px 5px; border-radius: 4px; font-size: .85em; }
.summary-grid.single { grid-template-columns: 1fr; }
.tally-row { display: grid; grid-template-columns: minmax(40px, auto) 90px auto; gap: 8px; align-items: center; font-size: .85rem; }
.tally-label { font-weight: 600; }
.tally-row .mini-bar { width: 90px; }
.tally-n { color: var(--muted); white-space: nowrap; }

/* Copy link / QR code */
.qr-dialog { border: 0; border-radius: var(--radius); padding: 28px; max-width: 380px; width: calc(100% - 32px); text-align: center; box-shadow: 0 20px 60px rgba(0, 34, 74, .3); }
.qr-dialog::backdrop { background: rgba(0, 34, 74, .45); }
.qr-dialog h2 { margin-bottom: 14px; }
.qr-dialog img { display: block; margin: 0 auto 8px; width: 280px; height: 280px; max-width: 100%; }
.qr-dialog #qr-url { word-break: break-all; }
.qr-close { position: absolute; top: 12px; right: 16px; }
.qr-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 12px 0 4px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--navy-deep); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-weight: 600; font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 10; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Organization autocomplete */
.combo { position: relative; display: block; }
.combo-list { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 6px 0; list-style: none;
  background: #fff; border: 1.5px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); max-height: 300px; overflow-y: auto; }
.combo-list li { padding: 9px 14px; cursor: pointer; font-size: .95rem; }
.combo-list li:hover, .combo-list li.active { background: var(--mist-light); color: var(--navy); }

/* Thank-you page: named contacts and link cards */
.contacts li { margin: 14px 0; }
.contact-name { display: block; font-family: var(--serif); font-size: 1.25rem; color: var(--navy); line-height: 1.2; }
.contact-title { display: block; color: var(--muted); font-size: .9rem; margin-bottom: 2px; }
.link-card { text-align: center; }
.link-card .muted-lede p { color: var(--ink); margin: 0 0 6px; }
.link-list { list-style: none; padding: 0; margin: 16px auto 0; display: grid; gap: 10px; max-width: 460px; }
.link-list a { display: block; padding: 13px 18px; border: 2px solid var(--sky); border-radius: 999px; text-decoration: none; font-weight: 700;
  color: var(--navy); transition: background .15s, color .15s; }
.link-list a:hover { background: var(--sky); color: #fff; }

/* Admin preview switcher */
.preview-top { padding-top: 16px; }
.preview-bar { font-weight: 400; }
.preview-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: .9rem; }
.preview-links span { font-weight: 700; }
.preview-links a.current { font-weight: 700; text-decoration: none; border-bottom: 2px solid var(--sky); }
