/**
 * auth-login.css — split-screen login experience.
 * Used only by _LayoutAuthSplit.cshtml (Login + LoginWith2fa). Tokens come from theme-tokens.css.
 *
 * Layout:  [ brand panel (left) ]  [ form panel (right) ]
 * On narrow viewports the two panels stack (brand becomes a slim top banner).
 */

html,
body.pci-auth {
    height: 100%;
    margin: 0;
}

body.pci-auth {
    font-family: var(--pci-font-family);
    color: var(--pci-text);
    background-color: var(--pci-card-bg);
}

.pci-auth-split {
    display: flex;
    min-height: 100vh;
}

/* ------------------------------------------------------------------ *
 * Brand panel (left)
 * ------------------------------------------------------------------ */
.pci-auth-brand {
    position: relative;
    flex: 1 1 60%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem;
    color: var(--pci-on-brand);
    /* Brand-blue wash over the photo. background-color is the fallback if
       color-mix() is unsupported. */
    background-color: var(--pci-primary);
    background-image:
        linear-gradient(color-mix(in srgb, var(--pci-primary) 86%, transparent), color-mix(in srgb, var(--pci-primary) 86%, transparent)),
        url('/images/login_partial_background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

.pci-auth-brand-center {
    position: relative;
    z-index: 1;
    max-width: 34rem;
}

/* P-MEX wordmark — the product brand, rendered as type. */
.pci-auth-brand-title {
    font-size: clamp(3rem, 6vw, 4.5rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: 0.02em;
    margin: 0 0 0.75rem;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.28);
}

.pci-auth-brand-subtitle {
    font-size: clamp(1rem, 1.6vw, 1.2rem);
    font-weight: 400;
    opacity: 0.92;
    margin: 0;
    letter-spacing: 0.04em;
}

/* ------------------------------------------------------------------ *
 * Form panel (right)
 * ------------------------------------------------------------------ */
.pci-auth-form {
    position: relative;
    flex: 1 1 40%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    background-color: var(--pci-surface);
}

/* PSI logo — pinned top-right, prominent. */
.pci-auth-psi {
    position: absolute;
    top: 2rem;
    right: 2.25rem;
    z-index: 1;
    height: 64px;
}

.pci-auth-form-inner {
    width: 100%;
    max-width: 25rem;
    text-align: center; /* centre the heading, subtitle, divider and footer text */
}

.pci-auth-heading {
    color: var(--pci-primary);
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0 0 0.35rem;
}

.pci-auth-subtitle {
    color: var(--pci-text-muted);
    font-size: 0.98rem;
    margin: 0 0 1.75rem;
}

/* Floating-label fields — the placeholder=" " idiom keeps the label and
   placeholder from overlapping. */
.pci-auth-form .form-floating {
    margin-bottom: 0.85rem;
    text-align: left;
}

.pci-auth-form .form-control {
    border-radius: var(--pci-radius-sm);
}

.pci-auth-form .form-floating > .form-control:focus,
.pci-auth-form .form-floating > .form-control:not(:placeholder-shown) {
    border-color: var(--pci-primary);
}

.pci-auth-form .form-floating > .form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(21, 82, 156, 0.15);
}

.pci-auth-form .form-floating > label {
    color: var(--pci-text-muted);
}

/* Buttons */
.pci-auth-form .btn {
    border-radius: var(--pci-radius-sm);
    font-weight: 500;
    padding: 0.7rem 1rem;
    transition: background-color var(--pci-transition), transform var(--pci-transition), box-shadow var(--pci-transition);
}

.pci-auth-form .btn-primary {
    background-color: var(--pci-primary);
    border-color: var(--pci-primary);
    color: var(--pci-on-brand);
}

.pci-auth-form .btn-primary:hover,
.pci-auth-form .btn-primary:focus {
    background-color: var(--pci-primary-dark);
    border-color: var(--pci-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--pci-shadow-brand);
}

/* Microsoft SSO button — quiet outline that lifts on hover. */
.pci-auth-form .pci-btn-ms {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    background-color: #fff;
    border: 1px solid var(--pci-border);
    color: var(--pci-text);
    font-weight: 500;
}

.pci-auth-form .pci-btn-ms:hover,
.pci-auth-form .pci-btn-ms:focus {
    background-color: #fff;
    border-color: var(--pci-primary);
    color: var(--pci-primary);
    transform: translateY(-1px);
    box-shadow: var(--pci-shadow-sm);
}

/* "oder" divider between password login and SSO */
.pci-auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0;
    color: var(--pci-text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.pci-auth-divider::before,
.pci-auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--pci-border);
}

.pci-auth-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 2.5rem;
    color: var(--pci-text-muted);
    font-size: 0.85rem;
}

.pci-auth-footer a {
    color: var(--pci-primary);
    text-decoration: none;
}

.pci-auth-footer a:hover {
    color: var(--pci-primary-dark);
    text-decoration: underline;
}

/* ------------------------------------------------------------------ *
 * Responsive — stack the panels under ~860px
 * ------------------------------------------------------------------ */
@media (max-width: 860px) {
    .pci-auth-split {
        flex-direction: column;
    }

    .pci-auth-brand {
        flex: 0 0 auto;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        padding: 1.25rem 1.5rem;
    }

    /* Slim banner: smaller wordmark, no subtitle. */
    .pci-auth-brand-title {
        font-size: 1.6rem;
        margin: 0;
    }

    .pci-auth-brand-subtitle {
        display: none;
    }

    /* Extra top padding so the centred form clears the pinned PSI logo. */
    .pci-auth-form {
        flex: 1 1 auto;
        padding: 4.5rem 1.25rem 2rem;
        align-items: flex-start;
    }

    .pci-auth-psi {
        top: 1.25rem;
        right: 1.5rem;
        height: 44px;
    }
}
