/* ============================================
   MODERN AI-FOCUSED AUTHENTICATION PAGES
   Dark Blue Theme with Advanced Animations
   ============================================ */

:root {
    /* Dark Blue Color Palette - Matching AI theme */
    --primary-dark: #0a0e1a;
    --primary-blue: #0f1729;
    --secondary-blue: #1a2236;
    --accent-blue: #4f46e5;
    --bright-blue: #6366f1;
    --electric-blue: #818cf8;
    --cyan-glow: #0ea5e9;
    --purple-accent: #8b5cf6;
    
    /* Gradients - Updated for better visual */
    --gradient-primary: linear-gradient(135deg, #0f1729 0%, #0a0e1a 100%);
    --gradient-accent: linear-gradient(135deg, #4f46e5 0%, #8b5cf6 100%);
    --gradient-glow: linear-gradient(135deg, #0ea5e9 0%, #4f46e5 100%);
    --gradient-card: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(139, 92, 246, 0.06) 100%);
    
    /* Text Colors - ALL LIGHT */
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-accent: #818cf8;
    --text-bright: #ffffff;
    
    /* Effects - Softer for mobile */
    --glow-blue: 0 0 25px rgba(79, 70, 229, 0.5);
    --glow-cyan: 0 0 30px rgba(14, 165, 233, 0.4);
    --shadow-card: 0 15px 40px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 25px 50px rgba(79, 70, 229, 0.25);
    
    /* Glass Effect - Better transparency */
    --glass-bg: rgba(15, 23, 41, 0.75);
    --glass-border: rgba(79, 70, 229, 0.25);
    
    /* Transitions */
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s ease;
}

/* ============================================
   BODY & BACKGROUND STYLES
   ============================================ */

.login-section,
.signup-section {
    background: linear-gradient(135deg, #0a0e1a 0%, #0f1729 50%, #1a2236 100%) !important;
    color: var(--text-primary) !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    line-height: 1.6 !important;
    overflow-x: hidden !important;
    position: relative !important;
    min-height: 100vh !important;
}

/* Animated Background - DISABLED to prevent mobile overlay issues */
.login-section::before,
.signup-section::before {
    display: none !important;
}

/* Floating Particles Animation - DISABLED to prevent mobile overlay issues */
.login-section::after,
.signup-section::after {
    display: none !important;
}

/* ============================================
   FORM CONTAINER STYLES
   ============================================ */

.login-form {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(30px) !important;
    -webkit-backdrop-filter: blur(30px) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 24px !important;
    box-shadow: var(--shadow-card) !important;
    padding: 3rem 2.5rem !important;
    position: relative !important;
    z-index: 100 !important;
    transition: var(--transition-smooth) !important;
    overflow: hidden !important;
}

.login-form::before {
    content: '';
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: var(--gradient-card) !important;
    opacity: 0.5 !important;
    z-index: -1 !important;
}

.login-form:hover {
    transform: translateY(-5px) !important;
    box-shadow: var(--shadow-hover) !important;
    border-color: rgba(79, 70, 229, 0.4) !important;
}

/* Remove any white background overrides */
.login-form.bg-white {
    background: var(--glass-bg) !important;
}

/* ============================================
   LOGO STYLES
   ============================================ */

.logo img {
    filter: brightness(1.2) drop-shadow(var(--glow-blue));
    transition: var(--transition-fast);
    max-height: 45px !important;
}

.logo:hover img {
    filter: brightness(1.4) drop-shadow(var(--glow-cyan));
    transform: scale(1.05);
}

/* ============================================
   HEADING STYLES
   ============================================ */

.login-form h3 {
    color: var(--text-bright) !important;
    font-size: 2rem !important;
    font-weight: 700 !important;
    margin-bottom: 1.5rem !important;
    text-align: center !important;
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
    animation: fadeInUp 0.8s ease-out;
}

.login-form p {
    color: var(--text-secondary) !important;
    text-align: center !important;
    margin-bottom: 2rem !important;
    font-size: 1rem !important;
    opacity: 0.9;
}

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

/* ============================================
   FORM INPUT STYLES
   ============================================ */

.form-label {
    color: var(--text-bright) !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    margin-bottom: 0.5rem !important;
    display: block !important;
}

.form-control {
    background: rgba(30, 41, 59, 0.6) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    border-radius: 12px !important;
    color: var(--text-bright) !important;
    font-size: 1rem !important;
    padding: 0.875rem 1rem !important;
    transition: var(--transition-smooth) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.form-control::placeholder {
    color: var(--text-secondary) !important;
    opacity: 0.7 !important;
}

.form-control:focus {
    background: rgba(30, 41, 59, 0.8) !important;
    border-color: var(--accent-blue) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
    color: var(--text-bright) !important;
    outline: none !important;
}

.form-control:hover {
    border-color: rgba(59, 130, 246, 0.5) !important;
}

/* ============================================
   BUTTON STYLES
   ============================================ */

.btn.sg-btn-primary,
.btn-primary {
    background: var(--gradient-accent) !important;
    border: none !important;
    border-radius: 12px !important;
    color: white !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    padding: 1rem 2rem !important;
    position: relative !important;
    overflow: hidden !important;
    transition: var(--transition-smooth) !important;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3) !important;
    text-transform: none !important;
}

.btn.sg-btn-primary:hover,
.btn-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.4) !important;
    background: var(--gradient-accent) !important;
}

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

.btn.sg-btn-primary:hover::before,
.btn-primary:hover::before {
    left: 100%;
}

/* Secondary buttons */
.template-btn.bordered-btn-secondary {
    background: rgba(59, 130, 246, 0.1) !important;
    border: 2px solid var(--accent-blue) !important;
    border-radius: 8px !important;
    color: var(--electric-blue) !important;
    font-weight: 500 !important;
    padding: 0.5rem 1rem !important;
    transition: var(--transition-smooth) !important;
}

.template-btn.bordered-btn-secondary:hover {
    background: rgba(59, 130, 246, 0.2) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.2) !important;
}

/* ============================================
   CHECKBOX STYLES
   ============================================ */

.custom-checkbox {
    position: relative;
    margin: 1rem 0;
}

.custom-checkbox label {
    color: var(--text-secondary) !important;
    font-size: 0.9rem !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.custom-checkbox input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(59, 130, 246, 0.5);
    border-radius: 4px;
    background: rgba(30, 41, 59, 0.6);
    position: relative;
    cursor: pointer;
    transition: var(--transition-fast);
}

.custom-checkbox input[type="checkbox"]:checked {
    background: var(--gradient-accent);
    border-color: var(--accent-blue);
}

.custom-checkbox input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 2px;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* ============================================
   LINK STYLES
   ============================================ */

.sg-text-primary,
a.sg-text-primary {
    color: var(--electric-blue) !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    transition: var(--transition-fast) !important;
    position: relative !important;
}

.sg-text-primary:hover,
a.sg-text-primary:hover {
    color: var(--cyan-glow) !important;
    text-shadow: 0 0 10px rgba(6, 182, 212, 0.5) !important;
}

.sg-text-primary::after,
a.sg-text-primary::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-glow);
    transition: width 0.3s ease;
}

.sg-text-primary:hover::after,
a.sg-text-primary:hover::after {
    width: 100%;
}

/* ============================================
   TEXT ALIGNMENT AND SPACING
   ============================================ */

.text-center {
    text-align: center !important;
}

.text-center.d-block {
    color: var(--text-secondary) !important;
    margin: 1rem 0 !important;
    font-size: 0.9rem !important;
}

.mb-30 {
    margin-bottom: 1.5rem !important;
}

.mb-20 {
    margin-bottom: 1rem !important;
}

/* ============================================
   ERROR MESSAGES
   ============================================ */

.text-danger,
.nk-block-des.text-danger,
.invalid-feedback {
    color: #ef4444 !important;
    font-size: 0.875rem !important;
    margin-top: 0.25rem !important;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.3) !important;
}

/* ============================================
   DEMO LOGIN BUTTONS
   ============================================ */

.login-as {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 16px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.login-as h6 {
    color: var(--text-bright) !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    margin-bottom: 1rem !important;
    text-align: center !important;
}

.login-BTN {
    display: flex !important;
    gap: 0.75rem !important;
    justify-content: center !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ============================================
   PHONE INPUT STYLES
   ============================================ */

.iti {
    width: 100% !important;
}

.iti__country-list {
    background: var(--glass-bg) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 12px !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    box-shadow: var(--shadow-card) !important;
}

.iti__country {
    color: var(--text-bright) !important;
    padding: 0.5rem 1rem !important;
}

.iti__country:hover {
    background: rgba(59, 130, 246, 0.15) !important;
}

.iti__selected-flag {
    background: rgba(30, 41, 59, 0.6) !important;
    border-right: 1px solid rgba(59, 130, 246, 0.3) !important;
}

/* ============================================
   RECAPTCHA CONTAINER
   ============================================ */

.g-recaptcha {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

/* ============================================
   LOADING ANIMATION
   ============================================ */

.loading_button {
    position: relative;
    cursor: not-allowed !important;
    opacity: 0.8;
}

/* Ensure loading buttons are hidden when they have d-none class */
.loading_button.d-none,
button.loading_button.d-none {
    display: none !important;
    visibility: hidden !important;
}

.loading_button::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ============================================
   ARABIC RTL SUPPORT
   ============================================ */

html[lang="ar"] .login-form,
html[dir="rtl"] .login-form,
.arabic-font .login-form {
    direction: rtl;
    text-align: right;
}

html[lang="ar"] .form-control,
html[dir="rtl"] .form-control,
.arabic-font .form-control {
    text-align: right;
    font-family: 'Almarai', Arial, sans-serif !important;
}

html[lang="ar"] .custom-checkbox label,
html[dir="rtl"] .custom-checkbox label,
.arabic-font .custom-checkbox label {
    flex-direction: row-reverse;
    font-family: 'Almarai', Arial, sans-serif !important;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    /* Hide floating particles on mobile */
    .login-section::after,
    .signup-section::after {
        display: none !important;
    }
    
    /* Reduce background gradient intensity on mobile */
    .login-section::before,
    .signup-section::before {
        opacity: 0.6 !important;
    }
    
    .login-form {
        padding: 2rem 1.5rem !important;
        margin: 1rem !important;
    }
    
    .login-form h3 {
        font-size: 1.75rem !important;
    }
    
    .btn.sg-btn-primary,
    .btn-primary {
        padding: 0.875rem 1.5rem !important;
    }
}

@media (max-width: 480px) {
    /* Further reduce effects on small mobile */
    .login-section::before,
    .signup-section::before {
        opacity: 0.4 !important;
    }
    
    .login-form {
        padding: 1.5rem 1rem !important;
        margin: 0.5rem !important;
    }
    
    .login-form h3 {
        font-size: 1.5rem !important;
    }
    
    .logo img {
        max-height: 35px !important;
    }
    
    .form-control {
        font-size: 0.95rem !important;
        padding: 0.75rem 0.875rem !important;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-gradient {
    background: var(--gradient-glow);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glow {
    box-shadow: var(--glow-blue);
}

/* Remove any conflicting background shapes */
.bg-rect-shape,
.bg-circle-shape,
.bg-circle-block-shape {
    display: none !important;
}

/* Ensure container positioning */
.position-relative {
    position: relative !important;
    z-index: 10 !important;
}

/* Ensure container has proper stacking */
.login-section .container,
.signup-section .container {
    position: relative !important;
    z-index: 10 !important;
}

/* Ensure row has proper stacking */
.login-section .row,
.signup-section .row {
    position: relative !important;
    z-index: 10 !important;
}

/* Ensure all interactive elements are above background */
.form-control,
.btn,
input,
textarea,
select,
button,
a {
    position: relative !important;
    z-index: 1 !important;
}

