/* =========================================================
   Login Page - Premium Production UI
   Notes:
   - No JavaScript selector names changed.
   - Supports Windows, Mac, Safari, iPad, iPhone, Android, RTL, and old browsers.
   ========================================================= */

body.login-page {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at top left, rgba(31, 138, 203, 0.14), transparent 30%), radial-gradient(circle at bottom right, rgba(31, 47, 111, 0.12), transparent 38%), linear-gradient(135deg, #eef6fc 0%, #f7fbff 48%, #eaf4fb 100%);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    position: relative;
    overflow-x: hidden;
}
    body.login-page::before {
        content: "";
        position: fixed;
        inset: 0;
        background-image: url('/images/Logo_WaterMark.png');
        background-repeat: no-repeat;
        background-position: center center;
        background-size: 100% 100%;
        opacity: 0.82;
        pointer-events: none;
        z-index: 0;
    }

    body.login-page::after {
        content: "";
        position: fixed;
        inset: 0;
        background: linear-gradient(120deg, rgba(255,255,255,0.18), rgba(255,255,255,0.03)), radial-gradient(circle at center, rgba(255,255,255,0.02), transparent 58%);
        pointer-events: none;
        z-index: 1;
    }

/* Layout */
.login-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 28px 16px;
    position: relative;
    z-index: 2;
}

.auth-wrapper {
    width: 100%;
    max-width: 460px;
}

/* Card */
.login-card {
    background: rgba(255, 255, 255, 0.94);
    border-radius: 24px;
    padding: 34px 30px 28px;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.16), 0 8px 20px rgba(31, 138, 203, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-top: 5px solid #1f8acb;
    position: relative;
    transition: all 0.25s ease;
    z-index: 3;
}

@supports ((-webkit-backdrop-filter: blur(14px)) or (backdrop-filter: blur(14px))) {
    .login-card {
        background: rgba(255, 255, 255, 0.86);
        -webkit-backdrop-filter: blur(14px);
        backdrop-filter: blur(14px);
    }
}

.login-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 34px 85px rgba(15, 23, 42, 0.18), 0 10px 24px rgba(31, 138, 203, 0.10);
}

/* Top bar */
.login-topbar {
    position: absolute;
    top: 10px;
    right: 10px;
    margin: 0;
    z-index: 5;
}

/* Language dropdown */
.lang-icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background-color: rgba(255, 255, 255, 0.96);
    border: 1px solid #d9e7f3;
    color: #1f8acb;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

    .lang-icon-btn:hover,
    .lang-icon-btn:focus {
        background-color: #ffffff;
        border-color: #1f8acb;
        color: #176d9f;
        box-shadow: 0 0 0 0.2rem rgba(31, 138, 203, 0.12);
    }

    .lang-icon-btn i {
        font-size: 1rem;
    }

.lang-dropdown {
    min-width: 170px;
    border: 1px solid rgba(31, 138, 203, 0.12);
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
    background: #ffffff;
}

    .lang-dropdown .dropdown-item {
        border-radius: 11px;
        padding: 10px 12px;
        display: flex;
        align-items: center;
        gap: 10px;
        color: #1f2937;
        background: transparent;
        border: 0;
        width: 100%;
    }

        .lang-dropdown .dropdown-item:hover {
            background-color: #eef7fd;
            color: #1f8acb;
        }

        .lang-dropdown .dropdown-item.active {
            background-color: rgba(31, 138, 203, 0.12);
            color: #176d9f;
            font-weight: 700;
        }

.lang-flag {
    font-size: 1rem;
    line-height: 1;
}

/* Logo */
.login-logo-wrap {
    text-align: center;
    margin-top: -4px;
    margin-bottom: 14px;
}

.login-logo {
    max-width: 270px;
    max-height: 92px;
    object-fit: contain;
    filter: drop-shadow(0 8px 14px rgba(15, 23, 42, 0.08));
}

/* Labels */
.form-label {
    display: block;
    font-weight: 700;
    color: #102033;
    margin-bottom: 8px;
    text-align: left;
}

/* Inputs */
.form-control {
    height: 52px;
    border-radius: 15px;
    border: 1px solid #cfdbe8;
    background-color: rgba(248, 251, 255, 0.96);
    padding-inline: 15px;
    font-size: 1rem;
    text-align: left;
    direction: ltr;
    color: #0f172a;
    transition: all 0.2s ease;
}

    .form-control::placeholder {
        color: #6b7280;
    }

    .form-control:focus {
        border-color: #1f8acb;
        background-color: #ffffff;
        box-shadow: 0 0 0 0.24rem rgba(31, 138, 203, 0.16);
    }

/* Checkbox */
.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
}

.form-check-input {
    cursor: pointer;
    margin-top: 0;
    width: 1.08rem;
    height: 1.08rem;
    border-color: #b8c7d8;
}

    .form-check-input:checked {
        background-color: #1f8acb;
        border-color: #1f8acb;
    }

.form-check-label {
    cursor: pointer;
    font-weight: 600;
    color: #334155;
    margin: 0;
}

/* Buttons */
.btn {
    height: 52px;
    border-radius: 15px;
    font-weight: 800;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #1f8acb, #0f5f9f);
    border-color: transparent;
    box-shadow: 0 12px 28px rgba(31, 138, 203, 0.28);
    transition: all 0.2s ease;
}

    .btn-primary:hover,
    .btn-primary:focus {
        background: linear-gradient(135deg, #176d9f, #0b4f86);
        border-color: transparent;
        transform: translateY(-1px);
        box-shadow: 0 15px 34px rgba(31, 138, 203, 0.32);
    }

.btn-outline-secondary {
    border-color: #a7b3c4;
    color: #334155;
    background-color: rgba(255, 255, 255, 0.92);
}

    .btn-outline-secondary:hover,
    .btn-outline-secondary:focus {
        background-color: #f3f7fb;
        color: #0f172a;
        border-color: #6b7c93;
    }

/* Validation */
.validation-summary-errors,
.text-danger {
    font-size: 0.92rem;
    font-weight: 600;
}

/* Footer */
.login-footer {
    text-align: center;
    margin-top: 22px;
    font-size: 0.86rem;
    color: #64748b;
    line-height: 1.6;
}

/* RTL */
html[dir="rtl"] .login-card {
    text-align: right;
}

html[dir="rtl"] .login-topbar {
    right: auto;
    left: 10px;
}

html[dir="rtl"] .form-label {
    text-align: right;
}

html[dir="rtl"] .form-control {
    text-align: right;
    direction: rtl;
}

html[dir="rtl"] .form-check {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}

html[dir="rtl"] .form-check-input {
    margin: 0;
}

html[dir="rtl"] .form-check-label {
    margin: 0;
    text-align: right;
}

/* Responsive */
@media (max-width: 768px) {
    body.login-page::before {
        background-size: 100% 100%;
        opacity: 0.28;
    }

    .auth-wrapper {
        max-width: 430px;
    }
}

@media (max-width: 576px) {
    .login-container {
        padding: 20px 14px;
    }

    .login-card {
        padding: 28px 18px 22px;
        border-radius: 20px;
    }

    .login-logo {
        max-width: 225px;
        max-height: 78px;
    }

    .btn,
    .form-control {
        height: 49px;
    }

    .login-topbar {
        top: 10px;
        right: 10px;
    }

    html[dir="rtl"] .login-topbar {
        right: auto;
        left: 10px;
    }
}

/* Older browser fallback */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .login-card {
        background: #ffffff;
    }

    body.login-page::before {
        opacity: 0.18;
    }
}
