/* ==========================================
   Company Login — Premium Split-Panel + Mobile
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&family=Inter:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,400;0,600;1,400&family=Tajawal:wght@300;400;500;700;800&display=swap');

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.login-body {
    font-family: 'Tajawal', 'Inter', sans-serif;
    direction: rtl;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    overflow: hidden;
    background: #000;
}

.serif-font {
    font-family: 'Playfair Display', serif;
}

.login-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.8;
}

.login-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(4px);
    transform: scale(1.1);
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ─── Main Card (Desktop) ─── */
.login-card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1100px;
    height: 85vh;
    background: #fff;
    border-radius: 40px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    display: flex;
    flex-direction: row-reverse;
    border: 4px solid rgba(255, 255, 255, 0.2);
    animation: fadeInUp 0.6s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Visual Panel (Desktop) ─── */
.login-visual {
    width: 50%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3rem;
    color: #fff;
    overflow: hidden;
}

.login-visual-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.login-visual-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.login-visual-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent, rgba(0, 0, 0, 0.3));
}

.visual-top {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
}

.visual-top span {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    font-weight: 500;
    text-transform: uppercase;
}

.visual-top-line {
    height: 1px;
    width: 3rem;
    background: rgba(255, 255, 255, 0.5);
}

.visual-bottom {
    position: relative;
    z-index: 10;
    padding-bottom: 2rem;
}

.visual-bottom h1 {
    font-family: 'Cairo', sans-serif;
    font-weight: 800;
    font-size: 3.5rem;
    line-height: 1.15;
    margin-bottom: 1.5rem;
}

.visual-bottom h1 .italic {
    font-style: italic;
}

.visual-bottom p {
    font-family: 'Cairo', sans-serif;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    font-weight: 300;
    line-height: 1.7;
    max-width: 22rem;
}

/* ─── Form Panel (Desktop) ─── */
.login-form-panel {
    width: 50%;
    background: #fff;
    display: flex;
    flex-direction: column;
    padding: 2rem 3rem;
    justify-content: center;
    height: 100%;
    overflow-y: auto;
}

.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.login-logo-inner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.login-logo-inner svg {
    color: #000;
}

.login-logo-inner span {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    color: #000;
}

.login-welcome {
    text-align: center;
    margin-bottom: 2rem;
}

.login-welcome h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.25rem;
    color: #111827;
    margin-bottom: 0.5rem;
}

.login-welcome p {
    color: #6B7280;
    font-size: 0.875rem;
}

/* ─── Form ─── */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #F9FAFB;
    border: 1px solid transparent;
    color: #111827;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    outline: none;
    font-family: 'Inter', sans-serif;
}

.form-input::placeholder {
    color: #9CA3AF;
}

.form-input:focus {
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
    background: #fff;
    border-color: #E5E7EB;
}

.form-input.is-invalid {
    border-color: #EF4444;
    background: #FEF2F2;
}

.form-input-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    left: 0.75rem;
    right: auto;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9CA3AF;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password:hover {
    color: #4B5563;
}

.toggle-password .eye-icon,
.toggle-password .eye-off-icon {
    width: 20px;
    height: 20px;
}

.toggle-password .eye-off-icon {
    display: none;
}

.toggle-password.active .eye-icon {
    display: none;
}

.toggle-password.active .eye-off-icon {
    display: block;
}

.form-error {
    font-size: 0.75rem;
    color: #EF4444;
    margin-top: 0.25rem;
}

.alert {
    padding: 0.65rem 0.85rem;
    border-radius: 0.5rem;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-align: center;
}

.alert-danger {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-warning {
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
}

.check-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.check-label .custom-checkbox {
    position: relative;
    display: flex;
    align-items: center;
}

.check-label input[type="checkbox"] {
    height: 1rem;
    width: 1rem;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    border-radius: 0.25rem;
    border: 1px solid #D1D5DB;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.15s ease;
    background: #fff;
}

.check-label input[type="checkbox"]:hover {
    border-color: #000;
}

.check-label input[type="checkbox"]:checked {
    border-color: #000;
    background: #000;
}

.check-label .check-svg {
    pointer-events: none;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.check-label input[type="checkbox"]:checked~.check-svg {
    opacity: 1;
}

.check-label .check-text {
    color: #4B5563;
    transition: color 0.15s ease;
}

.check-label:hover .check-text {
    color: #111827;
}

.forgot-link {
    font-weight: 500;
    color: #111827;
    text-decoration: none;
    transition: text-decoration 0.15s ease;
}

.forgot-link:hover {
    text-decoration: underline;
}

.btn-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 0.5rem;
}

.btn-signin {
    width: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #fff;
    font-weight: 700;
    padding: 0.9rem 1.5rem;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(15, 52, 96, 0.35);
    font-size: 1rem;
    font-family: 'Tajawal', 'Inter', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn-signin::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
    transition: left 0.5s ease;
}

.btn-signin:hover::before {
    left: 100%;
}

.btn-signin:hover {
    background: linear-gradient(135deg, #0f3460 0%, #1a1a2e 50%, #16213e 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(15, 52, 96, 0.45);
}

.btn-signin:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(15, 52, 96, 0.3);
}

.btn-signin:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-signin.loading .spinner {
    display: block;
}

.btn-signin.loading .btn-text {
    display: none;
}

.login-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.875rem;
    color: #6B7280;
}

.login-footer a {
    font-weight: 600;
    color: #000;
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

.login-back {
    margin-top: 0.75rem;
    text-align: center;
}

.login-back a {
    font-size: 0.8rem;
    color: #9CA3AF;
    text-decoration: none;
    transition: color 0.2s;
}

.login-back a:hover {
    color: #374151;
    text-decoration: underline;
}

/* ═══════════════════════════════════════════
   MOBILE — Full-Screen Clean App Design
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
    body.login-body {
        padding: 0;
        background: #fff;
        align-items: flex-start;
    }

    .login-bg {
        display: none;
    }

    .login-card {
        display: block;
        width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 100vh;
        border-radius: 0;
        border: none;
        box-shadow: none;
        background: #fff;
        animation: none;
    }

    .login-visual {
        display: none;
    }

    .login-form-panel {
        width: 100%;
        height: auto;
        min-height: 100vh;
        padding: 0;
        background: #fff;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
    }

    /* ── Decorative Top Banner ── */
    .login-logo {
        position: relative;
        width: 100%;
        margin: 0;
        padding: 60px 24px 40px;
        background: linear-gradient(135deg, #0f3460, #16213e, #1a1a2e);
        border-radius: 0 0 40px 40px;
        overflow: hidden;
    }

    .login-logo::before {
        content: '';
        position: absolute;
        top: -50%;
        right: -30%;
        width: 200px;
        height: 200px;
        background: rgba(255, 255, 255, 0.04);
        border-radius: 50%;
    }

    .login-logo::after {
        content: '';
        position: absolute;
        bottom: -30%;
        left: -20%;
        width: 160px;
        height: 160px;
        background: rgba(255, 255, 255, 0.03);
        border-radius: 50%;
    }

    .login-logo-inner {
        position: relative;
        z-index: 2;
        flex-direction: column;
        gap: 8px;
    }

    .login-logo-inner svg {
        color: rgba(255, 255, 255, 0.6);
        width: 36px;
        height: 36px;
    }

    .login-logo-inner span {
        color: #fff;
        font-size: 1.15rem;
        font-weight: 700;
        letter-spacing: 0;
    }

    /* ── Welcome Section ── */
    .login-welcome {
        padding: 32px 28px 0;
        margin-bottom: 0;
        text-align: right;
    }

    .login-welcome h2 {
        color: #111827;
        font-size: 1.6rem;
        margin-bottom: 4px;
    }

    .login-welcome p {
        color: #9CA3AF;
        font-size: 0.82rem;
    }

    /* ── Form Area ── */
    .login-form {
        padding: 24px 28px;
        gap: 18px;
    }

    .form-label {
        font-size: 0.82rem;
        font-weight: 600;
        color: #555;
    }

    .form-input {
        padding: 14px 16px;
        font-size: 0.9rem;
        border: 1.5px solid #E8EDF2;
        border-radius: 14px;
        background: #F8FAFC;
        font-family: 'Tajawal', sans-serif;
    }

    .form-input:focus {
        border-color: #0f3460;
        background: #fff;
        box-shadow: 0 0 0 4px rgba(15, 52, 96, 0.08);
    }

    .form-input::placeholder {
        color: #B8C0CC;
    }

    .form-options {
        font-size: 0.8rem;
    }

    .forgot-link {
        font-size: 0.8rem;
        color: #0f3460;
        font-weight: 600;
    }

    .btn-group {
        padding-top: 8px;
    }

    .btn-signin {
        padding: 14px;
        border-radius: 14px;
        font-size: 0.95rem;
        font-weight: 800;
        letter-spacing: 0.5px;
    }

    /* ── Footer ── */
    .login-footer {
        margin-top: auto;
        padding: 20px 28px;
        border-top: 1px solid #F3F4F6;
    }

    .login-footer p {
        color: #9CA3AF;
        font-size: 0.82rem;
    }

    .login-footer a {
        color: #0f3460;
        font-weight: 700;
    }

    .login-back {
        padding: 0 28px 24px;
        margin-top: 0;
    }

    .login-back a {
        color: #C4C9D4;
        font-size: 0.75rem;
    }

    .alert {
        margin: 0 28px;
        border-radius: 12px;
    }
}

/* ─── Tablet ─── */
@media (min-width: 769px) and (max-width: 1024px) {
    .login-form-panel {
        padding: 2rem;
    }

    .visual-bottom h1 {
        font-size: 2.75rem;
    }
}