/* MapStaticAssets fingerprints this file, so its URL changes whenever the contents do. If a browser
   ever cached a bad response for one of those URLs (before Program.cs started returning 404 rather
   than redirecting missing assets to /login, a retired name answered with a 302 to an HTML page,
   which is cacheable), the only clean recovery is a fingerprint it has never seen. Editing this file
   at all produces one. */

html, body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---- App shell ---------------------------------------------------------- */

.page {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 15rem;
    flex-shrink: 0;
    background: #1f2937;
    color: #e5e7eb;
    /* Column flex so the Tech911 mark can be pushed to the bottom of the rail regardless of how
       many nav items the signed-in role happens to see. */
    display: flex;
    flex-direction: column;
}

.sidebar .nav-brand {
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.sidebar .nav-link {
    color: #cbd5e1;
    border-radius: .375rem;
    /* Roomier than Bootstrap's default: this rail has at most nine items and is read at a glance,
       so vertical breathing room matters more than fitting more in. */
    padding: .6rem .75rem;
    margin-bottom: .15rem;
    display: flex;
    align-items: center;
    gap: .7rem;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

.sidebar .nav-link.active {
    background: rgba(255, 255, 255, .12);
    color: #fff;
}

/* Zero-state count. Legible against the dark sidebar but deliberately quiet, so a non-zero
   warning badge is what draws the eye. */
.sidebar .nav-count-zero {
    background: rgba(255, 255, 255, .13);
    color: #cbd5e1;
    font-weight: 500;
}

main {
    flex: 1;
    min-width: 0;
}

.top-row {
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}

.content {
    padding-top: 1.5rem;
    padding-bottom: 3rem;
}

/* ---- Chrome-free pages (sign-in, customer connect) ---------------------- */

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    padding: 1.5rem;
}

.auth-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: .75rem;
    padding: 2rem;
    width: 100%;
    max-width: 24rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

/* Wider variant for the customer-facing connect page, which carries explanatory copy. */
.auth-card--wide {
    max-width: 34rem;
}

/* ---- Per-firm branding on the customer-facing connect page --------------- */
/* --brand / --brand-accent are set inline from the firm's record, after being validated as literal
   hex. The fallbacks keep an unbranded firm looking deliberate rather than broken. */

.brand-header {
    border-bottom: 3px solid var(--brand, #1f2937);
    padding-bottom: .75rem;
}

.brand-logo {
    max-height: 3rem;
    max-width: 100%;
}

.brand-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--brand, #1f2937);
}

.brand-btn {
    background: var(--brand, #1f2937);
    border-color: var(--brand, #1f2937);
    color: #fff;
}

.brand-btn:hover:not(:disabled),
.brand-btn:focus {
    background: var(--brand-accent, var(--brand, #111827));
    border-color: var(--brand-accent, var(--brand, #111827));
    color: #fff;
}

.brand-btn:disabled {
    opacity: .55;
}

/* The reassurance block on the connect page. Visually distinct from body copy because it answers
   the questions a customer actually has before granting bank access. */
.reassure {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: .5rem;
    padding: 1rem 1.15rem;
}

.reassure-item {
    font-size: .9rem;
    color: #374151;
}

.reassure-item + .reassure-item {
    margin-top: .7rem;
}

/* Brand color swatch on the admin firms list. */
.color-chip {
    display: inline-block;
    width: .75rem;
    height: .75rem;
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, .15);
    vertical-align: -1px;
    margin: 0 .25rem 0 .5rem;
}

/* Authenticator enrollment QR. Sized in rem so it tracks the user's text size, and framed in white
   because a QR on a tinted background is the classic reason a camera refuses to lock on. */
.qr-frame {
    display: inline-block;
    padding: 0.75rem;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
}

.qr {
    display: block;
    width: 11rem;
    height: 11rem;
}

/* ---- Sidebar icons, footer mark -------------------------------------------- */

.nav-icon {
    width: 1.15rem;
    height: 1.15rem;
    flex-shrink: 0;
    /* Slightly dimmer than the label so the wordmark stays what you read first. */
    opacity: .85;
}

.sidebar .nav-link:hover .nav-icon,
.sidebar .nav-link.active .nav-icon {
    opacity: 1;
}

/* margin-top:auto on the footer pins it to the bottom of the flex column. */
.nav-footer {
    margin-top: auto;
    padding: 1rem .9rem 1.15rem;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

/* Belt and braces with the width/height attributes on the <img>. The source is 1024x1024, so a
   missing or stale stylesheet must not be able to render it at intrinsic size. */
.nav-logo {
    width: 1.6rem;
    height: 1.6rem;
    max-width: 100%;
    /* Deliberately NOT filter: invert(1). The mark is a black ring with a white face and a red
       "911"; inverting turns that red cyan, which is worse than the ring simply blending into the
       dark rail. The white face carries the mark on this background on its own. */
    opacity: .9;
}

/* ---- Account menu ---------------------------------------------------------- */

.account-menu {
    position: relative;
}

.account-trigger {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    color: #4b5563;
    background: #f3f4f6;
}

/* Both are needed: WebKit uses the pseudo-element, everyone else honours list-style. */
.account-trigger::-webkit-details-marker { display: none; }
.account-trigger::marker { content: ""; }

.account-trigger:hover {
    background: #e5e7eb;
    color: #111827;
}

.account-menu[open] .account-trigger {
    background: #e5e7eb;
    color: #111827;
}

.account-icon {
    width: 1.3rem;
    height: 1.3rem;
}

.account-panel {
    position: absolute;
    right: 0;
    top: calc(100% + .5rem);
    z-index: 20;
    min-width: 14rem;
    padding: .35rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: .5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}

.account-email {
    padding: .5rem .65rem;
    margin-bottom: .25rem;
    border-bottom: 1px solid #f3f4f6;
    font-size: .82rem;
    color: #6b7280;
    /* Long addresses should wrap rather than widen the panel off the edge of the viewport. */
    overflow-wrap: anywhere;
}

.account-item {
    display: block;
    width: 100%;
    padding: .45rem .65rem;
    border: 0;
    border-radius: .375rem;
    background: none;
    text-align: left;
    font-size: .9rem;
    color: #374151;
    text-decoration: none;
}

.account-item:hover {
    background: #f3f4f6;
    color: #111827;
}

.account-signout {
    color: #b91c1c;
}

.account-signout:hover {
    background: #fef2f2;
    color: #991b1b;
}

/* ---- Banner dismiss -------------------------------------------------------- */

/* Replaces the old top-right Refresh link: navigates to the same page without msg/msgType, so a
   message that has been read does not come back on reload. */
.alert-dismiss {
    line-height: 1;
    font-size: 1.35rem;
    text-decoration: none;
    color: inherit;
    opacity: .45;
}

.alert-dismiss:hover {
    opacity: .9;
    color: inherit;
}
