/* 
 * Marasim - Modern Login Design
 * Theme: Deep Blue & Gold
 */

:root {
    --primary-blue: #0f172a;
    --secondary-blue: #1e293b;
    --accent-gold: #d4af37;
    --accent-gold-hover: #c5a059;
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
    --white: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.2);
    --font-heading: 'Tajawal', 'Cairo', sans-serif;
    --font-body: 'Tajawal', 'Cairo', sans-serif;
}

/* Hide Global Navigation and Footer for clean login */
body>header,
body>nav,
.header-toolbar,
footer,
#pwa-install-banner,
#pwa-install-btn,
#chatEngineerIcon {
    display: none !important;
}

/* Base Styles */
body {
    font-family: var(--font-body);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue)) !important;
    color: var(--text-light);
    display: flex;
    flex-direction: column;
}

.login-page-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    /* Ensure full height */
}

/* Background Pattern/Overlay */
.login-page-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(212, 175, 55, 0.08) 0%, transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(212, 175, 55, 0.05) 0%, transparent 25%);
    z-index: 0;
    pointer-events: none;
}

/* Card Container */
.login-wrapper {
    width: 100%;
    max-width: 450px;
    z-index: 1;
    animation: slideUp 0.6s ease-out;
}

.login-container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    box-shadow: var(--shadow-soft),
        0 0 0 1px var(--glass-border);
    position: relative;
    overflow: hidden;
}

/* Decorative Gold Top Border */
.login-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
}

/* Language Toggle */
.lang-toggle-absolute {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 10;
}

[dir="rtl"] .lang-toggle-absolute {
    right: auto;
    left: 1.5rem;
}

.btn-lang {
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    color: var(--primary-blue);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-lang:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    background: rgba(255, 255, 255, 0.5);
}

/* Header Section */
.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
    margin-top: 1rem;
}

.logo-container {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.15);
    transform: rotate(-5deg);
    transition: transform 0.3s ease;
}

.login-container:hover .logo-container {
    transform: rotate(0deg) scale(1.05);
}

.logo-container i {
    font-size: 2rem;
    color: var(--accent-gold);
}

.login-header h2 {
    font-family: var(--font-heading);
    color: var(--primary-blue);
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 0.5rem;
    line-height: 1.3;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
}

/* Form Styles */
.form-group {
    position: relative;
    margin-bottom: 1.25rem;
}

.form-control {
    width: 100%;
    padding: 0.9rem 0.9rem 0.9rem 2.8rem;
    background: #f8fafc;
    border: 2px solid transparent;
    border-radius: 12px;
    font-size: 0.95rem;
    color: var(--primary-blue);
    transition: all 0.3s ease;
    font-family: inherit;
}

[dir="rtl"] .form-control {
    padding: 0.9rem 2.8rem 0.9rem 0.9rem;
}

.form-control:focus {
    background: var(--white);
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.1);
    outline: none;
}

.input-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #cbd5e1;
    font-size: 1rem;
    transition: color 0.3s ease;
    left: 1rem;
    pointer-events: none;
}

[dir="rtl"] .input-icon {
    left: auto;
    right: 1rem;
}

.form-control:focus+.input-icon {
    color: var(--accent-gold);
}

/* Floating Label */
.form-group label {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 2.8rem;
    color: #94a3b8;
    font-size: 0.95rem;
    pointer-events: none;
    transition: all 0.3s ease;
    background: transparent;
    padding: 0 0.25rem;
}

[dir="rtl"] .form-group label {
    left: auto;
    right: 2.8rem;
}

.form-control:focus~label,
.form-control:not(:placeholder-shown)~label {
    top: 0;
    font-size: 0.75rem;
    color: var(--accent-gold);
    background: #f8fafc;
    padding: 0 0.5rem;
}

.form-control:not(:focus):not(:placeholder-shown)~label {
    color: var(--primary-blue);
}

.password-toggle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #cbd5e1;
    padding: 0.5rem;
    right: 0.5rem;
    transition: color 0.3s ease;
    z-index: 2;
}

[dir="rtl"] .password-toggle {
    right: auto;
    left: 0.5rem;
}

.password-toggle:hover {
    color: var(--primary-blue);
}

/* Links */
.links-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
}

[dir="rtl"] .links-container {
    justify-content: flex-end;
}

.forgot-link {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: var(--accent-gold);
}

/* Button */
.btn-login {
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, var(--accent-gold), #bfa145);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e2e8f0;
}

.divider span {
    padding: 0 1rem;
}

/* Register Section */
.text-center {
    color: var(--primary-blue);
    font-weight: 500;
    font-size: 0.95rem;
}

.register-link {
    color: var(--accent-gold);
    text-decoration: none;
    font-weight: 700;
    margin: 0 0.5rem;
    position: relative;
    transition: color 0.2s;
}

.register-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gold);
    transition: width 0.3s ease;
}

.register-link:hover::after {
    width: 100%;
}

/* Error Message */
.err-msg {
    background: #fef2f2;
    color: #ef4444;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    border: 1px solid #fee2e2;
    margin-bottom: 1.5rem;
    animation: shake 0.5s ease-in-out;
}

/* Success Message */
.success-msg {
    background: #f0fdf4;
    color: #22c55e;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    border: 1px solid #bbf7d0;
    margin-bottom: 1.5rem;
    animation: slideUp 0.5s ease-in-out;
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-4px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(4px);
    }
}

/* Responsive */
@media (max-width: 576px) {
    .login-container {
        padding: 2rem 1.5rem;
    }

    .login-header h2 {
        font-size: 1.25rem;
    }
}