/* NeuroVol minimal stylesheet --------------------------------------------- */
:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --ink: #1a1d1f;
  --muted: #6e7378;
  --line: #e3e0d8;
  --accent: #2f6e4f;
  --accent-hi: #245238;
  --accent-soft: #e7f1ec;
  --danger: #b22222;
  --warn: #b97500;
  --csf: #c8d6e4;
  --cortex: #d4c8e4;
  --white: #e1d4c4;
  --gray: #c8e0d4;
  --max: 1100px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink);
             font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial; }
body { line-height: 1.55; }

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

.container { max-width: var(--max); margin: 0 auto; padding: 0 1.2rem; }

/* Header & footer -------------------------------------------------------- */
header.site { background: var(--surface); border-bottom: 1px solid var(--line); padding: 0.6rem 0; position: sticky; top: 0; z-index: 10; }
header.site .row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--ink); display: inline-flex; align-items: baseline; gap: 0.4rem; }
.brand-mark { color: var(--accent); font-size: 1.3rem; }
.brand-tag { font-weight: 400; font-size: 0.78rem; color: var(--muted); margin-left: 0.4rem; }
header.site nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
header.site nav a { color: var(--ink); }
header.site nav a.cta { background: var(--accent); color: white; padding: 0.4rem 0.85rem; border-radius: 6px; }
header.site nav form.inline { display: inline; margin: 0; }
.linkish { background: none; border: none; color: var(--ink); cursor: pointer; font: inherit; padding: 0; }
.linkish:hover { text-decoration: underline; }

footer.site { border-top: 1px solid var(--line); margin-top: 4rem; padding: 1.5rem 0 3rem; background: var(--surface); font-size: 0.92rem; color: var(--muted); }
footer.site p { margin: 0.4rem 0; }
footer.site a { color: var(--muted); text-decoration: underline; }

/* Main ------------------------------------------------------------------- */
main.container { padding-top: 2rem; padding-bottom: 2rem; }

h1 { font-size: 2rem; margin-top: 0; }
h2 { margin-top: 2rem; }
.lead { font-size: 1.12rem; max-width: 60ch; }
.muted { color: var(--muted); }
.center { text-align: center; }
ul.cols { columns: 2; padding-left: 1rem; }

/* Hero ------------------------------------------------------------------- */
.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; align-items: start; margin-bottom: 3rem; }
.hero h1 { font-size: 2.4rem; line-height: 1.15; margin-bottom: 0.6rem; }
.hero .cta-row { display: flex; gap: 0.75rem; margin-top: 1.2rem; flex-wrap: wrap; }
.hero-card .card h3 { margin-top: 0; }
@media (max-width: 800px) { .hero { grid-template-columns: 1fr; } }

/* Cards / grids ---------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1.2rem; box-shadow: 0 1px 0 rgba(0,0,0,0.02); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin: 2rem 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; margin: 1.5rem 0; }
@media (max-width: 800px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.callout { background: var(--accent-soft); border-left: 4px solid var(--accent); padding: 1.2rem 1.4rem; border-radius: 0 8px 8px 0; margin: 2rem 0; }
.callout h3 { margin-top: 0; }

/* Buttons ---------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.55rem 1rem; border-radius: 6px; border: 1px solid transparent; font: inherit; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--accent); color: white; }
.btn.primary:hover { background: var(--accent-hi); text-decoration: none; }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.secondary.small { padding: 0.3rem 0.7rem; font-size: 0.9rem; }
.btn.google { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.block { display: block; width: 100%; text-align: center; }

/* Forms ------------------------------------------------------------------ */
form.stack { display: flex; flex-direction: column; gap: 1rem; max-width: 580px; }
form label { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 500; }
form input[type=text], form input[type=email], form input[type=password], form input[type=number], form select, form input[type=file] {
  font: inherit; padding: 0.55rem 0.7rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface);
}
form input:focus, form select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.row.gap { display: flex; gap: 1rem; align-items: stretch; flex-wrap: wrap; }
.row.gap .flex { flex: 1 1 220px; }

/* Auth card -------------------------------------------------------------- */
.auth-card { max-width: 420px; margin: 2rem auto; padding: 1.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.auth-card form { display: flex; flex-direction: column; gap: 0.8rem; }
.auth-card .or { text-align: center; color: var(--muted); margin: 0.6rem 0; }

/* Page head -------------------------------------------------------------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }

/* Tables ----------------------------------------------------------------- */
table.data { width: 100%; border-collapse: collapse; margin: 1.2rem 0 2rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
table.data th, table.data td { padding: 0.7rem 0.85rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data thead { background: #fafaf6; }
table.data tr:last-child td { border-bottom: none; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }

/* Status badges ---------------------------------------------------------- */
.badge { display: inline-block; padding: 0.2rem 0.55rem; border-radius: 999px; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }
.badge-pending, .badge-preprocessing, .badge-uploaded, .badge-segmenting { background: #fff5dc; color: #6b5300; border: 1px solid #f0d77a; }
.badge-completed { background: var(--accent-soft); color: var(--accent-hi); border: 1px solid #b3d7c4; }
.badge-failed { background: #fbecec; color: var(--danger); border: 1px solid #e5b7b7; }

/* Report ----------------------------------------------------------------- */
table.report .region-name { font-weight: 600; }
table.report details summary { cursor: pointer; }
table.report .reading { max-width: 38rem; }
.pct { font-weight: 600; }
.pct-suffix { color: var(--muted); font-weight: 400; margin-left: 0.2rem; }
.bar { height: 6px; background: #f0eee5; border-radius: 999px; margin-top: 0.3rem; overflow: hidden; max-width: 200px; }
.bar > span { display: block; height: 100%; background: var(--accent); }
.report-meta { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.2rem; flex-wrap: wrap; }
.percentile-explainer { background: var(--surface); border: 1px solid var(--line); padding: 0.6rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.report-footer { background: var(--accent-soft); border-radius: 8px; padding: 1rem 1.2rem; margin-top: 1rem; font-size: 0.95rem; }

/* Row colour hint by group */
tr.row-subcortical td:first-child { border-left: 4px solid var(--gray); }
tr.row-cortical    td:first-child { border-left: 4px solid var(--cortex); }
tr.row-ventricular td:first-child { border-left: 4px solid var(--csf); }
tr.row-white       td:first-child { border-left: 4px solid var(--white); }
tr.row-cerebellar  td:first-child { border-left: 4px solid #d4d8b8; }
tr.row-brainstem   td:first-child { border-left: 4px solid #b8c2d8; }

/* Alerts ----------------------------------------------------------------- */
.alert { padding: 0.85rem 1rem; border-radius: 6px; margin: 1rem 0; }
.alert-info  { background: #eef2f7; border: 1px solid #c9d4e0; }
.alert-error { background: #fbecec; border: 1px solid #e5b7b7; color: var(--danger); }
.alert pre { white-space: pre-wrap; word-break: break-word; font-size: 0.85rem; margin: 0.4rem 0 0; color: var(--muted); }

/* Empty state ------------------------------------------------------------ */
.empty { background: var(--surface); border: 1px dashed var(--line); padding: 2rem; border-radius: 8px; text-align: center; }

/* Steps list ------------------------------------------------------------- */
ol.steps { padding-left: 1.2rem; }
ol.steps li { margin: 0.3rem 0; }

/* Misc */
pre { background: #f1efe7; padding: 0.6rem 0.8rem; border-radius: 6px; overflow-x: auto; font-size: 0.9rem; }
code { background: #f1efe7; padding: 0 0.25rem; border-radius: 3px; }
