/**
 * Bien Admin Login — split card on dark ambient background
 * Distinct from Corporate: cooler steel-navy accents + security rail image
 * Font: Plus Jakarta Sans
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    /* Admin login accents (cooler / deeper than Corporate teal-blue) */
    --bien-blue: #1E3A5F;
    --bien-blue-deep: #152A45;
    --bien-teal: #2A6F7C;
    --bien-navy: #0a0f18;
    --bien-ink: #111827;
    --bien-muted: #6b7280;
    --bien-border: #e5e7eb;
    --bien-surface: #f9fafb;
    --bien-white: #ffffff;
    --bien-font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

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

body.bien-login-body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--bien-font);
    color: var(--bien-ink);
    background: #2a3448;
    -webkit-font-smoothing: antialiased;
}

.bien-login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.75rem, 1.8vw, 1.25rem);
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse 90% 70% at 12% 18%, rgba(30, 58, 95, 0.28), transparent 55%),
        radial-gradient(ellipse 80% 60% at 88% 82%, rgba(42, 111, 124, 0.12), transparent 50%),
        linear-gradient(160deg, #3a455c 0%, #323d52 45%, #2a3448 100%);
}

/* Soft ambient arcs + dotted mesh */
.bien-login-shell::before {
    content: '';
    position: absolute;
    inset: -20%;
    background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 22px 22px;
    opacity: 0.28;
    transform: rotate(-8deg);
    pointer-events: none;
}

.bien-login-shell::after {
    content: '';
    position: absolute;
    width: 120vmax;
    height: 120vmax;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.055);
    box-shadow:
        0 0 0 18vw rgba(255, 255, 255, 0.02),
        inset 0 0 0 22vw transparent;
    pointer-events: none;
}

.bien-login-card {
    position: relative;
    z-index: 1;
    width: min(1240px, 94vw);
    height: min(780px, 92vh);
    min-height: 560px;
    display: grid;
    grid-template-columns: minmax(220px, 0.68fr) minmax(360px, 1.32fr);
    background: #0a1018;
    border-radius: 22px;
    overflow: hidden;
    border: 0;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.25),
        0 28px 80px rgba(0, 0, 0, 0.55);
    clip-path: inset(0 round 22px);
}

/* ---------- Dark brand rail (quiet support, not competing) ---------- */
.bien-login-rail {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    padding: 2.25rem 1.75rem;
    color: var(--bien-white);
    background-color: #0a1018;
    background-image:
        linear-gradient(165deg, rgba(10, 16, 28, 0.92) 0%, rgba(12, 22, 38, 0.88) 48%, rgba(8, 14, 24, 0.94) 100%),
        radial-gradient(circle at 50% 18%, rgba(30, 58, 95, 0.45), transparent 52%),
        url('../front/images/background-admin.jpg');
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    overflow: hidden;
    border-top-left-radius: 22px;
    border-bottom-left-radius: 22px;
}

.bien-login-rail::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 18px 18px;
    opacity: 0.18;
    pointer-events: none;
}

.bien-login-rail::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(8, 12, 22, 0.2) 0%,
        transparent 38%,
        rgba(8, 12, 22, 0.45) 100%
    );
    pointer-events: none;
}

.bien-login-rail > * {
    position: relative;
    z-index: 1;
}

.bien-login-rail-brand {
    /* Sit on the same band as the vertically-centered “Sign in” */
    position: absolute;
    top: max(2.5rem, calc(50% - 15rem));
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.92);
    width: max-content;
}

.bien-login-rail-brand:hover {
    color: #fff;
}

.bien-login-rail-brand img {
    height: 30px;
    width: auto;
    display: block;
    filter: brightness(0) invert(1);
    opacity: 0.92;
}

.bien-login-rail-brand span {
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.bien-login-rail-copy {
    max-width: 12.5rem;
    margin-top: auto;
    margin-bottom: auto;
}

.bien-login-rail-copy h1 {
    margin: 0 0 0.45rem;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.88);
}

.bien-login-rail-copy p {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 400;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.48);
}

.bien-login-rail-badge {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    max-width: 14rem;
    text-align: left;
}

.bien-login-rail-badge-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(96, 165, 250, 0.14);
    color: #93c5fd;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.bien-login-rail-badge strong {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 0.08rem;
    color: rgba(255, 255, 255, 0.72);
}

.bien-login-rail-badge span {
    display: block;
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.3;
}

/* ---------- Form pane ---------- */
.bien-login-form-pane {
    display: flex;
    flex-direction: column;
    background: var(--bien-white);
    min-width: 0;
}

.bien-login-form-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.5rem clamp(2rem, 4.5vw, 4rem) 1.75rem;
    max-width: 460px;
    width: 100%;
    margin: 0 auto;
}

.bien-login-form-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.bien-login-form-header h2 {
    margin: 0 0 0.4rem;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--bien-ink);
}

.bien-login-form-header p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--bien-muted);
    line-height: 1.5;
}

.bien-login-form .mb-3 {
    margin-bottom: 1rem !important;
}

.bien-login-form .mb-4 {
    margin-bottom: 1.35rem !important;
}

.bien-login-form .form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 0.4rem;
}

.bien-login-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 0;
    overflow: hidden;
    background: var(--bien-white);
    border: 1px solid #d1d5db;
    border-radius: 8px;
}

.bien-login-toggle .btn-check + .btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: var(--bien-white) !important;
    color: var(--bien-blue) !important;
    font-weight: 500;
    font-size: 0.875rem;
    letter-spacing: -0.01em;
    min-height: 42px;
    padding: 0.55rem 0.75rem !important;
    box-shadow: none !important;
    transition: background 0.15s ease, color 0.15s ease;
}

.bien-login-toggle .btn-check + .btn:first-of-type {
    border-right: 1px solid #d1d5db !important;
}

.bien-login-toggle .btn-check + .btn i {
    font-size: 1rem;
    line-height: 1;
}

.bien-login-toggle .btn-check + .btn:hover {
    background: #f8fafc !important;
    color: var(--bien-blue-deep) !important;
}

.bien-login-toggle .btn-check:checked + .btn {
    background: var(--bien-blue) !important;
    color: var(--bien-white) !important;
    font-weight: 600;
    box-shadow: none !important;
}

.bien-login-toggle .btn-check:checked + .btn:hover {
    background: var(--bien-blue-deep) !important;
    color: var(--bien-white) !important;
}

/* Quiet Password / PIN switch — text only, no button weight */
.bien-login-cred-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.bien-login-auth-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.bien-login-auth-switch .btn-check {
    position: absolute;
    clip: rect(0, 0, 0, 0);
    pointer-events: none;
}

.bien-login-auth-switch-opt {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: #9ca3af;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s ease;
}

.bien-login-auth-switch-opt:hover {
    color: #6b7280;
}

.bien-login-auth-switch .btn-check:checked + .bien-login-auth-switch-opt {
    color: #6b7280;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 0.2em;
    text-decoration-thickness: 1px;
    text-decoration-color: #d1d5db;
}

.bien-login-auth-switch-sep {
    color: #d1d5db;
    font-size: 0.75rem;
    line-height: 1;
    user-select: none;
}

.bien-login-form .form-control,
.bien-login-form .input-group-text {
    min-height: 46px;
    border-radius: 10px;
    border-color: #c5cad3;
    font-size: 0.9rem;
    background: var(--bien-white);
}

.bien-login-form .form-control {
    padding: 0.65rem 0.95rem;
}

.bien-login-form .input-group-text {
    background: var(--bien-surface);
    color: var(--bien-muted);
    font-weight: 600;
    font-size: 0.8125rem;
}

.bien-login-form .form-control::placeholder {
    color: #9ca3af;
}

.bien-login-form .form-control:focus {
    border-color: var(--bien-blue);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.14);
}

.bien-login-form .input-group:focus-within .form-control,
.bien-login-form .input-group:focus-within .input-group-text {
    border-color: var(--bien-blue);
}

.bien-login-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.bien-login-form .form-check {
    padding-left: 1.55rem;
    margin: 0;
}

.bien-login-form .form-check-input {
    width: 1rem;
    height: 1rem;
    margin-top: 0.15rem;
    border-radius: 4px;
    border-color: #d1d5db;
}

.bien-login-form .form-check-input:checked {
    background-color: var(--bien-blue);
    border-color: var(--bien-blue);
}

.bien-login-form .form-check-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #4b5563;
}

.bien-login-forgot {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--bien-blue);
    text-decoration: none;
    white-space: nowrap;
}

.bien-login-forgot:hover {
    color: var(--bien-blue-deep);
    text-decoration: underline;
}

.bien-login-submit {
    min-height: 46px;
    border: 0 !important;
    border-radius: 10px !important;
    background: var(--bien-blue) !important;
    color: var(--bien-white) !important;
    font-family: var(--bien-font);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: -0.01em;
    box-shadow: none;
    transition: background 0.2s ease;
}

.bien-login-submit:hover,
.bien-login-submit:focus {
    background: var(--bien-blue-deep) !important;
    color: var(--bien-white) !important;
    box-shadow: none;
    transform: none;
}

.bien-login-submit:disabled {
    background: #e5e7eb !important;
    color: #9ca3af !important;
    box-shadow: none !important;
    transform: none !important;
}

.bien-login-help {
    margin: 1.35rem 0 0;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--bien-muted);
}

.bien-login-help a {
    color: var(--bien-ink);
    font-weight: 700;
    text-decoration: none;
}

.bien-login-help a:hover {
    color: var(--bien-blue);
}

.bien-login-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem clamp(2rem, 4.5vw, 4rem) 1.25rem;
    font-size: 0.7rem;
    color: #9ca3af;
    border-top: 1px solid #f3f4f6;
}

.bien-login-card-footer a {
    color: #9ca3af;
    text-decoration: none;
    font-weight: 500;
}

.bien-login-card-footer a:hover {
    color: var(--bien-blue);
}

.bien-login-form .password-addon {
    z-index: 5;
    height: 100%;
    padding-inline: 0.85rem;
    color: #9ca3af !important;
}

.bien-login-form .password-addon:hover {
    color: var(--bien-blue) !important;
}

/* Shared auth variants (forgot / OTP / reset) */
.bien-login-card--auto {
    height: auto;
    min-height: min(680px, 92vh);
}

.bien-login-form .form-text {
    font-size: 0.75rem;
    color: var(--bien-muted);
    margin-top: 0.35rem;
}

.bien-login-notice {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    border-radius: 12px;
    background: #f3f7f9;
    border: 1px solid #d5e3ea;
}

.bien-login-notice-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(30, 58, 95, 0.1);
    color: var(--bien-blue);
    font-size: 1.1rem;
}

.bien-login-notice strong {
    display: block;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--bien-ink);
    margin-bottom: 0.15rem;
}

.bien-login-notice span {
    display: block;
    font-size: 0.75rem;
    color: var(--bien-muted);
    line-height: 1.45;
}

.bien-login-otp {
    letter-spacing: 0.35em;
    text-align: center;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.25rem !important;
    font-weight: 700;
    padding-left: 0.5rem !important;
}

.bien-login-pin {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.55rem;
}

.bien-login-pin-digit {
    min-height: 52px !important;
    text-align: center !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    letter-spacing: 0;
    padding: 0.5rem 0.25rem !important;
    border-radius: 10px !important;
}

.bien-login-pin-digit.is-invalid {
    border-color: #dc3545 !important;
}

.bien-login-form .password-strength .progress {
    height: 5px;
    border-radius: 999px;
    background: #e5e7eb;
}

.bien-login-link-btn {
    border: 0;
    background: none;
    padding: 0;
    font: inherit;
    font-weight: 700;
    color: var(--bien-ink);
    cursor: pointer;
}

.bien-login-link-btn:hover {
    color: var(--bien-blue);
}

.bien-login-user {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.bien-login-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e5e7eb;
    margin-bottom: 0.35rem;
}

.bien-login-user strong {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--bien-ink);
}

.bien-login-user span {
    font-size: 0.75rem;
    color: var(--bien-muted);
}

.bien-login-reqs {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.bien-login-reqs strong {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--bien-ink);
    margin-bottom: 0.45rem;
}

.bien-login-reqs ul {
    padding-left: 1.1rem;
    font-size: 0.75rem;
    color: var(--bien-muted);
}

.bien-login-reqs li.is-valid {
    color: var(--bien-teal);
}

.bien-login-reqs li.is-invalid {
    color: #b91c1c;
}

/* ---------- Responsive ---------- */
@media (max-width: 767.98px) {
    .bien-login-shell {
        padding: 0.75rem;
        align-items: stretch;
    }

    .bien-login-card {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        width: 100%;
        height: auto;
        min-height: calc(100vh - 1.5rem);
        border-radius: 16px;
        clip-path: inset(0 round 16px);
    }

    /*
     * Mobile brand banner — same content width / rhythm as the form header
     * so logo → tagline → “Sign in” feel like one composition.
     */
    .bien-login-rail {
        justify-content: center;
        align-items: center;
        gap: 0.65rem;
        padding: 1.5rem 1.25rem 1.4rem;
        min-height: 0;
        border-radius: 16px 16px 0 0;
    }

    .bien-login-rail-brand {
        position: static;
        top: auto;
        left: auto;
        transform: none;
        width: auto;
        flex-direction: column;
        gap: 0.55rem;
    }

    .bien-login-rail-brand img {
        height: 40px;
        opacity: 1;
    }

    .bien-login-rail-brand span {
        font-size: 1.2rem;
        font-weight: 800;
        letter-spacing: -0.04em;
        line-height: 1.15;
        color: #fff;
    }

    .bien-login-rail-copy {
        max-width: 18rem;
        margin: 0;
    }

    .bien-login-rail-copy h1 {
        display: none;
    }

    .bien-login-rail-copy p {
        font-size: 0.9rem;
        font-weight: 500;
        line-height: 1.45;
        color: rgba(255, 255, 255, 0.68);
        letter-spacing: -0.015em;
    }

    .bien-login-rail-badge {
        display: none;
    }

    .bien-login-form-wrap {
        padding: 1.5rem 1.25rem 1.25rem;
        max-width: 100%;
    }

    .bien-login-form-header {
        margin-bottom: 1.5rem;
    }

    .bien-login-form-header h2 {
        font-size: 1.5rem;
    }

    .bien-login-form-header p {
        font-size: 0.875rem;
    }

    .bien-login-card-footer {
        flex-direction: column;
        text-align: center;
        padding-inline: 1.25rem;
    }
}
