/*------------------------------------------------------------------
   Modern Login Page — 70% image / 30% form
   One viewport only — no scroll / no duplicate page
--------------------------------------------------------------------*/

html.auth-html,
html.auth-html body.auth-body {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #fff !important;
}

.login-page {
    --login-blue: #0d2b4a;
    --login-blue-mid: #1a4a7a;
    --login-muted: #6b7a8c;
    --login-border: #d6e2ef;
    --login-input-bg: #ffffff;

    /* Fixed to viewport = exactly one screen, never scrolls */
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    background: #fff;
    overflow: hidden;
    z-index: 1;
}

html[dir="rtl"] .login-page {
    flex-direction: row-reverse;
}

/* Left — image sized to image ratio so no side gaps */
.login-page__visual {
    flex: 0 0 auto;
    height: 100%;
    width: auto;
    min-width: 0;
    position: relative;
    overflow: hidden;
    background: #eaf2fb;
    /* Matches login-showcase.jpg 1400×1123 */
    aspect-ratio: 1400 / 1123;
    max-width: calc(100% - 380px);
}

.login-page__visual img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    border: 0;
}

/* Right — form fills remaining width */
.login-page__panel {
    flex: 1 1 auto;
    width: auto;
    min-width: 380px;
    max-width: none;
    height: 100%;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    box-shadow: -8px 0 32px rgba(13, 43, 74, 0.08);
    z-index: 2;
}

.login-page__panel-inner {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: 32px 36px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.login-page__logo {
    text-align: center;
}

.login-page__logo img {
    max-width: 180px;
    max-height: 56px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.login-page__form-header {
    text-align: center;
}

.login-page__form-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--login-blue);
    margin: 0 0 6px;
}

.login-page__form-header p {
    font-size: 14px;
    color: var(--login-muted);
    margin: 0;
}

/* Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.login-form__group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-form__group > label {
    font-size: 13px;
    font-weight: 600;
    color: var(--login-blue);
    margin: 0;
}

.login-form__input {
    display: block;
    width: 100%;
    height: 44px;
    padding: 0 14px;
    font-size: 14px;
    font-weight: 400;
    color: #161f2b;
    background-color: var(--login-input-bg) !important;
    border: 1px solid var(--login-border);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.login-form__input::placeholder {
    color: #919aa4;
}

.login-form__input:focus {
    border-color: var(--login-blue-mid);
    box-shadow: 0 0 0 3px rgba(26, 74, 122, 0.1);
}

.login-form__password {
    position: relative;
    width: 100%;
}

.login-form__password .login-form__input {
    padding-right: 44px;
}

html[dir="rtl"] .login-form__password .login-form__input {
    padding-right: 14px;
    padding-left: 44px;
}

.login-form__toggle {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    font-size: 18px;
    color: var(--login-muted);
    cursor: pointer;
    line-height: 1;
    user-select: none;
}

html[dir="rtl"] .login-form__toggle {
    right: auto;
    left: 14px;
}

.login-form__toggle:hover {
    color: var(--login-blue);
}

.login-form__remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: -2px;
}

.login-form__checkbox {
    width: 16px;
    height: 16px;
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--login-blue);
    cursor: pointer;
}

.login-form__remember label {
    font-size: 13px;
    font-weight: 500;
    color: var(--login-muted);
    margin: 0;
    cursor: pointer;
    user-select: none;
}

.login-form__error {
    font-size: 12px;
    color: #ff6a54;
    margin: 0;
}

.login-form__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 44px;
    margin-top: 4px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--login-blue) 0%, var(--login-blue-mid) 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(13, 43, 74, 0.2);
    transition: filter 0.15s, transform 0.15s, box-shadow 0.15s;
}

.login-form__submit:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(13, 43, 74, 0.26);
    color: #fff;
}

.login-form__submit:active {
    transform: translateY(0);
}

.login-form__submit i {
    font-size: 18px;
}

.login-page__footer {
    text-align: center;
    padding-top: 4px;
}

.login-page__footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.login-page__footer-links a {
    font-size: 12px;
    font-weight: 500;
    color: var(--login-muted);
    text-decoration: none;
}

.login-page__footer-links a:hover {
    color: var(--login-blue);
}

.login-page__footer-links .sep {
    color: #cbd5e1;
    font-size: 12px;
}

.login-page__demo h6 {
    font-size: 13px;
    font-weight: 600;
    color: var(--login-muted);
    text-align: center;
    margin: 0 0 10px;
}

.login-page__demo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.login-page__demo-btn {
    width: 100%;
    height: 38px;
    border: 1px solid var(--login-border);
    border-radius: 8px;
    background: #fff;
    color: var(--login-blue);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.login-page__demo-btn:hover {
    background: var(--login-blue);
    border-color: var(--login-blue);
    color: #fff;
}

.login-page__switch {
    text-align: center;
    font-size: 13px;
    color: var(--login-muted);
    margin: 4px 0 0;
}

.login-page__switch a {
    color: var(--login-blue);
    font-weight: 600;
    text-decoration: none;
}

/* Tablet / mobile — single column, allow page scroll only here */
@media (max-width: 991.98px) {
    html.auth-html,
    html.auth-html body.auth-body {
        overflow: auto !important;
        height: auto !important;
    }

    .login-page {
        position: relative;
        inset: auto;
        flex-direction: column;
        width: 100%;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        overflow: visible;
    }

    html[dir="rtl"] .login-page {
        flex-direction: column;
    }

    .login-page__visual {
        display: none;
    }

    .login-page__panel {
        flex: none;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        box-shadow: none;
        overflow: visible;
    }

    .login-page__panel-inner {
        max-width: 400px;
        padding: 48px 24px 32px;
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 480px) {
    .login-page__panel-inner {
        padding: 36px 20px 28px;
    }

    .login-page__form-header h1 {
        font-size: 22px;
    }
}
