/* ===== Archia Font ===== */
@font-face {
    font-family: 'Archia';
    src: url('/fonts/archia/Archia-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Archia';
    src: url('/fonts/archia/Archia-SemiBold.otf') format('opentype');
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: 'Archia';
    src: url('/fonts/archia/Archia-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
}

/* Shared Authentication Page Styles */
/* Used by all auth pages: Login, SignUp, ForgotPassword, LoginWith2FA,
   LoginWithRecoveryCode, SetPassword, RegisterConfirmation, ForgotPasswordConfirmation */

/* ===== Canonical Color Variables ===== */
:root {
    --login-primary: #5b2c6f;
    --login-primary-dark: #461E64;
    --login-primary-transparent: rgba(91, 44, 111, 0);
    --login-text-dark: #1F2937;
    --login-text-muted: #6B7280;
    --login-bg-white: #ffffff;
    --login-border: #E5E7EB;
    --login-danger: #ff4444;
    --login-focus: #694ce2;
    --login-focus-shadow: rgba(105, 76, 226, 0.2);
}

/* ===== Base ===== */
body {
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* ===== Split-Panel Layout ===== */
.login-wrapper {
    display: flex;
    min-height: 100vh;
}

.login-left {
    position: fixed;
    left: 0;
    top: 0;
    width: 55%;
    height: 100vh;
    background-image: url('/assets/images/backgrounds/bg-login-2.webp');
    background-size: cover;
    background-position: top center;
}

.login-left::after {
    content: '';
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background: linear-gradient(to top, rgba(55, 20, 69, 0.9), rgba(0, 0, 0, 0));
}

.login-left-header {
    position: absolute;
    top: 2.5rem;
    left: 3rem;
}

.login-left-header .brand-logo svg {
    height: 25px;
    width: auto;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.login-left-content {
    width: 100%;
    padding-left: 4rem;
    padding-right: 4rem;
    padding-top: 20rem;
    padding-bottom: 4rem;
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 10;
}

.login-right {
    margin-left: 55%;
    width: 45%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background-color: var(--login-bg-white);
    overflow-y: auto;
}

.form-container {
    width: 100%;
    max-width: 420px;
}

.mobile-brand-logo {
    display: none;
}

/* ===== Left Panel Title ===== */
.signin-title {
    color: #ffffff;
    font-family: 'Archia', 'Plus Jakarta Sans', sans-serif;
    font-size: 3rem;
    font-weight: 600;
    line-height: 1.2;
    text-shadow: 1px 2px 6px rgba(0, 0, 0, 0.4);
    margin: 0;
}

/* ===== Form Subtitle & Description ===== */
.form-subtitle {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--login-text-dark);
    margin-top: 0;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.form-description {
    font-size: 0.9rem;
    color: var(--login-text-muted);
    margin-bottom: 1.75rem;
    line-height: 1.5;
}

/* ===== Alerts ===== */
.alert {
    border-radius: 10px;
    font-size: 0.9rem;
}

/* ===== Form Elements ===== */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    font-weight: 500;
    color: var(--login-text-dark);
    margin-bottom: 0.4rem;
    display: block;
    font-size: 0.875rem;
}

.form-control,
.form-select {
    border: 1px solid var(--login-border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
    transition: all 0.2s ease;
    background-color: var(--login-bg-white);
    width: 100%;
    color: var(--login-text-dark);
}

.form-control::placeholder,
.form-select::placeholder {
    color: #9CA3AF;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--login-focus);
    box-shadow: 0 0 0 3px var(--login-focus-shadow);
    outline: none;
    background-color: var(--login-bg-white);
}

.input-group-text {
    font-size: 0.875rem !important;
}

.input-group > :last-child {
    border-top-right-radius: 10px !important;
    border-bottom-right-radius: 10px !important;
}

.form-check-auth .form-check-input {
    border: 1px solid #ccc !important;
    width: 1.2rem;
    height: 1.2rem;
    margin-top: 0.1em;
}

.form-check-auth .form-check-input:checked {
    background-color: var(--login-primary);
    border-color: var(--login-primary);
}

.form-check-auth .form-check-input:focus {
    border-color: var(--login-focus);
    box-shadow: 0 0 0 3px var(--login-focus-shadow);
}

.text-danger {
    color: var(--login-danger) !important;
    font-size: 0.8rem;
    font-weight: 500;
}

.validation-summary-errors ul {
    padding-left: 15px;
    margin-bottom: 0;
}

/* ===== Submit Button ===== */
.btn-signin {
    background: var(--login-primary-dark);
    border: none;
    color: white;
    padding: 0.875rem 2rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.875rem;
    width: 100%;
    transition: all 0.2s ease;
    cursor: pointer;
    margin-top: 0;
    display: block;
    text-align: center;
    text-decoration: none;
}

.btn-signin:hover:not(:disabled) {
    background: var(--login-primary-dark);
    color: white;
    box-shadow: 0 4px 12px rgba(70, 30, 100, 0.3);
    text-decoration: none;
}

.btn-signin:disabled {
    background: #6B7280;
    cursor: not-allowed;
    opacity: 0.7;
}

/* ===== Responsive (<992px) ===== */
@media (max-width: 991px) {
    .login-left {
        width: 100%;
    }

    .login-left-content {
        display: none;
    }

    .login-left-header {
        display: none;
    }

    .login-right {
        position: relative;
        margin-left: 0;
        width: 100%;
        min-height: 100vh;
        background: transparent;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 2rem 1.5rem;
        z-index: 10;
    }

    .form-container {
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 2.5rem;
        border-radius: 20px;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
        width: 100%;
        max-width: 460px;
    }

    .mobile-brand-logo {
        display: flex;
        justify-content: center;
        margin-bottom: 1.5rem;
    }

    .mobile-brand-logo svg {
        height: 22px;
        width: auto;
    }

    .form-subtitle {
        text-align: center;
        font-size: 1.2rem;
        line-height: 1.2;
    }
}

@media (max-width: 576px) {
    .login-right {
        padding: 1.5rem 1rem;
    }

    .form-container {
        padding: 2rem 1.5rem;
    }
}

/* ===== System Banner Offset (Training Mode / Impersonation) ===== */
body:has(#system-banner) .login-left {
    top: 52px;
    height: calc(100vh - 52px);
}

body:has(#system-banner) .login-right {
    padding-top: calc(3rem + 52px);
    min-height: calc(100vh - 52px);
}

@media (max-width: 991px) {
    body:has(#system-banner) .login-left {
        top: 0;
        height: 100vh;
    }

    body:has(#system-banner) .login-right {
        padding-top: calc(2rem + 52px);
        min-height: 100vh;
    }
}
