/*
   NHS Identity palette. Blue carries "primary and passing", red carries "error and loss".
   Because those two colours carry all of the interface's meaning, neither is used
   decoratively anywhere else.
*/
:root {
    --nhs-blue: #005EB8;
    --nhs-dark-blue: #003087;
    --nhs-bright-blue: #0072CE;
    --nhs-light-blue: #41B6E6;
    --nhs-red: #DA291C;
    --nhs-dark-red: #8A1538;
    --nhs-green: #007F3B;
    --nhs-amber: #B57600;
    --nhs-warm-yellow: #FFB81C;
    --nhs-pale-grey: #F0F4F5;
    --nhs-mid-grey: #768692;
    --nhs-dark-grey: #425563;
    --nhs-border: #D8DDE0;
    --problem-tint: #FDF2F1;
    --pass-tint: #F1F8F4;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: "Frutiger W01", Arial, Helvetica, sans-serif;
    font-size: 16px;
    color: var(--nhs-dark-grey);
    background: var(--nhs-pale-grey);
}

a { color: var(--nhs-blue); }

/* ---- Header ------------------------------------------------------------- */

.nhs-header {
    background: var(--nhs-blue);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* The corporate mark contains black text that would not read against NHS blue,
   so it sits on a white card that preserves the logo's own colours. */
.nhs-logo-card {
    background: #fff;
    border-radius: 3px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
}

.nhs-logo-card img { height: 34px; display: block; }

.nhs-header-title { color: #fff; font-size: 19px; font-weight: 600; line-height: 1.2; }
.nhs-header-sub { color: #CFE3F5; font-size: 12px; }
.nhs-header-spacer { flex: 1; }

.nhs-header-user {
    color: #CFE3F5;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ---- Navigation --------------------------------------------------------- */

/* A named bar rather than links tucked into the header: "Saved Results" has to be
   somewhere the user looks for it, not somewhere they happen to find it. */
.nhs-nav {
    background: var(--nhs-dark-blue);
    display: flex;
    gap: 2px;
    padding: 0 16px;
    flex-wrap: wrap;
}

.nhs-nav-link {
    color: #CFE3F5;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 18px;
    border-bottom: 4px solid transparent;
}

.nhs-nav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

.nhs-nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border-bottom-color: var(--nhs-warm-yellow);
}

/* ---- Privacy banner ----------------------------------------------------- */

/* Shown on every screen, not only the privacy page: a claim about where clinical
   data goes has to be visible at the moment someone is about to hand it over. */
.privacy-bar {
    background: #EAF3FB;
    border-bottom: 2px solid var(--nhs-bright-blue);
    padding: 10px 24px;
    font-size: 13px;
    line-height: 1.5;
}

.privacy-bar strong { color: var(--nhs-dark-blue); }

.privacy-note {
    background: #EAF3FB;
    border-left: 4px solid var(--nhs-bright-blue);
    padding: 12px 16px;
    font-size: 13.5px;
    line-height: 1.55;
    margin: 16px 0;
}

.warning-note {
    background: #FFF6E0;
    border-left: 4px solid var(--nhs-warm-yellow);
    padding: 12px 16px;
    font-size: 13.5px;
    line-height: 1.55;
    margin: 16px 0;
}

.danger-note {
    background: var(--problem-tint);
    border-left: 4px solid var(--nhs-red);
    padding: 12px 16px;
    font-size: 13.5px;
    line-height: 1.55;
    margin: 16px 0;
}

.success-note {
    background: var(--pass-tint);
    border-left: 4px solid var(--nhs-green);
    padding: 12px 16px;
    font-size: 13.5px;
    line-height: 1.55;
    margin: 16px 0;
}

/* ---- Layout ------------------------------------------------------------- */

.page { min-height: 100vh; display: flex; flex-direction: column; }
.content { flex: 1; padding: 24px; max-width: 1500px; width: 100%; margin: 0 auto; }
.card {
    background: #fff;
    border: 1px solid var(--nhs-border);
    border-radius: 4px;
    padding: 24px;
    margin-bottom: 20px;
}
.card-narrow { max-width: 480px; margin: 48px auto; }

h1 { font-size: 26px; color: var(--nhs-dark-blue); margin: 0 0 8px; }
h2 { font-size: 19px; color: var(--nhs-dark-blue); margin: 24px 0 10px; }
h3 { font-size: 15px; color: var(--nhs-dark-grey); margin: 18px 0 8px; }
.lede { color: var(--nhs-mid-grey); font-size: 14px; margin: 0 0 16px; }

/* ---- Forms -------------------------------------------------------------- */

label { display: block; font-size: 12px; font-weight: 600; margin: 14px 0 5px; }

input[type=text], input[type=password], select {
    width: 100%;
    padding: 9px 11px;
    font-size: 15px;
    font-family: inherit;
    border: 1px solid var(--nhs-border);
    border-radius: 3px;
}

input:focus, select:focus { outline: 2px solid var(--nhs-bright-blue); outline-offset: 0; }

.field-hint { font-size: 12px; color: var(--nhs-mid-grey); margin-top: 4px; }
.field-error { font-size: 13px; color: var(--nhs-red); margin-top: 8px; font-weight: 600; }

/* ---- Buttons ------------------------------------------------------------ */

.btn {
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 22px;
    border-radius: 3px;
    border: 1px solid transparent;
    cursor: pointer;
}

.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--nhs-blue); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--nhs-dark-blue); }
.btn-secondary { background: #fff; color: var(--nhs-blue); border-color: var(--nhs-blue); }
.btn-secondary:hover:not(:disabled) { background: var(--nhs-pale-grey); }
.btn-danger { background: #fff; color: var(--nhs-red); border-color: var(--nhs-red); }
.btn-danger:hover:not(:disabled) { background: var(--problem-tint); }
.btn-small { font-size: 12px; padding: 6px 12px; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---- Verdict banner ----------------------------------------------------- */

.verdict {
    padding: 18px 22px;
    border-radius: 4px;
    color: #fff;
    margin-bottom: 20px;
}
.verdict-bad { background: var(--nhs-red); }
.verdict-good { background: var(--nhs-green); }
.verdict h2 { color: #fff; font-size: 22px; margin: 0 0 4px; }
.verdict p { margin: 0; font-size: 14px; color: #F2F2F2; }

/* ---- Stats -------------------------------------------------------------- */

.stats { display: flex; gap: 32px; flex-wrap: wrap; margin-bottom: 20px; }
.stat-label { font-size: 11px; font-weight: 700; color: var(--nhs-mid-grey); letter-spacing: .3px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--nhs-dark-blue); }
.stat-value.bad { color: var(--nhs-red); }
.stat-value.good { color: var(--nhs-green); }
.stat-value.warn { color: var(--nhs-amber); }

/* ---- Tables ------------------------------------------------------------- */

.table-scroll { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
    background: var(--nhs-pale-grey);
    color: var(--nhs-dark-grey);
    text-align: left;
    font-size: 12px;
    padding: 9px 10px;
    border-bottom: 1px solid var(--nhs-border);
    white-space: nowrap;
}
td { padding: 8px 10px; border-bottom: 1px solid var(--nhs-border); vertical-align: top; }
tr.row-problem { background: var(--problem-tint); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.num-bad { color: var(--nhs-red); font-weight: 600; }
.num-warn { color: var(--nhs-amber); font-weight: 600; }
.verdict-cell { font-weight: 700; font-size: 12px; white-space: nowrap; }
.verdict-cell.bad { color: var(--nhs-red); }
.verdict-cell.good { color: var(--nhs-green); }

.sev { font-weight: 700; font-size: 11.5px; white-space: nowrap; }
.sev-critical, .sev-error { color: var(--nhs-red); }
.sev-warning { color: var(--nhs-amber); }
.sev-info { color: var(--nhs-mid-grey); }
.sev-review { color: var(--nhs-blue); }

.muted { color: var(--nhs-mid-grey); font-size: 12.5px; }
.rule-detail { font-size: 12.5px; color: var(--nhs-mid-grey); margin-top: 3px; }

/* ---- Footer ------------------------------------------------------------- */

.nhs-footer {
    background: var(--nhs-dark-grey);
    color: #fff;
    padding: 14px 24px;
    font-size: 12px;
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    align-items: center;
}
.nhs-footer a { color: #CFE3F5; }

/* ---- Progress ----------------------------------------------------------- */

.progress-track { height: 6px; background: var(--nhs-border); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--nhs-bright-blue); transition: width .2s; }
.busy { font-size: 14px; color: var(--nhs-dark-blue); margin-top: 10px; }

/* ---- Filters ------------------------------------------------------------ */

.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters label { margin: 0 0 4px; }
.filters > div { min-width: 180px; }
