/* Auth — centered split card (photo-2 / user reference). Soft page + glass form; tight logo plate. */
:root {
    /* Page: mid ocean — lighter than near-black, still blue family of the card */
    --auth-surface-1: #2a5f94;
    --auth-surface-2: #3d7ab0;
    --auth-panel: rgba(16, 28, 46, 0.55);
    --auth-pane-top: #1e4a8c;
    --auth-pane-bot: #3182ce;
    --auth-border: rgba(180, 210, 240, 0.28);
    --auth-text: #eef4fb;
    --auth-muted: #a8bbd4;
    --auth-input-bg: rgba(8, 16, 30, 0.45);
    --auth-input-text: #f8fafc;
    --auth-placeholder: #7b8ba3;
    --auth-primary: #3182ce;
    --auth-primary-hover: #4299e1;
    --auth-primary-deep: #2b6cb0;
    --auth-success: #10b981;
    --auth-success-deep: #059669;
    --auth-link: #63b3ed;
    --auth-card-max: 860px;
    --auth-shadow: 0 22px 50px rgba(8, 24, 48, 0.38);
}

body.auth-body {
    background:
        radial-gradient(ellipse 75% 55% at 50% 0%, rgba(160, 205, 255, 0.4) 0%, transparent 58%),
        linear-gradient(160deg, var(--auth-surface-1) 0%, var(--auth-surface-2) 100%);
    color: var(--auth-text);
    font-family: "Outfit", system-ui, sans-serif;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    box-sizing: border-box;
    position: relative;
    isolation: isolate;
}

body.auth-body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 45%, #000 15%, transparent 75%);
    opacity: 0.7;
}

.login-card {
    background-color: transparent;
    border: 1px solid var(--auth-border);
    border-radius: 16px;
    box-shadow: var(--auth-shadow);
    width: 100%;
    max-width: var(--auth-card-max);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: auth-card-in 0.4s ease-out both;
}

.auth-brand-pane,
.login-header {
    background: linear-gradient(165deg, var(--auth-pane-top) 0%, var(--auth-pane-bot) 100%);
    padding: 1.6rem 1.4rem 1.25rem;
    text-align: left;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-height: 220px;
}

.auth-brand-pane.login-header-success,
.login-header-success {
    background: linear-gradient(145deg, var(--auth-success-deep) 0%, var(--auth-success) 100%);
}

.auth-app-block {
    flex: 1;
}

.auth-brand-mark {
    font-size: 1.55rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.02em;
    margin: 0;
    animation: auth-brand-in 0.45s ease-out both;
}

.auth-brand-mark i {
    color: rgba(255, 255, 255, 0.95);
}

.login-header-subtitle {
    display: block;
    margin-top: 0.45rem;
    font-size: 0.98rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    animation: auth-brand-in 0.5s ease-out 0.06s both;
}

.auth-brand-tagline {
    display: block;
    margin: 0.85rem 0 0;
    font-size: 0.84rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.88);
    max-width: 16rem;
}

/* Slim white frame around cropped logo (reference card proportions) */
.auth-firm-logo-plate {
    background: #fff;
    border-radius: 8px;
    padding: 0.28rem 0.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
    max-width: 100%;
    line-height: 0;
}

.auth-firm-logo {
    display: block;
    width: min(300px, 100%);
    height: auto;
    border-radius: 4px;
}

.auth-form-pane,
.login-body {
    padding: 1.6rem 1.45rem 1.4rem;
    flex: 1;
    background: var(--auth-panel);
    display: flex;
    flex-direction: column;
    justify-content: center;
    backdrop-filter: blur(14px) saturate(1.15);
    -webkit-backdrop-filter: blur(14px) saturate(1.15);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-alert {
    font-size: 0.85rem;
    border: 1px solid transparent;
    border-radius: 10px;
}

.auth-body .auth-alert.alert-success {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
    color: #6ee7b7;
}

.auth-body .auth-alert.alert-danger {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

.auth-help-text {
    font-size: 0.75rem;
    color: var(--auth-muted);
}

.auth-footer-note {
    font-size: 0.7rem;
    color: var(--auth-muted);
    line-height: 1.45;
}

.auth-link {
    color: var(--auth-link);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}

.auth-link:hover {
    color: #90cdf4;
    text-decoration: underline;
}

.auth-body .form-label {
    color: var(--auth-text);
    font-size: 0.88rem;
}

.auth-body .text-muted {
    color: var(--auth-muted) !important;
}

.auth-body .input-group-text {
    background-color: var(--auth-input-bg);
    border: 1px solid var(--auth-border);
    color: var(--auth-muted);
    min-height: 44px;
}

.auth-body .form-control {
    background-color: var(--auth-input-bg);
    border: 1px solid var(--auth-border);
    color: var(--auth-input-text);
    border-radius: 10px;
    padding: 12px 16px;
    min-height: 44px;
}

.auth-body .form-control::placeholder {
    color: var(--auth-placeholder);
    opacity: 1;
}

.auth-body .input-group .form-control {
    border-radius: 0 10px 10px 0;
}

.auth-body .input-group-text:first-child {
    border-radius: 10px 0 0 10px;
}

.auth-body .form-control:focus {
    background-color: var(--auth-input-bg);
    border-color: var(--auth-primary);
    color: var(--auth-input-text);
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.28);
}

.btn-login {
    background: linear-gradient(135deg, var(--auth-primary) 0%, var(--auth-primary-hover) 100%);
    border: none;
    color: #fff;
    padding: 12px;
    border-radius: 10px;
    font-weight: 700;
    transition: transform 0.2s, box-shadow 0.2s;
    min-height: 44px;
    box-shadow: 0 8px 20px rgba(49, 130, 206, 0.35);
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(49, 130, 206, 0.45);
    color: #fff;
}

.btn-login:focus-visible {
    outline: 2px solid var(--auth-link);
    outline-offset: 2px;
}

.btn-login-success {
    background: linear-gradient(135deg, var(--auth-success) 0%, var(--auth-success-deep) 100%);
}

.btn-login-success:hover {
    box-shadow: 0 10px 24px rgba(16, 185, 129, 0.35);
    color: #fff;
}

@keyframes auth-brand-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes auth-card-in {
    from { opacity: 0; transform: translateY(10px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .auth-brand-mark,
    .login-header-subtitle,
    .login-card,
    .btn-login {
        animation: none !important;
        transition: none !important;
    }
}

.auth-otp-card {
    border-radius: 18px;
    background: var(--card-bg) !important;
    color: var(--text-color);
}

.auth-otp-title {
    color: var(--text-color) !important;
}

/* Mobile: app-like stack — brand + compact firm logo on top, form below */
@media (max-width: 576px) {
    body.auth-body {
        align-items: flex-start;
        padding-top: max(1.1rem, env(safe-area-inset-top));
    }

    .login-card {
        border-radius: 14px;
    }

    .auth-brand-pane,
    .login-header {
        /* auth-mobile-logo-minimal */
        min-height: 0;
        padding: 1.15rem 1.15rem 1rem;
        text-align: center;
        align-items: center;
        gap: 0.85rem;
    }

    .auth-brand-mark {
        font-size: 1.35rem;
    }

    .login-header-subtitle {
        font-size: 0.9rem;
    }

    .auth-brand-tagline {
        margin-left: auto;
        margin-right: auto;
        font-size: 0.78rem;
    }

    .auth-firm-logo-plate {
        align-self: center;
        padding: 0.22rem 0.32rem;
    }

    .auth-firm-logo {
        width: min(220px, 72vw);
    }

    .auth-form-pane,
    .login-body {
        padding: 1.25rem 1.15rem 1.25rem;
    }
}

/* Desktop: side-by-side brand | form (photo-1/2) */
@media (min-width: 768px) {
    .login-card {
        flex-direction: row;
        align-items: stretch;
        min-height: 440px;
    }

    .auth-brand-pane,
    .login-header {
        flex: 0 0 42%;
        max-width: 42%;
        padding: 2rem 1.6rem 1.5rem;
        min-height: auto;
        justify-content: space-between;
    }

    .auth-form-pane,
    .login-body {
        flex: 1;
        padding: 2rem 1.75rem;
    }

    .auth-firm-logo {
        width: min(300px, 100%);
    }

    .auth-firm-logo-plate {
        padding: 0.3rem 0.38rem;
    }

    .auth-form-pane,
    .login-body {
        border-top: none;
        border-left: 1px solid rgba(255, 255, 255, 0.1);
    }
}

@media (min-width: 992px) {
    :root {
        --auth-card-max: 920px;
    }
}
