/*
 * MJK-ALTHANI - PREMIUM LOGIN
 * Fonts: Tajawal (AR), Manrope (EN)
 */

@font-face {
    font-family: 'Tajawal';
    src: url('../fonts/Tajawal-300.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: block;
}
@font-face {
    font-family: 'Tajawal';
    src: url('../fonts/Tajawal-400.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: block;
}
@font-face {
    font-family: 'Tajawal';
    src: url('../fonts/Tajawal-500.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: block;
}
@font-face {
    font-family: 'Tajawal';
    src: url('../fonts/Tajawal-700.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'Manrope';
    src: url('../fonts/Manrope-400.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: block;
}
@font-face {
    font-family: 'Manrope';
    src: url('../fonts/Manrope-600.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: block;
}
@font-face {
    font-family: 'Manrope';
    src: url('../fonts/Manrope-700.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: block;
}

:root {
    --primary: #38bdf8; /* Bright Blue */
    --secondary: #0ea5e9;
    --accent: #1e3a8a; /* Midnight Indigo */
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    --card-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
}

/* 1. Reset and Global Forced Viewport */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Manrope', 'Tajawal', sans-serif !important;
    background-color: #0f172a;
}

[data-textdirection="rtl"] body,
[data-textdirection="rtl"] .login-main-wrapper,
[data-textdirection="rtl"] .form-control-modern,
[data-textdirection="rtl"] .btn-login-modern {
    direction: rtl;
    font-family: 'Tajawal', 'Manrope', sans-serif !important;
}

/* 2. Main Layout Container */
.login-main-wrapper {
    display: flex;
    width: 100%;
    height: 100vh;
    background: #0f172a;
    position: fixed; /* Force it to cover everything */
    top: 0;
    left: 0;
    z-index: 9999; /* Ensure it stays above layout elements */
    overflow: hidden;
}

/* Hide Layout Elements */
.fixed-navbar .header-navbar,
.footer {
    display: none !important;
}

body.fixed-navbar {
    padding-top: 0 !important;
}

/* 1. Visual Content */
.welcome-side {
    background: url('../images/carbon-fibre.png'), url('../images/mjk/background.jpg') no-repeat center center;
    background-size: auto, cover;
    flex: 1;
    display: none;
    flex-direction: column;
    justify-content: flex-end;
    padding: 60px 8%;
    color: white;
    position: relative;
    z-index: 2;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.welcome-side::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, #0f172a 0%, rgba(15, 23, 42, 0.4) 60%, transparent 100%);
    z-index: 1;
}

.welcome-side::after {
    content: '';
    position: absolute;
    top: -10%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0) 70%);
    border-radius: 50%;
    z-index: 1;
}

.welcome-content-premium {
    position: relative;
    z-index: 3;
}

.badge-welcome {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(56, 189, 248, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
}

.welcome-title {
    font-size: 3.8rem !important;
    font-weight: 900 !important;
    margin-bottom: 20px !important;
    line-height: 1.1 !important;
    letter-spacing: -2px !important;
    text-shadow: 0 10px 30px rgba(0,0,0,0.3);
    color: #fff;
}

.welcome-text {
    font-size: 1.2rem !important;
    color: rgba(255, 255, 255, 0.8) !important;
    max-width: 500px;
    line-height: 1.7 !important;
    margin-bottom: 40px !important;
}

.stat-item {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #38bdf8;
}

@media (min-width: 992px) {
    .welcome-side {
        display: flex;
    }
}

/* 4. Form Side */
.form-side {
    position: relative;
    background: white;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    z-index: 5;
}

@media (min-width: 992px) {
    .form-side {
        width: 480px;
        box-shadow: -10px 0 50px rgba(0,0,0,0.2);
    }
}

.login-form-box {
    width: 100%;
    max-width: 360px;
}

.brand-logo-modern {
    margin: 0 auto 40px;
    width: fit-content;
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 8px;
}

.brand-logo-modern img {
    max-height: 140px;
    width: auto;
    border-radius: 8px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    z-index: 1;
}

.brand-logo-modern:hover img {
    transform: scale(1.02);
    filter: brightness(1.1);
}

/* Premium Shine Effect */
.brand-logo-modern::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -150%;
    width: 50%;
    height: 200%;
    background: linear-gradient(
        to right, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.4) 50%, 
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(25deg);
    z-index: 2;
    pointer-events: none;
    display: none; /* Disabled infinite shine animation to prevent lag */
}

@keyframes premium-shine-auth {
    0% { left: -150%; }
    20% { left: 150%; }
    100% { left: 150%; }
}

.form-header-modern {
    text-align: center;
    margin-bottom: 30px;
}

.form-header-modern h2 {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 8px;
}

.form-header-modern p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.form-group-modern {
    margin-bottom: 25px;
}

.form-label-modern {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.form-control-modern {
    width: 100%;
    background: #f8fafc;
    border-radius: 2px;
    padding: 16px 20px;
    padding-inline-start: 48px;
    font-size: 1rem;
    color: var(--text-dark);
    transition: all 0.3s;
}

.form-control-modern:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 5px rgba(56, 189, 248, 0.1);
    outline: none;
}

.form-control-modern.is-invalid {
    border-color: #ef4444 !important;
    background-color: rgba(239, 68, 68, 0.02) !important;
    animation: premiumShake 0.4s cubic-bezier(.36,.07,.19,.97) both !important;
}

.form-control-modern.is-invalid + .input-icon-modern {
    color: #ef4444 !important;
}

.form-control-modern.is-invalid:focus {
    box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.15) !important;
    background-color: #ffffff !important;
    border-color: #ef4444 !important;
}

@keyframes premiumShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-2px); }
    40%, 80% { transform: translateX(2px); }
}

.error-text {
    color: #ef4444 !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    margin-top: 8px !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.error-text::before {
    content: '\f06a'; /* FontAwesome Exclamation Circle */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
}

.input-container-modern {
    position: relative;
}

.input-icon-modern {
    position: absolute;
    inset-inline-start: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 1.4rem;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 10;
}

.form-control-modern:focus + .input-icon-modern {
    color: var(--accent);
    transform: translateY(-50%) scale(1.15);
}

.btn-login-modern {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #1e3a8a 100%);
    background-size: 200% auto;
    color: white;
    border: none !important;
    outline: none !important;
    border-radius: 2px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.4s ease;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.2);
}

.btn-login-modern:hover {
    background-position: right center;
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(30, 58, 138, 0.5);
}

.btn-login-modern:focus, .btn-login-modern:active {
    outline: none !important;
    border: none !important;
    box-shadow: 0 8px 25px rgba(30, 58, 138, 0.4) !important;
}

.login-options-modern {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.remember-modern {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.remember-modern input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border-radius: 2px;
    border: 2px solid #cbd5e1;
    cursor: pointer;
}

.forgot-modern {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    transition: all 0.3s;
    white-space: nowrap !important;
}

.forgot-modern:hover {
    color: var(--accent);
    text-decoration: underline;
}

.lang-toggle-container {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 20;
    width: max-content;
}

[data-textdirection="rtl"] .lang-toggle-container {
    right: auto;
    left: 15px;
}

@media (min-width: 992px) {
    .lang-toggle-container {
        top: 30px;
        right: 30px;
    }
    [data-textdirection="rtl"] .lang-toggle-container {
        right: auto;
        left: 30px;
    }
}

.btn-lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 4px;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 800;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.btn-lang-toggle i {
    font-size: 1.1rem;
    color: var(--primary);
}

.btn-lang-toggle:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 15px 30px rgba(56, 189, 248, 0.3);
}

.btn-lang-toggle:hover i {
    color: white;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 991px) {
    .login-main-wrapper {
        background: url('../images/mjk/background.png') no-repeat center center;
        background-size: cover;
    }

    .login-main-wrapper::before {
        content: '';
        position: absolute;
        inset: 0;
        background: rgba(15, 23, 42, 0.85);
        backdrop-filter: blur(10px);
        z-index: 1;
    }

    .form-side {
        background: transparent;
    }

    .login-form-box {
        position: relative;
        background: rgba(255, 255, 255, 0.95);
        padding: 65px 35px 50px;
        border-radius: 2px;
        box-shadow: var(--card-shadow);
        max-width: 440px;
        width: 92%;
    }
}

/* ==========================================================================
   PREMIUM FLOATING NOTIFICATION CHIP
   ========================================================================== */
.premium-floating-chip {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 25px;
    background: white;
    border-radius: 50px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    border: 1px solid rgba(0,0,0,0.05);
    animation: chipShow 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    min-width: 320px;
    max-width: 90%;
}

.premium-floating-chip.chip-hide {
    animation: chipHide 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.chip-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.chip-text {
    font-weight: 700;
    font-size: 0.95rem;
    color: #1e293b;
    flex-grow: 1;
}

.chip-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 5px;
    transition: color 0.3s;
}

.chip-close:hover {
    color: #1e293b;
}

/* Contextual Variants */
.chip-error {
    border-left: 5px solid #ef4444;
}
.chip-error .chip-icon {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.chip-success {
    border-left: 5px solid #10b981;
}
.chip-success .chip-icon {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

[data-textdirection="rtl"] .chip-error,
[data-textdirection="rtl"] .chip-success {
    border-left: none;
    border-right: 5px solid;
}

[data-textdirection="rtl"] .chip-error { border-right-color: #ef4444; }
[data-textdirection="rtl"] .chip-success { border-right-color: #10b981; }

@keyframes chipShow {
    from { opacity: 0; transform: translate(-50%, -100%); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes chipHide {
    from { opacity: 1; transform: translate(-50%, 0); }
    to { opacity: 0; transform: translate(-50%, -100%); }
}

