/* Modern Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700&family=Outfit:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #3b82f6;
    /* Modern Blue */
    --primary-hover: #2563eb;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --bg-card: rgba(255, 255, 255, 0.85);
    --border-card: rgba(255, 255, 255, 0.4);
    --shadow-card: 0 20px 40px rgba(0, 0, 0, 0.05);
    --radius-card: 24px;
}

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    background: linear-gradient(135deg, #eef2f6 0%, #e2e8f0 100%) !important;
}

/* Lang-specific fonts */
html[lang="ar"] body {
    font-family: 'Cairo', sans-serif !important;
}

html[lang="en"] body {
    font-family: 'Outfit', sans-serif !important;
}

/* Ambient background glow */
.ambient-glow {
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(255, 255, 255, 0) 70%);
    filter: blur(60px);
    z-index: 0;
    pointer-events: none;
}

.glow-1 {
    top: -10%;
    left: -10%;
    animation: floatGlow 15s ease-in-out infinite alternate;
}

.glow-2 {
    bottom: -10%;
    right: -10%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, rgba(255, 255, 255, 0) 70%);
    animation: floatGlow 20s ease-in-out infinite alternate-reverse;
}

@keyframes floatGlow {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(50px, 30px) scale(1.1);
    }

    100% {
        transform: translate(0, 0) scale(1);
    }
}

.login-page-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 480px;
    padding: 24px;
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 40px;
    transition: all 0.3s ease;
}

.login-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.2);
}

.login-logo {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo img {
    max-height: 55px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.login-logo a:hover img {
    transform: scale(1.05);
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-header h3 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

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

/* Form Inputs */
.form-group-custom {
    margin-bottom: 20px;
    position: relative;
}

.form-group-custom label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

html[dir="rtl"] .form-group-custom label {
    text-align: right;
}

.form-group-custom label span {
    color: #ef4444;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i.input-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
    transition: color 0.3s ease;
    pointer-events: none;
}

/* Handle RTL / LTR alignment for icons */
html[dir="rtl"] .input-wrapper i.input-icon {
    right: 16px;
}

html[dir="ltr"] .input-wrapper i.input-icon {
    left: 16px;
}

html[dir="rtl"] .input-wrapper input {
    padding-right: 48px;
    padding-left: 16px;
}

html[dir="ltr"] .input-wrapper input {
    padding-left: 48px;
    padding-right: 16px;
}

.input-wrapper input {
    width: 100%;
    height: 50px;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    background: #ffffff;
    font-size: 15px;
    color: var(--text-main);
    outline: none;
    transition: all 0.3s ease;
}

.input-wrapper input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.input-wrapper input:focus+i.input-icon {
    color: var(--primary-color);
}

/* Password Toggle Button */
.toggle-password-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
    z-index: 10;
}

html[dir="rtl"] .toggle-password-btn {
    left: 16px;
}

html[dir="ltr"] .toggle-password-btn {
    right: 16px;
}

.toggle-password-btn:hover {
    color: var(--primary-color);
}

/* Remember & Forgot Password */
.login-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    font-size: 14px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-muted);
    user-select: none;
    margin-bottom: 0;
}

.remember-me input {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 1.5px solid #cbd5e1;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.forgot-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: var(--primary-hover);
    text-decoration: underline !important;
}

/* Submit Button */
.btn-submit {
    width: 100%;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
}

.btn-submit:active {
    transform: translateY(0);
}

/* Footer links */
.login-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
}

.login-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    margin-left: 4px;
    margin-right: 4px;
}

.login-footer a:hover {
    color: var(--primary-hover);
    text-decoration: underline !important;
}

/* Alert Styling */
.alert-custom {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #b91c1c;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-custom ul {
    margin: 0;
    padding-left: 20px;
}

html[dir="rtl"] .alert-custom ul {
    padding-left: 0;
    padding-right: 20px;
}

/* Back to top override to hide it in login screen */
.backtotop-wrap {
    display: none !important;
}

/* Language Switcher */
.lang-switcher {
    position: absolute;
    top: 24px;
    z-index: 100;
}

html[dir="rtl"] .lang-switcher {
    left: 24px;
}

html[dir="ltr"] .lang-switcher {
    right: 24px;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-card);
    border-radius: 30px;
    color: var(--text-main);
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
}

.lang-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
    border-color: rgba(59, 130, 246, 0.3);
    color: var(--primary-color);
}