/*
  Matches the Inform suite's sign-in screens (audit.inform.services): Ant Design with the
  analyselocal-designsystem "inform" theme. Token values are copied from that theme.
*/
:root {
    --primary: #1F5FA9;
    --primary-hover: #3f7cc2;
    --primary-active: #17457A;
    --primary-bg: #eaf1fa;
    --link-soft: #4a90d9;
    --text: rgba(0, 0, 0, 0.88);
    --text-secondary: rgba(0, 0, 0, 0.45);
    --text-description: rgba(0, 0, 0, 0.65);
    --text-strong: #1a1a1a;
    --border: #d9d9d9;
    --split: rgba(5, 5, 5, 0.06);
    --fill-secondary: rgba(0, 0, 0, 0.06);
    --fill-tertiary: rgba(0, 0, 0, 0.04);
    --bg: #ffffff;
    --bg-layout: #FAFAFA;
    --sider: #f5f5f5;
    --error: #ff4d4f;
    --error-bg: #fff2f0;
    --error-border: #ffccc7;
    --warning: #d48806;
    --success: #389e0d;
    --success-bg: #f6ffed;
    --success-border: #b7eb8f;
    --radius: 8px;
    --radius-lg: 12px;
    --font: 'Google Sans Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; min-height: 100%; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
a:active { color: var(--primary-active); }

h1, h2, h3, h4 { color: var(--text); font-weight: 500; margin: 0 0 0.5em; }
h1 { font-size: 38px; line-height: 1.21; }
h2 { font-size: 30px; line-height: 1.27; }
h3 { font-size: 24px; line-height: 1.33; }
h4 { font-size: 20px; line-height: 1.4; }
p { margin: 0 0 1em; }

.secondary { color: var(--text-secondary); }
.description { color: var(--text-description); }
.strong { color: var(--text-strong); font-weight: 600; }
.small { font-size: 13px; }
.center { text-align: center; }
.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; }
.material-symbols-outlined { font-size: 18px; line-height: 1; vertical-align: middle; }

/* ---------- Form controls (antd Input / Button) ---------- */

label { display: block; margin: 0 0 8px; color: var(--text); }

input[type=email], input[type=text], input[type=search], select, textarea {
    width: 100%;
    min-height: 36px;
    padding: 4.5px 11px;
    font: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color .2s;
}
input:hover, select:hover { border-color: var(--primary-hover); }
input:focus, select:focus { border-color: var(--primary); outline: none; }
input[readonly] { background: var(--fill-tertiary); color: var(--text-description); }
input.large { min-height: 40px; padding: 5.4px 11px; font-size: 16px; line-height: 1.7; border-radius: var(--radius-lg); }
input.input-validation-error { border-color: var(--error); }

.button, button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 36px;
    padding: 5px 19px;
    font: inherit;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.02);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: color .2s, background .2s, border-color .2s;
}
.button:hover, button:hover { color: var(--primary-hover); border-color: var(--primary-hover); }

.button.primary, button.primary {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.04);
}
.button.primary:hover, button.primary:hover { color: #fff; background: var(--primary-hover); border-color: var(--primary-hover); }
.button.primary:active, button.primary:active { background: var(--primary-active); border-color: var(--primary-active); }

button.danger, .button.danger { color: var(--error); border-color: var(--error); }
button.danger:hover, .button.danger:hover { color: #fff; background: var(--error); border-color: var(--error); }

button.link, .button.link {
    height: auto;
    padding: 0;
    color: var(--primary);
    background: none;
    border: 0;
    box-shadow: none;
}
button.link:hover, .button.link:hover { color: var(--primary-hover); }

.button.large, button.large { height: 45px; padding: 8px 19px; font-size: 16px; border-radius: var(--radius-lg); }
.block { display: flex; width: 100%; }

button:disabled, .button[aria-disabled=true] { color: rgba(0, 0, 0, 0.25); background: var(--fill-tertiary); border-color: var(--border); cursor: not-allowed; box-shadow: none; }

:focus-visible { outline: 3px solid rgba(31, 95, 169, 0.35); outline-offset: 1px; }

.field { margin-bottom: 20px; }
.field-error { display: block; color: var(--error); font-size: 13px; margin-top: 4px; }
.validation-summary-errors ul { margin: 0 0 16px; padding: 0; list-style: none; color: var(--error); }

.check { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); margin: 0; }

.alert {
    padding: 8px 12px;
    margin: 0 0 16px;
    border: 1px solid var(--error-border);
    background: var(--error-bg);
    border-radius: var(--radius);
    color: var(--text);
}
.alert.success { border-color: var(--success-border); background: var(--success-bg); }
.alert.info { border-color: #91caff; background: #e6f4ff; }
.warning-text { color: var(--warning); }

/* ---------- Sign-in split screen ---------- */

.auth-split { display: flex; min-height: 100vh; }
.auth-panel { flex: 1; display: flex; flex-direction: column; padding: 24px 48px; background: #fff; }
.auth-panel .logo { height: 24px; display: block; align-self: flex-start; }
.auth-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
}
.auth-form h1 { text-align: center; }
.auth-form .lead { display: block; text-align: center; margin-bottom: 28px; color: var(--text-secondary); }
.auth-form input.large { margin-bottom: 12px; }
.auth-links { margin-top: 24px; text-align: center; font-size: 13px; }
.auth-links a { color: var(--link-soft); }
.auth-links .dot { color: var(--text-secondary); margin: 0 6px; }
.auth-image {
    flex: 1;
    background: url(/img/sign-in-background.webp) center / cover no-repeat;
}

/* ---------- Centred message pages (check email, confirm, signed out) ---------- */

.plain { min-height: 100vh; display: flex; flex-direction: column; background: #fff; }
.plain-header { padding: 24px 32px; }
.plain-header .logo { height: 28px; display: block; }
.plain-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 24px 64px;
}
.plain-body .content { width: 100%; max-width: 420px; }
.plain-body h2 { font-weight: 700; margin: 0 0 8px; }
.plain-body h4 { margin-bottom: 8px; }
.plain-body .lead { font-size: 15px; color: var(--text-secondary); margin-bottom: 20px; }
.plain-body .lead strong { color: var(--text-strong); }
.inline-actions { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; flex-wrap: wrap; }
.inline-actions form { display: inline; }
.inline-actions button.link { font-size: 14px; }

.app-list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; text-align: left; }
.app-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid #f0f0f0;
    border-radius: var(--radius-lg);
    color: var(--text);
    transition: border-color .2s, box-shadow .2s;
}
.app-list a:hover { border-color: var(--primary); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06); }
.app-list img { border-radius: 8px; }
.app-list .name { font-weight: 500; }
.app-list .desc { display: block; font-size: 13px; color: var(--text-secondary); }

.hidden-frames { position: absolute; width: 0; height: 0; border: 0; overflow: hidden; }
.hidden-frames iframe { width: 0; height: 0; border: 0; }

/* ---------- Administration (antd Layout + Sider + Menu + Table) ---------- */

.admin { display: flex; height: 100vh; overflow: hidden; background: var(--sider); }
.sider { width: 240px; flex-shrink: 0; display: flex; flex-direction: column; background: var(--sider); }
.sider-logo { display: flex; align-items: center; min-height: 33px; padding: 32px 28px 8px; }
.sider-logo img { height: 20px; display: block; }
.sider-logo .tag { margin-left: auto; }
.menu { list-style: none; margin: 8px 0; padding: 0 8px; }
.menu a, .menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 32px;
    padding: 0 16px;
    margin: 2px 0;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    box-shadow: none;
    color: var(--text-description);
    font-size: 14px;
    text-align: left;
}
.menu a:hover, .menu button:hover { background: var(--fill-tertiary); color: var(--text); }
.menu a.active { background: var(--fill-secondary); color: var(--text); }
.menu .material-symbols-outlined { font-size: 16px; }
.sider-divider { border-top: 1px solid var(--split); margin: 4px 8px; }
.sider-spacer { flex: 1; }
.sider-user { padding: 8px 24px 4px; font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.admin-main { flex: 1; overflow: hidden; padding: 8px; margin-left: -10px; }
.admin-content {
    height: 100%;
    overflow: auto;
    background: var(--bg);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 1px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px rgba(0, 0, 0, 0.02);
    padding: 24px 32px 48px;
}
.page-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h3 { margin: 0; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; }
.breadcrumb { font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--text); }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar input[type=search] { width: 280px; }
.toolbar select { width: auto; min-width: 150px; }

.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
th {
    text-align: left;
    font-weight: 500;
    color: var(--text);
    background: #fafafa;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
}
th:first-child { border-top-left-radius: var(--radius); }
th:last-child { border-top-right-radius: var(--radius); }
td { padding: 12px 16px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
tbody tr:hover td { background: #fafafa; }
td.muted, .muted { color: var(--text-secondary); }
.empty { padding: 32px 16px; text-align: center; color: var(--text-secondary); }

.tag {
    display: inline-block;
    font-size: 12px;
    line-height: 20px;
    padding: 0 7px;
    margin: 2px 4px 2px 0;
    background: #fafafa;
    border: 1px solid var(--border);
    border-radius: 4px;
    white-space: nowrap;
}
.tag.blue { color: var(--primary); background: var(--primary-bg); border-color: #b3cdea; }
.tag.green { color: var(--success); background: var(--success-bg); border-color: var(--success-border); }
.tag.red { color: #cf1322; background: #fff1f0; border-color: #ffa39e; }
.tag.gold { color: #d48806; background: #fffbe6; border-color: #ffe58f; }

.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 16px; color: var(--text-secondary); }

.card { border: 1px solid #f0f0f0; border-radius: var(--radius-lg); padding: 20px 24px; margin-bottom: 16px; background: var(--bg); }
.card h4 { font-size: 16px; margin-bottom: 4px; }
.card .help { color: var(--text-secondary); margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.form-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.danger-zone { border-color: var(--error-border); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 24px; margin: 0; }
.facts dt { color: var(--text-secondary); }
.facts dd { margin: 0; }
.layout-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; align-items: start; }

code { font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace; font-size: 12px; background: var(--fill-tertiary); padding: 1px 4px; border-radius: 4px; }

@media (max-width: 900px) {
    .auth-image { display: none; }
    .auth-panel { padding: 24px; }
    .layout-2 { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .admin { flex-direction: column; height: auto; min-height: 100vh; overflow: visible; }
    .sider { width: auto; }
    .sider-logo { padding: 16px; }
    .menu { display: flex; flex-wrap: wrap; gap: 4px; }
    .menu li { flex: 0 0 auto; }
    .sider-spacer, .sider-user { display: none; }
    .admin-main { margin-left: 0; overflow: visible; }
    .admin-content { padding: 16px; height: auto; }
    .grid-2 { grid-template-columns: 1fr; }
    .toolbar input[type=search] { width: 100%; }
    .plain-header { padding: 16px; }
}
.check-note { margin-top: 32px; }
button.link:disabled { background: none; border: 0; color: var(--text-secondary); cursor: default; }
input::placeholder { color: rgba(0, 0, 0, 0.25); }
/* The empty validation summary hides itself with an inline style, which the CSP blocks. */
.validation-summary-valid { display: none; }
.menu form button { justify-content: flex-start; }
textarea { resize: vertical; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace; font-size: 13px; line-height: 1.6; }
