﻿/* ============================================================
   BizRatings — login.css
   Email-first SSO state machine styles
   Used only by login.html (additive on top of common.css + userhome.css)
   ============================================================ */

/* SR-only status host */
.br-login-sr {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* State containers — show/hide via [hidden] (don't override with display) */
.br-login-state[hidden] {
    display: none !important;
}

/* IDLE divider */
.br-login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
    color: var(--muted-fg, #94a3b8);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

    .br-login-divider::before,
    .br-login-divider::after {
        content: "";
        flex: 1;
        height: 1px;
        background: rgba(0,0,0,0.08);
    }

/* SSO buttons (Microsoft) */
.br-sso-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: #fff;
    color: #1a1a1a;
    border: 1px solid rgba(0,0,0,0.18);
    border-radius: 8px;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

    .br-sso-btn:hover {
        background: #f7f8fa;
        border-color: rgba(0,0,0,0.28);
    }

    .br-sso-btn:focus {
        outline: 2px solid var(--brand-blue);
        outline-offset: 2px;
    }

    .br-sso-btn[aria-disabled="true"] {
        opacity: 0.6;
        pointer-events: none;
    }

.br-sso-ms-logo {
    width: 18px;
    height: 18px;
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 2px;
}

    .br-sso-ms-logo span {
        display: block;
    }

        .br-sso-ms-logo span:nth-child(1) {
            background: #f25022;
        }

        .br-sso-ms-logo span:nth-child(2) {
            background: #7fba00;
        }

        .br-sso-ms-logo span:nth-child(3) {
            background: #00a4ef;
        }

        .br-sso-ms-logo span:nth-child(4) {
            background: #ffb900;
        }

/* RESOLVING spinner */
.br-login-resolving {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: hsl(213, 80%, 97%);
    border: 1px solid hsl(213, 60%, 88%);
    border-radius: 8px;
    color: var(--brand-blue);
    font-size: 13px;
    font-weight: 500;
}

.br-login-spin {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(55, 114, 255, 0.25);
    border-top-color: var(--brand-blue);
    border-radius: 50%;
    animation: brLoginSpin 0.8s linear infinite;
}

@keyframes brLoginSpin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .br-login-spin {
        animation: none;
        border-top-color: var(--brand-blue);
    }
}

/* SSO match card */
.br-login-sso-card {
    padding: 18px;
    background: hsl(213, 60%, 98%);
    border: 1px solid hsl(213, 50%, 86%);
    border-radius: 12px;
    margin-bottom: 14px;
}

.br-login-sso-org {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #011B38;
    margin-bottom: 4px;
}

    .br-login-sso-org strong {
        font-weight: 700;
    }

.br-login-sso-sub {
    font-size: 12px;
    color: var(--muted-fg, #64748b);
    margin-bottom: 14px;
}

.br-login-reset-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 12px;
    color: var(--brand-blue);
    text-decoration: none;
    cursor: pointer;
    background: none;
    border: 0;
    padding: 0;
}

    .br-login-reset-link:hover {
        text-decoration: underline;
    }

/* PASSWORD state nudge for unknown domain */
.br-login-unknown-nudge {
    margin: 8px 0 14px;
    padding: 10px 12px;
    background: hsl(45, 100%, 96%);
    border: 1px solid hsl(45, 80%, 80%);
    border-radius: 8px;
    font-size: 12px;
    color: hsl(35, 70%, 25%);
}

    .br-login-unknown-nudge a {
        color: var(--brand-blue);
        font-weight: 600;
        text-decoration: none;
    }

        .br-login-unknown-nudge a:hover {
            text-decoration: underline;
        }

/* Lookup error (timeout / failure) */
.br-login-lookup-error {
    margin: 8px 0 14px;
    padding: 10px 12px;
    background: hsl(0, 80%, 97%);
    border: 1px solid hsl(0, 60%, 85%);
    border-radius: 8px;
    font-size: 12px;
    color: hsl(0, 60%, 30%);
}

/* Inline form error */
.br-login-error {
    margin: 0 0 14px;
    padding: 10px 12px;
    background: hsl(0,80%,96%);
    color: hsl(0,70%,30%);
    border: 1px solid hsl(0,60%,82%);
    border-radius: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Secondary actions row */
.br-login-secondary {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
    color: var(--muted-fg, #64748b);
}

    .br-login-secondary a {
        color: var(--brand-blue);
        text-decoration: none;
        font-weight: 500;
    }

        .br-login-secondary a:hover {
            text-decoration: underline;
        }

.br-login-secondary-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.br-login-footer-links {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(0,0,0,0.06);
    font-size: 11px;
    color: var(--muted-fg, #94a3b8);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

    .br-login-footer-links a {
        color: var(--muted-fg, #64748b);
    }

    .br-login-footer-links span {
        opacity: 0.5;
    }

/* "Use SSO instead" inline hint popover */
.br-login-sso-hint {
    margin-top: 8px;
    padding: 10px 12px;
    background: hsl(213, 60%, 97%);
    border: 1px solid hsl(213, 50%, 88%);
    border-radius: 6px;
    font-size: 12px;
    color: #011B38;
}

/* Toast */
.br-login-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 18px;
    background: #011B38;
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    z-index: 9999;
    animation: brLoginToastIn 200ms ease-out;
}

@keyframes brLoginToastIn {
    from {
        opacity: 0;
        transform: translate(-50%, 8px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* AOS fallback per memory rule — ensure visible if AOS fails */
[data-aos]:not(.aos-animate) {
    opacity: 1;
}

/* ============================================================
   Hybrid centered-card SSOT (v3.51) — login + register
   Brand panel becomes ambient backdrop; form lifts into a
   centered floating card with sticky close affordance.
   ============================================================ */

.br-login-page {
    position: relative;
    min-height: 100vh;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-align: center;
    align-items: center;
    -ms-flex-pack: center;
    justify-content: center;
    padding: 32px 16px;
    background: radial-gradient(1200px 600px at 20% 0%, rgba(10,74,140,0.18) 0%, transparent 60%), radial-gradient(900px 500px at 100% 100%, rgba(1,27,56,0.20) 0%, transparent 60%), linear-gradient(160deg, #011B38 0%, #082a55 100%);
    overflow: hidden;
}

/* Ambient backdrop layer (lifted brand content from the old left panel) */
.br-login-backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-direction: column;
    flex-direction: column;
    -ms-flex-pack: center;
    justify-content: center;
    -ms-flex-align: start;
    align-items: flex-start;
    padding: 48px 8% 48px 8%;
    color: #fff;
    opacity: 0.32;
    filter: blur(0.4px);
}

    .br-login-backdrop > * {
        max-width: 520px;
    }

    .br-login-backdrop .br-pill,
    .br-login-backdrop h1,
    .br-login-backdrop p,
    .br-login-backdrop > div {
        color: rgba(255,255,255,0.92);
    }

    .br-login-backdrop h1 {
        font-size: 38px;
        font-weight: 800;
        letter-spacing: -0.5px;
        line-height: 1.15;
        margin: 14px 0 12px;
    }

    .br-login-backdrop .br-uh-brand-subtitle {
        font-size: 15px;
        line-height: 1.55;
    }

    .br-login-backdrop .br-uh-brand-checks {
        margin-top: 18px;
        font-size: 13px;
    }

        .br-login-backdrop .br-uh-brand-checks div {
            display: flex;
            align-items: center;
            gap: 8px;
            margin: 6px 0;
        }

    .br-login-backdrop .br-uh-brand-footer {
        margin-top: 24px;
        font-size: 12px;
        opacity: 0.85;
        text-transform: uppercase;
        letter-spacing: 1.2px;
    }

    .br-login-backdrop .br-auth-circle {
        display: none;
    }
/* keep backdrop calm */

@media (max-width: 991px) {
    .br-login-backdrop {
        display: none;
    }
}

/* The floating card */
.br-login-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 520px;
    max-height: 88vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(1,27,56,0.32);
    padding: 32px;
}

.br-login-card--wide {
    max-width: 720px;
}
/* register has more fields */

@media (max-width: 540px) {
    .br-login-card {
        padding: 24px;
        border-radius: 14px;
        max-height: 92vh;
    }
}

/* Sticky close affordance */
.br-login-card-close {
    position: -webkit-sticky;
    position: sticky;
    top: -8px;
    z-index: 3;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-align: center;
    align-items: center;
    -ms-flex-pack: justify;
    justify-content: space-between;
    margin: -16px -8px 14px;
    padding: 8px 8px 10px;
    background: linear-gradient(#fff 70%, rgba(255,255,255,0));
}

.br-login-card-back {
    display: -ms-inline-flexbox;
    display: inline-flex;
    -ms-flex-align: center;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    text-decoration: none;
    transition: background 120ms ease, color 120ms ease;
}

    .br-login-card-back:hover,
    .br-login-card-back:focus {
        background: #e2e8f0;
        color: #011B38;
        text-decoration: none;
        outline: none;
    }

.br-login-card-x {
    display: inline-flex;
    -ms-flex-align: center;
    align-items: center;
    -ms-flex-pack: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 50%;
    color: #64748b;
    font-size: 18px;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

    .br-login-card-x:hover,
    .br-login-card-x:focus {
        background: #f1f5f9;
        color: #011B38;
        border-color: #e2e8f0;
        outline: none;
    }

/* Brand mark inside the card */
.br-login-card-brand {
    margin: 4px 0 18px;
}

    .br-login-card-brand img {
        height: 32px;
        width: auto;
    }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .br-login-card-back, .br-login-card-x {
        transition: none;
    }
}

/* Dark-mode wash (only the page bg deepens; card stays white for legibility) */
body.dark-mode .br-login-page {
    background: radial-gradient(1200px 600px at 20% 0%, rgba(10,74,140,0.22) 0%, transparent 60%), radial-gradient(900px 500px at 100% 100%, rgba(1,27,56,0.32) 0%, transparent 60%), linear-gradient(160deg, #00122a 0%, #051c3a 100%);
}

/* ── Password eye-icon — scoped fix so it sits comfortably inside the card ── */
.br-login-card .br-input-password input {
    padding-right: 48px;
}

.br-login-card .br-input-password .br-eye-btn {
    right: 10px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    padding: 0;
    font-size: 16px;
    line-height: 1;
}

    .br-login-card .br-input-password .br-eye-btn:hover {
        background: rgba(15,36,53,0.06);
        color: #0F2435;
    }

    .br-login-card .br-input-password .br-eye-btn i {
        position: static;
        transform: none;
        left: auto;
        top: auto;
    }
