/* Ishmael Academy survey. Brand: charcoal #141414, gold #C8B384, slate blue #738795,
   Playfair Display (headings) + Poppins (text), as on ishmaelacademy.com.
   Light reading surface and large type so older readers are comfortable. */

@font-face { font-family: "Poppins"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/Poppins-400.ttf") format("truetype"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/Poppins-500.ttf") format("truetype"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/Poppins-600.ttf") format("truetype"); }
@font-face { font-family: "Playfair Display"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/PlayfairDisplay-500.ttf") format("truetype"); }
@font-face { font-family: "Playfair Display"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/PlayfairDisplay-600.ttf") format("truetype"); }

:root {
  --ink: #141414;
  --text: #1f2327;
  --muted: #565d66;
  --bg: #f6f3ec;
  --card: #ffffff;
  --line: #ddd5c3;
  --gold: #c8b384;
  --gold-d: #7a5f25;
  --gold-soft: #f3ecda;
  --blue: #738795;
  --blue-d: #3f5566;
  --err: #a12a24;
  --err-bg: #fbeceb;
  --ok: #2d6a4f;
  --radius: 16px;
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Poppins", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 120px; font-size: 106.25%; -webkit-text-size-adjust: 100%; }          /* 17px root; body is larger below */
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 1.1rem; line-height: 1.65;
}
img { max-width: 100%; height: auto; }
a { color: var(--gold-d); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
.wrap { width: 100%; max-width: 820px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 10px 16px; z-index: 50; }
.skip:focus { left: 8px; top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--blue-d); outline-offset: 3px; border-radius: 4px; }

/* ---------- header / footer */
.site-header { background: var(--ink); color: #fff; border-bottom: 3px solid var(--gold); }
.header-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; color: #fff; text-decoration: none; }
.brand img { height: 52px; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-family: var(--font-display); font-weight: 600; letter-spacing: .22em; font-size: 1.05rem; }
.brand-sub { color: var(--gold); font-size: .82rem; letter-spacing: .06em; margin-top: 4px; }
.site-footer { padding: 36px 0 48px; color: var(--muted); font-size: .9rem; text-align: center; }
main.wrap { padding-top: 34px; padding-bottom: 20px; min-height: 60vh; }

/* ---------- type */
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; color: var(--ink); line-height: 1.22; margin: 0 0 .5em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
.eyebrow { margin: 0 0 6px; text-transform: uppercase; letter-spacing: .16em; font-size: .78rem; font-weight: 600; color: var(--gold-d); }
.lead { font-size: 1.12rem; color: #333a42; margin: 0 0 6px; }
.big { font-size: 1.2rem; }
.help { color: var(--muted); font-size: .98rem; margin: .25rem 0 .9rem; }
.sub { color: var(--muted); font-size: .95rem; font-weight: 400; font-family: var(--font-body); }
.muted { color: var(--muted); }

/* ---------- cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 26px; margin: 0 0 22px; box-shadow: 0 1px 0 rgba(20,20,20,.03), 0 8px 24px -16px rgba(20,20,20,.18); }
.intro { border-top: 5px solid var(--gold); }
.intro h1 { font-size: 1.9rem; margin-bottom: .3em; }
.intro-h { font-size: 1.35rem; margin-top: 1.1em; }
.how { background: var(--gold-soft); border-radius: 12px; padding: 16px 20px; margin-top: 18px; }
.how-title { margin: 0 0 4px; font-weight: 600; color: var(--ink); }
.how ul { margin: 0; padding-left: 1.2em; }
.how li { margin: .25em 0; }

/* ---------- progress */
.progress { position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 12px 0 10px; margin: 0 0 14px; }
.progress-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: .95rem; }
.progress-label { font-weight: 600; color: var(--ink); }
.progress-name { color: var(--muted); text-align: right; }
.bar { height: 10px; background: #e3dccb; border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bar span { display: block; height: 100%; width: 20%; background: linear-gradient(90deg, var(--gold-d), var(--gold)); border-radius: 99px; transition: width .35s ease; }
.dots { display: none; }
@media (prefers-reduced-motion: reduce) { .bar span { transition: none; } * { scroll-behavior: auto !important; } }

/* ---------- step header */
.step-head { margin: 8px 0 18px; }
.step-head h2 { font-size: 1.75rem; }
.step-head h2:focus { outline: none; }
html:not(.js) .step { margin-bottom: 30px; }
html:not(.js) .nav { display: none; }
html:not(.js) .step:last-child .nav { display: flex; }
html:not(.js) .step + .step { border-top: 2px dashed var(--line); padding-top: 24px; }

/* ---------- questions */
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.q { scroll-margin-top: 90px; }
.q legend, .q .legend { display: block; width: 100%; padding: 0; font-weight: 600; font-size: 1.22rem; line-height: 1.4; color: var(--ink); margin-bottom: 4px; }
.q legend { float: left; } /* legend inside fieldset: keep wrapping consistent */
.q legend + * { clear: both; }
.qnum { display: inline-flex; align-items: center; justify-content: center; min-width: 2.1rem; height: 2.1rem; padding: 0 .5rem; margin-right: .6rem; border-radius: 99px; background: var(--ink); color: var(--gold); font-size: .95rem; font-weight: 600; vertical-align: .08em; }
.qtitle { display: inline; }
.req, .opt-tag { display: inline-block; margin-left: .6rem; padding: 1px 10px; border-radius: 99px; font-size: .78rem; font-weight: 600; vertical-align: .15em; letter-spacing: .02em; }
.req { background: var(--gold-soft); color: var(--gold-d); border: 1px solid #e0d2ad; }
.opt-tag { background: #eef0f2; color: var(--muted); font-weight: 500; }
.q.has-error { border-color: var(--err); box-shadow: 0 0 0 3px rgba(161,42,36,.14); }
.err { margin: 12px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--err-bg); color: var(--err); font-weight: 500; font-size: 1rem; }
.err::before { content: "! "; font-weight: 700; }

/* radio / checkbox rows */
.options { display: grid; gap: 10px; margin-top: 10px; }
.opt { display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; min-height: 56px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; background: #fff; transition: border-color .15s, background .15s; }
.opt:hover { border-color: var(--gold); }
.opt input { flex: none; width: 26px; height: 26px; margin: 2px 0 0; accent-color: var(--ink); cursor: pointer; }
.opt span { font-size: 1.08rem; line-height: 1.45; }
.opt:has(input:checked) { border-color: var(--ink); background: var(--gold-soft); }
.opt:has(input:focus-visible) { outline: 3px solid var(--blue-d); outline-offset: 2px; }

/* numeric pills */
.pills { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 10px; }
.pill { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px; padding: 12px 4px 10px; min-height: 64px; text-align: center; border: 2px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.pill input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.pill .n { font-size: 1.45rem; font-weight: 600; line-height: 1; color: var(--ink); }
.pill .t { font-size: .74rem; line-height: 1.25; color: var(--muted); }
.pill:hover { border-color: var(--gold); }
.pill:has(input:checked) { background: var(--ink); border-color: var(--ink); }
.pill:has(input:checked) .n { color: var(--gold); }
.pill:has(input:checked) .t { color: #e9e4d6; }
.pill:has(input:focus-visible) { outline: 3px solid var(--blue-d); outline-offset: 2px; }
.pills-big .t { font-size: .82rem; }

/* course matrix */
.scale-key { display: flex; justify-content: space-between; gap: 8px; margin: 4px 0 6px; padding: 10px 14px; background: #f4f1e8; border-radius: 10px; font-size: .92rem; color: var(--muted); }
.scale-key strong { color: var(--ink); }
.course { padding: 18px 0 16px; border-top: 1px solid var(--line); }
.course:first-of-type { margin-top: 8px; }
.course legend { margin: 0; font-weight: 600; font-size: 1.12rem; line-height: 1.35; color: var(--ink); padding: 0; float: none; width: auto; display: flex; gap: 10px; align-items: baseline; }
.cnum { flex: none; display: inline-block; min-width: 1.7rem; color: var(--gold-d); font-family: var(--font-display); font-size: 1.2rem; }
.cdesc { margin: 4px 0 2px 2.2rem; color: #3b434b; font-size: 1rem; line-height: 1.5; }
.course .pills { margin-left: 2.2rem; }
.course .pill { min-height: 54px; padding: 10px 4px; }
.course .pill .t { display: none; }
.course.missing { background: var(--err-bg); border-radius: 10px; padding-left: 10px; padding-right: 10px; }

/* inputs */
.field { margin: 14px 0 0; }
label { font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: 1.08rem; color: var(--text); background: #fff;
  border: 2px solid #c9c1ad; border-radius: 12px; padding: 13px 16px; min-height: 54px;
}
textarea { min-height: 130px; resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus { border-color: var(--ink); outline: 3px solid rgba(115,135,149,.45); outline-offset: 1px; }
.field label { display: block; margin-bottom: 6px; }
.other-wrap { display: none; margin-top: 12px; }
html:not(.js) .other-wrap, .other-wrap.show { display: block; }
.contact { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line); }
.hp { position: absolute !important; left: -5000px; width: 1px; height: 1px; overflow: hidden; }

/* nav buttons */
.nav { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin: 26px 0 6px; }
.nav-hint { margin: 8px 0 0; color: var(--err); font-weight: 500; text-align: right; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; font-size: 1.1rem; padding: 15px 30px; min-height: 56px; border-radius: 99px; border: 2px solid var(--ink); cursor: pointer; text-decoration: none; transition: background .15s, color .15s, border-color .15s; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--gold-d); border-color: var(--gold-d); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.btn[disabled] { opacity: .6; cursor: wait; }
.linkbtn { background: none; border: 0; color: var(--gold); font: inherit; cursor: pointer; text-decoration: underline; padding: 6px 0; }
.linkbtn:hover { color: #fff; }

/* notices */
.notice { margin: 0 0 20px; padding: 16px 20px; border-radius: 12px; background: var(--gold-soft); border: 1px solid #e0d2ad; }
.notice-err { background: var(--err-bg); border-color: #e6b8b5; color: #6d1a16; }

/* thanks */
.thanks { text-align: left; padding: 34px 30px; }
.thanks .check { width: 64px; height: 64px; border-radius: 50%; background: var(--ink); color: var(--gold); display: flex; align-items: center; justify-content: center; font-size: 2rem; margin-bottom: 14px; }

/* ---------- mobile */
@media (max-width: 640px) {
  html { font-size: 100%; }
  body { font-size: 1.1rem; }
  .wrap { padding: 0 14px; }
  .card { padding: 20px 16px; border-radius: 14px; }
  h1 { font-size: 1.65rem; }
  .intro h1 { font-size: 1.6rem; }
  .step-head h2 { font-size: 1.5rem; }
  .brand img { height: 44px; }
  .brand-name { font-size: .92rem; letter-spacing: .16em; }
  .brand-sub { font-size: .74rem; }
  .q legend, .q .legend { font-size: 1.15rem; }
  .pills-big { grid-template-columns: repeat(5, 1fr); gap: 5px; }
  .pills-big .pill { padding: 10px 2px; }
  .pills-big .t { font-size: .64rem; hyphens: auto; }
  .course .pills, .cdesc { margin-left: 0; }
  .course .pill { min-height: 52px; }
  .scale-key { font-size: .8rem; padding: 8px 10px; }
  .btn { padding: 14px 22px; }
  .nav { gap: 10px; }
  .nav .btn { flex: 1; }
  .nav span:empty { display: none; }
  .progress-name { font-size: .85rem; }
  .qnum { min-width: 1.9rem; height: 1.9rem; margin-right: .45rem; }
}

/* ======================= ADMIN ======================= */
body.admin .wrap { max-width: 1120px; }
.admin-nav { display: flex; align-items: center; gap: 6px 18px; flex-wrap: wrap; font-size: .98rem; }
.admin-nav a { color: #fff; text-decoration: none; padding: 6px 2px; border-bottom: 2px solid transparent; }
.admin-nav a:hover { border-color: var(--gold); }
.admin-nav a[aria-current=page] { border-color: var(--gold); color: var(--gold); }
.admin-nav form { margin: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { margin: 0; }
.filter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter select, .filter input[type=search] { min-height: 46px; padding: 8px 14px; font-size: 1rem; width: auto; min-width: 200px; }
.filter .btn { min-height: 46px; padding: 8px 20px; font-size: 1rem; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.stat { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; justify-content: space-between; min-height: 112px; }
.stat .num { font-family: var(--font-display); font-size: 2.6rem; line-height: 1.1; color: var(--gold); }
.stat .num.sm { font-size: 1.15rem; font-family: var(--font-body); font-weight: 500; line-height: 1.35; }
.stat .lab { font-size: .9rem; color: #d7d2c4; }
.caveat { color: var(--muted); font-size: .95rem; margin: 0 0 18px; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 4px; align-items: start; }
.grid .card { margin: 0; }
.grid .wide { grid-column: 1 / -1; }
.grid { margin-bottom: 22px; }
.chart-card h2 { font-size: 1.2rem; font-family: var(--font-body); font-weight: 600; display: block; line-height: 1.4; }
.chart-card .qnum { min-width: 1.8rem; height: 1.8rem; font-size: .8rem; margin-right: .5rem; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: center; }
.chart-box { position: relative; width: 100%; margin-top: 10px; }
.chart-box.short { height: 250px; }
.chart-box.mid { height: 280px; }
.chart-box.tall { height: 470px; }
table { border-collapse: collapse; width: 100%; }
table.mini { margin-top: 12px; font-size: .98rem; }
table.mini th { text-align: left; font-weight: 400; padding: 4px 0; }
table.mini td { text-align: right; padding: 4px 0 4px 12px; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }
table.data { font-size: .95rem; min-width: 640px; }
table.data th, table.data td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: center; font-variant-numeric: tabular-nums; }
table.data th { background: #f4f1e8; font-weight: 600; font-size: .85rem; }
table.data .l { text-align: left; }
table.data td.l { max-width: 340px; }
.status { display: inline-block; padding: 1px 10px; border-radius: 99px; font-size: .82rem; font-weight: 600; background: #eef0f2; }
.status-sent { background: #dcefe4; color: var(--ok); }
.status-failed { background: var(--err-bg); color: var(--err); }
.status-pending { background: #fff3cf; color: #7a5a00; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 8px 0 30px; }
.actions .btn { font-size: 1rem; padding: 12px 24px; min-height: 50px; }
.jump { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.jump a { text-decoration: none; padding: 8px 16px; border: 2px solid var(--line); border-radius: 99px; background: #fff; color: var(--ink); font-weight: 500; }
.jump a:hover { border-color: var(--ink); }
.badge { display: inline-block; min-width: 1.6em; text-align: center; background: var(--ink); color: var(--gold); border-radius: 99px; font-size: .8rem; padding: 0 6px; margin-left: 4px; }
.text-group h2 { font-size: 1.3rem; }
.quote { border-left: 4px solid var(--gold); background: #fbf9f3; padding: 14px 18px; margin: 14px 0; border-radius: 0 12px 12px 0; }
.quote p { margin: 0 0 8px; white-space: normal; }
.quote footer { font-size: .88rem; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tag { display: inline-block; padding: 1px 10px; border-radius: 99px; background: var(--ink); color: #fff; font-size: .78rem; font-weight: 500; }
.tag-q { background: var(--gold); color: var(--ink); }
.ans { padding: 10px 0; border-top: 1px solid var(--line); }
.ans:first-of-type { border-top: 0; }
.qlabel { font-weight: 600; margin: 0 0 4px; }
.quote-inline { background: #fbf9f3; border-left: 4px solid var(--gold); padding: 10px 14px; border-radius: 0 10px 10px 0; }
.login { max-width: 460px; margin: 30px auto; }
.login .btn { margin-top: 18px; width: 100%; }
code { background: #efe9d8; padding: 1px 6px; border-radius: 6px; font-size: .9em; }

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid { grid-template-columns: 1fr; }
  .chart-box.tall { height: 560px; }
}

/* ---------- print */
.print-bar { margin: 0 0 18px; display: flex; gap: 10px; }
.print-doc { max-width: 820px; margin: 0 auto; }
.print-doc h1 { font-size: 1.6rem; }
.pblock { break-inside: avoid; page-break-inside: avoid; margin: 0 0 22px; padding-top: 4px; }
.pblock .chart-box { margin-bottom: 6px; }
.pblock h2 { font-size: 1.1rem; font-family: var(--font-body); }
.pblock blockquote { margin: 8px 0; padding: 6px 14px; border-left: 3px solid var(--gold); font-size: .95rem; break-inside: avoid; }
.pblock cite { display: block; font-style: normal; font-size: .8rem; color: var(--muted); margin-top: 3px; }
@media print {
  body { background: #fff; font-size: 11pt; }
  .site-header, .site-footer, .no-print, .skip { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  main { padding: 0; }
  .card { box-shadow: none; }
  .print-doc .chart-box { max-width: 100%; }
  a { color: inherit; text-decoration: none; }
}
