/* BuildReport site styles. Tokens and rules: DESIGN.md. */

@font-face {
    font-family: 'Red Hat Text';
    src: url('/assets/fonts/RedHatText-latin.woff2') format('woff2');
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Red Hat Mono';
    src: url('/assets/fonts/RedHatMono-latin.woff2') format('woff2');
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --ink: #16263A;
    --ink-dark: #0E1A29;
    --muted: #4A5A6E;
    --hairline: #DCE2E8;
    --ground: #FBFCFD;
    --page: #FFFFFF;
    --red: #B3261E;               /* drafting red: reference numbers and slope arrows only */

    --font-text: 'Red Hat Text', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono: 'Red Hat Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

    --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
    --radius: 2px;
    --content: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font-text);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--ink);
    background: var(--ground);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
body > main { flex: 1 0 auto; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.2; }
p { margin: 0; }
a { color: var(--ink); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.hidden { display: none !important; }
.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Mono caps label: views, panels, form captions, title block. */
.label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
.mono { font-family: var(--font-mono); }

/* ---- Logo ---- */
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.logo-icon { flex: none; display: block; }
.logo-word { font-family: var(--font-text); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.01em; line-height: 1; }

/* ---- Header ---- */
.site-header { background: var(--page); border-bottom: 1px solid var(--hairline); }
.site-header-inner {
    max-width: var(--content); margin: 0 auto; padding: var(--s3) var(--s5);
    display: flex; align-items: center; justify-content: space-between; gap: var(--s4); min-height: 64px;
}
.site-header .logo { min-height: 44px; }
.site-nav { display: flex; align-items: center; gap: var(--s4); }
.credits {
    font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.04em;
    text-transform: uppercase; color: var(--muted); white-space: nowrap;
}
.credits strong { color: var(--ink); font-weight: 600; font-size: 0.9375rem; margin-left: 4px; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
    min-height: 44px; padding: 10px 20px;
    font: 500 0.9375rem/1.2 var(--font-text);
    border-radius: var(--radius); border: 1px solid var(--ink);
    cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background-color 120ms ease-out, color 120ms ease-out;
}
.btn-primary { background: var(--ink); color: var(--page); }
.btn-primary:hover { background: var(--ink-dark); }
.btn-secondary { background: var(--page); color: var(--ink); }
.btn-secondary:hover { background: var(--ground); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-full { width: 100%; }
.link-btn {
    background: none; border: 0; padding: 0; min-height: 44px; color: var(--ink);
    font: inherit; font-weight: 500; text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.link-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Layout ---- */
.container { max-width: var(--content); margin: 0 auto; padding: var(--s6) var(--s5) var(--s7); }
.page-head { margin-bottom: var(--s5); }
.page-head h1 { font-size: 1.75rem; letter-spacing: -0.01em; }
.page-head p { margin-top: var(--s2); color: var(--muted); max-width: 62ch; }

/* ---- Panels ---- */
.panel { background: var(--page); border: 1px solid var(--hairline); padding: var(--s5); }
.container > .panel, .container > .report { margin-bottom: var(--s5); }
.container > :last-child { margin-bottom: 0; }
.panel-head { display: flex; align-items: baseline; gap: var(--s3); margin-bottom: var(--s4); }
.panel-head h2 { font-size: 1.125rem; }
.panel-intro { color: var(--muted); margin: calc(-1 * var(--s2)) 0 var(--s4); }

/* ---- Forms ---- */
.form-group { margin-bottom: var(--s4); }
.form-label { display: block; font-weight: 500; font-size: 0.875rem; margin-bottom: 6px; }
.form-hint { display: block; font-size: 0.8125rem; color: var(--muted); margin-top: 6px; }
.form-input {
    width: 100%; min-height: 48px; padding: 12px 14px;
    font: 400 1rem/1.4 var(--font-text); color: var(--ink);
    background: var(--page); border: 1px solid var(--muted); border-radius: var(--radius);
}
.form-input::placeholder { color: var(--muted); opacity: 1; }
.form-input:focus { border-color: var(--ink); outline: 2px solid var(--ink); outline-offset: 0; }
/* Show/hide password (assets/password-toggle.js) */
.pw-wrap { position: relative; display: block; }
.pw-wrap .form-input { padding-right: 52px; }
.pw-toggle {
    position: absolute; top: 2px; right: 2px; bottom: 2px; width: 44px;
    display: flex; align-items: center; justify-content: center;
    background: none; border: 0; border-radius: var(--radius); color: var(--muted); cursor: pointer;
}
.pw-toggle:hover, .pw-toggle[aria-pressed="true"] { color: var(--ink); }
/* Edge's own reveal button would make a second eye. */
.pw-wrap input::-ms-reveal, .pw-wrap input::-ms-clear { display: none; }
.check-row { display: flex; align-items: flex-start; gap: var(--s3); margin-bottom: var(--s4); font-size: 0.875rem; }
.check-row input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--ink); }

/* ---- Notices: bordered, mono label, no colour (DESIGN.md, Notices) ---- */
.notice {
    display: none; border: 1px solid var(--ink); background: var(--page);
    padding: var(--s3) var(--s4); margin-bottom: var(--s5);
}
.notice.show { display: block; }
.notice .label { display: block; color: var(--ink); margin-bottom: 2px; }
.notice-static { display: block; }

/* ---- Auth ---- */
.auth-screen { display: none; padding: var(--s7) var(--s5); }
.auth-screen.active { display: block; }
.auth-card { max-width: 440px; margin: 0 auto; background: var(--page); border: 1px solid var(--hairline); padding: var(--s6); }
.auth-card h1 { font-size: 1.5rem; margin-top: var(--s2); }
.auth-card .lede { color: var(--muted); margin: var(--s2) 0 var(--s5); }
.auth-alt { margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--hairline); font-size: 0.9375rem; color: var(--muted); }
.auth-alt + .auth-alt { margin-top: 0; border-top: 0; padding-top: var(--s2); }
.status-line { font-size: 0.875rem; color: var(--muted); }
.status-line:empty { display: none; }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--hairline); background: var(--page); }
.site-footer-inner {
    max-width: var(--content); margin: 0 auto; padding: var(--s4) var(--s5);
    display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); justify-content: space-between; align-items: center;
    font-size: 0.875rem; color: var(--muted);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0 var(--s4); }
.site-footer a { color: var(--muted); display: inline-flex; align-items: center; min-height: 44px; }

/* ---- Legal / long-form documents ---- */
.doc { max-width: 72ch; margin: 0 auto; padding: var(--s6) var(--s5) var(--s7); }
.doc h1 { font-size: 2rem; letter-spacing: -0.01em; }
.doc .doc-meta { margin: var(--s2) 0 var(--s6); }
.doc h2 { font-size: 1.25rem; margin: var(--s6) 0 var(--s3); padding-top: var(--s4); border-top: 1px solid var(--hairline); }
.doc h3 { font-size: 1.0625rem; margin: var(--s5) 0 var(--s2); }
.doc p, .doc ul, .doc ol { margin: 0 0 var(--s3); }
.doc ul, .doc ol { padding-left: 1.25rem; }
.doc li { margin-bottom: var(--s1); }
.doc table { width: 100%; border-collapse: collapse; margin: var(--s3) 0 var(--s4); font-size: 0.9375rem; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: var(--s2) var(--s3) var(--s2) 0; border-bottom: 1px solid var(--hairline); }
.doc th { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.doc .note { border: 1px solid var(--ink); padding: var(--s3) var(--s4); margin: var(--s4) 0; background: var(--page); }
.doc .note > :last-child { margin-bottom: 0; }
.doc .note .label { display: block; color: var(--ink); margin-bottom: var(--s1); }
.doc-table-wrap { overflow-x: auto; }

@media (max-width: 640px) {
    .site-header-inner { padding: var(--s2) var(--s4); min-height: 56px; }
    .logo-word { font-size: 1.125rem; }
    .site-nav { gap: var(--s3); }
    .container { padding: var(--s5) var(--s4) var(--s6); }
    .page-head h1 { font-size: 1.5rem; }
    .panel { padding: var(--s4); }
    .auth-screen { padding: var(--s5) var(--s4); }
    .auth-card { padding: var(--s5) var(--s4); }
    .site-footer-inner { padding: var(--s3) var(--s4); }
    .doc { padding: var(--s5) var(--s4) var(--s6); }
    .doc h1 { font-size: 1.625rem; }
}

@media (prefers-reduced-motion: reduce) {
    .btn { transition: none; }
}
