/* Sign-in and password pages (SSRS web portal look: blue bar, red brand tile). */
:root {
    --auth-blue: #0b4a80;
    --auth-red: #c4262e;
    --auth-bg: #f3f2f1;
    --auth-card: #ffffff;
    --auth-text: #201f1e;
    --auth-muted: #605e5c;
    --auth-line: #c8c6c4;
    --auth-focus: #0078d4;
    --auth-error-bg: #fde7e9;
    --auth-error: #a4262c;
    --auth-ok: #107c10;
}
@media (prefers-color-scheme: dark) {
    :root {
        --auth-bg: #1b1a19;
        --auth-card: #252423;
        --auth-text: #f3f2f1;
        --auth-muted: #c8c6c4;
        --auth-line: #484644;
        --auth-error-bg: #442726;
        --auth-error: #f1707b;
        --auth-ok: #6ccb5f;
    }
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.auth-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--auth-bg);
    color: var(--auth-text);
    font: 14px/1.45 "Segoe UI", system-ui, -apple-system, sans-serif;
}
.auth-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 48px;
    background: var(--auth-blue);
    color: #fff;
}
.auth-brand-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--auth-red);
}
.auth-brand-tile svg { width: 22px; height: 22px; color: #fff; }
.auth-brand-name { font-size: 16px; }
.auth-bar-signout { margin-left: auto; margin-right: 12px; }
.auth-bar-signout button {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: #fff;
    padding: 4px 12px;
    border-radius: 2px;
    font: inherit;
    cursor: pointer;
}
.auth-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card {
    width: min(400px, 100%);
    background: var(--auth-card);
    border: 1px solid var(--auth-line);
    border-radius: 4px;
    padding: 32px 32px 24px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}
.auth-logo { display: block; height: 52px; margin: 0 0 18px; }
.auth-card h1 { margin: 0 0 4px; font-size: 22px; font-weight: 600; }
.auth-sub { margin: 0 0 18px; color: var(--auth-muted); }
.auth-alert {
    margin: 0 0 16px;
    padding: 10px 12px;
    border-left: 4px solid var(--auth-error);
    background: var(--auth-error-bg);
    color: var(--auth-error);
}
.auth-form { display: flex; flex-direction: column; }
.auth-form label { margin: 10px 0 4px; font-weight: 600; font-size: 13px; }
.auth-form input {
    width: 100%;
    height: 36px;
    padding: 6px 10px;
    border: 1px solid var(--auth-line);
    border-radius: 2px;
    background: var(--auth-card);
    color: var(--auth-text);
    font: inherit;
}
.auth-form input:focus { outline: 2px solid var(--auth-focus); outline-offset: -1px; border-color: var(--auth-focus); }
.auth-password { position: relative; }
.auth-password input { padding-right: 64px; }
.auth-reveal {
    position: absolute;
    right: 4px;
    top: 4px;
    height: 28px;
    padding: 0 10px;
    border: 0;
    background: transparent;
    color: var(--auth-focus);
    font: inherit;
    cursor: pointer;
}
.auth-caps { margin: 6px 0 0; color: var(--auth-error); font-size: 12px; }
.auth-submit {
    margin-top: 20px;
    height: 38px;
    border: 0;
    border-radius: 2px;
    background: var(--auth-blue);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.auth-submit:hover { background: #093c68; }
.auth-submit:disabled { opacity: 0.7; cursor: progress; }
.auth-submit:focus-visible, .auth-reveal:focus-visible, .auth-cancel:focus-visible { outline: 2px solid var(--auth-focus); outline-offset: 2px; }
.auth-cancel { margin-top: 12px; text-align: center; color: var(--auth-focus); }
.auth-help { margin: 18px 0 0; color: var(--auth-muted); font-size: 12px; }
.auth-rules { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; font-size: 12px; color: var(--auth-muted); }
.auth-rules li::before { content: "○ "; }
.auth-rules li.ok { color: var(--auth-ok); }
.auth-rules li.ok::before { content: "✓ "; }
.auth-footer { padding: 12px 16px; text-align: center; color: var(--auth-muted); font-size: 12px; }
@media (max-width: 480px) {
    .auth-card { padding: 24px 18px 18px; }
    .auth-rules { grid-template-columns: 1fr; }
}

/* ── Sign-in: split screen (brand panel + form) ─────────────────────────────── */
.auth-signin {
    --si-navy: #0a2540;
    --si-navy-2: #0b4a80;
    --si-accent: #2bb673;
    --si-panel: #ffffff;
    --si-field: #f7f8fa;
    --si-field-line: #d6dbe1;
    --si-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 12px 32px rgba(16, 24, 40, 0.08);
}
@media (prefers-color-scheme: dark) {
    .auth-signin {
        --si-panel: #1f1e1d;
        --si-field: #2a2928;
        --si-field-line: #4a4846;
        --si-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.35);
    }
}
/* minmax(0, ...): long text (e.g. an email) must not widen the column past the screen. */
.signin-shell { display: grid; grid-template-columns: minmax(380px, 46%) minmax(0, 1fr); min-height: 100vh; }

.signin-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 32px 48px 40px;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 85% 12%, rgba(43, 182, 115, 0.22), transparent 42%),
        radial-gradient(circle at 10% 95%, rgba(0, 120, 212, 0.35), transparent 50%),
        linear-gradient(160deg, var(--si-navy-2) 0%, var(--si-navy) 70%);
}
.signin-brand::before {
    /* faint report grid */
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
    pointer-events: none;
}
.signin-brand > * { position: relative; }
.signin-brand-top { display: flex; align-items: center; gap: 12px; }
.signin-brand .auth-brand-tile { width: 40px; height: 40px; border-radius: 8px; }
.signin-brand .auth-brand-tile svg { width: 20px; height: 20px; }
.signin-brand-name { font-size: 17px; font-weight: 600; letter-spacing: 0.2px; }

.signin-art { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 220px; }
.signin-art-svg { width: min(420px, 100%); height: auto; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.3)); }
.art-sheet { fill: #ffffff; }
.art-sheet-2 { fill: rgba(255, 255, 255, 0.55); }
.art-sheet-3 { fill: rgba(255, 255, 255, 0.25); }
.art-ink { fill: #c9d3df; }
.art-ink-strong { fill: #0b4a80; }
.art-logo-chip { fill: #e8f6ee; }
.art-bars rect { fill: #9cc3e6; }
.art-bars .art-bar-accent { fill: var(--si-accent); }
.art-rule, .art-col { stroke: #d9e0e8; stroke-width: 1; }
.art-tile { fill: #f1f5f9; }
.art-header-row { fill: #0b4a80; }
.art-rows rect { fill: #f1f5f9; }
.art-total-row { fill: #dbe7f3; }
.art-badge { fill: var(--si-accent); }
.art-badge-ink { fill: #fff; }
.art-badge-stroke { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; }

.signin-pitch h2 { margin: 0 0 18px; max-width: 30ch; font-size: 24px; line-height: 1.3; font-weight: 600; }
.signin-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.signin-points li { display: flex; align-items: center; gap: 12px; color: rgba(255, 255, 255, 0.86); }
.pt-icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
}
.pt-icon svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.signin-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px 16px; }
.signin-card {
    width: min(420px, 100%);
    padding: 36px 36px 28px;
    background: var(--si-panel);
    border: 1px solid var(--auth-line);
    border-radius: 12px;
    box-shadow: var(--si-shadow);
}
.signin-logo {
    /* The logo image has a white background, so it sits on a white badge (also in dark mode). */
    display: inline-flex;
    padding: 8px 12px;
    margin-bottom: 22px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e6e9ee;
}
.signin-logo img { display: block; height: 40px; width: auto; }
.signin-card h1 { margin: 0 0 4px; font-size: 26px; font-weight: 600; letter-spacing: -0.2px; }
.signin-card .auth-sub { margin-bottom: 22px; }

.signin-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 18px;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--auth-error) 35%, transparent);
    border-radius: 8px;
    background: var(--auth-error-bg);
    color: var(--auth-error);
}
.signin-alert svg { flex: none; width: 18px; height: 18px; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.signin-form { display: flex; flex-direction: column; }
.signin-form label { margin: 12px 0 6px; font-size: 13px; font-weight: 600; }
.signin-field { position: relative; display: flex; align-items: center; }
.signin-field > svg {
    position: absolute;
    left: 12px;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: var(--auth-muted);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}
.signin-field input {
    width: 100%;
    height: 44px;
    padding: 0 12px 0 40px;
    border: 1px solid var(--si-field-line);
    border-radius: 8px;
    background: var(--si-field);
    color: var(--auth-text);
    font: inherit;
    font-size: 15px;
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.signin-field input::placeholder { color: var(--auth-muted); opacity: 0.7; }
.signin-field input:hover { border-color: var(--auth-muted); }
.signin-field input:focus {
    outline: none;
    border-color: var(--auth-focus);
    background: var(--si-panel);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--auth-focus) 25%, transparent);
}
.signin-field input#password { padding-right: 46px; }
/* Edge draws its own reveal button inside password boxes; these pages have their own. */
.signin-field input::-ms-reveal, .signin-field input::-ms-clear { display: none; }
.signin-field input[data-revealable] { padding-right: 46px; }
.signin-reveal {
    position: absolute;
    right: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--auth-muted);
    cursor: pointer;
}
.signin-reveal:hover { color: var(--auth-text); background: color-mix(in srgb, var(--auth-muted) 14%, transparent); }
.signin-reveal svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
/* SVG ignores the hidden attribute, so the eye icons switch on the button's pressed state. */
.signin-reveal .eye-closed, .signin-reveal[aria-pressed="true"] .eye-open { display: none; }
.signin-reveal[aria-pressed="true"] .eye-closed { display: block; }
.signin-caps { margin: 6px 0 0; color: var(--auth-error); font-size: 12px; }

.signin-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    height: 46px;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(180deg, #0f5a99, var(--si-navy-2));
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(11, 74, 128, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transition: filter 0.15s, transform 0.05s;
}
.signin-submit svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.15s; }
.signin-submit:hover { filter: brightness(1.08); }
.signin-submit:hover svg { transform: translateX(3px); }
.signin-submit:active { transform: translateY(1px); }
.signin-submit:disabled { opacity: 0.75; cursor: progress; }
.signin-submit:focus-visible, .signin-reveal:focus-visible { outline: 2px solid var(--auth-focus); outline-offset: 2px; }

.signin-help { margin: 20px 0 0; color: var(--auth-muted); font-size: 12.5px; }
.signin-secure {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--auth-line);
    color: var(--auth-muted);
    font-size: 12px;
}
.signin-secure svg { flex: none; width: 15px; height: 15px; fill: none; stroke: var(--auth-ok); stroke-width: 1.6; stroke-linecap: round; }
.signin-footer { margin-top: 20px; color: var(--auth-muted); font-size: 12px; }

/* ── Change password (shares the sign-in layout) ───────────────────────────── */
.pw-art-ring { fill: none; stroke: rgba(255, 255, 255, 0.12); stroke-width: 1.5; stroke-dasharray: 4 7; }
.pw-art-ring-2 { stroke: rgba(43, 182, 115, 0.35); stroke-dasharray: none; }
.pw-art-shield { fill: #ffffff; }
.pw-art-shield-shade { fill: #e6eef6; }
.pw-art-keyhole { fill: #0b4a80; }
.pw-art-card { fill: rgba(255, 255, 255, 0.95); }
.pw-art-dot { fill: #0b4a80; }
.pw-art-ok { fill: var(--si-accent); }

.pw-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    padding: 10px 12px;
    border: 1px solid var(--auth-line);
    border-radius: 10px;
    background: var(--si-field);
}
.pw-avatar {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0f5a99, var(--si-accent));
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.pw-identity-text { display: flex; flex-direction: column; min-width: 0; }
.pw-identity-text strong { font-size: 14px; }
.pw-identity-text span { color: var(--auth-muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pw-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.pw-meter span { height: 5px; border-radius: 3px; background: var(--si-field-line); transition: background-color 0.2s; }
.pw-meter[data-level="1"] span:nth-child(-n+1) { background: #d13438; }
.pw-meter[data-level="2"] span:nth-child(-n+2) { background: #ca5010; }
.pw-meter[data-level="3"] span:nth-child(-n+3) { background: #2b88d8; }
.pw-meter[data-level="4"] span { background: var(--si-accent); }
.pw-strength { margin: 6px 0 0; font-size: 12px; color: var(--auth-muted); }
.pw-strength strong { color: var(--auth-text); font-weight: 600; }

.pw-rules { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 2px; padding: 0; }
.pw-rules li {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px 3px 8px;
    border: 1px solid var(--si-field-line);
    border-radius: 999px;
    color: var(--auth-muted);
    font-size: 12px;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.pw-rules li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor; }
.pw-rules li.ok { border-color: color-mix(in srgb, var(--auth-ok) 45%, transparent); background: color-mix(in srgb, var(--auth-ok) 12%, transparent); color: var(--auth-ok); }
.pw-rules li.ok::before { content: "✓"; width: auto; height: auto; border: 0; font-size: 11px; font-weight: 700; line-height: 1; }

.pw-match { position: absolute; right: 12px; width: 18px; height: 18px; border-radius: 50%; }
.pw-match.ok { background: var(--auth-ok); }
.pw-match.ok::after { content: "✓"; display: block; color: #fff; font-size: 12px; font-weight: 700; line-height: 18px; text-align: center; }
.pw-match.bad { background: var(--auth-error); }
.pw-match.bad::after { content: "!"; display: block; color: #fff; font-size: 12px; font-weight: 700; line-height: 18px; text-align: center; }
#confirm_password { padding-right: 40px; }

.pw-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }
.pw-footer .pw-signout { margin-left: auto; }
.pw-link { padding: 0; border: 0; background: none; color: var(--auth-focus); font: inherit; font-size: 13px; cursor: pointer; text-decoration: none; }
.pw-link:hover { text-decoration: underline; }
.pw-link:focus-visible { outline: 2px solid var(--auth-focus); outline-offset: 2px; border-radius: 2px; }

@media (prefers-reduced-motion: reduce) {
    .signin-field input, .signin-submit, .signin-submit svg, .pw-meter span, .pw-rules li { transition: none; }
}
@media (max-width: 900px) {
    .signin-shell { grid-template-columns: minmax(0, 1fr); }
    .signin-brand { padding: 18px 20px; gap: 0; }
    .signin-art, .signin-pitch { display: none; }
    .signin-panel { justify-content: flex-start; padding: 28px 16px 16px; }
}
@media (max-width: 480px) {
    .signin-card { padding: 26px 20px 20px; border-radius: 10px; }
}
