/* ===== GLOBAL STYLES ===== */
:root {
    --primary: #2E7D32;
    --secondary: #C62828;
    --accent: #F9A825; 
    --light: #FAFAFA;
    --dark: #1B1B1B;
    --success: #4CAF50;
    --warning: #FFC107;
    --danger: #F44336;
    --text: #333333;
    --text-light: #6C757D;
    --border: #E0E6F6;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.15);
    --radius: 12px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', 'Tajawal', sans-serif;
    background: linear-gradient(135deg, #F1F8E9 0%, #FFFDE7 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Background Animation */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.2) 0%, transparent 50%);
    z-index: -1;
}

/* ===== FLOATING ELEMENTS ===== */
.floating-element {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    animation: float 6s ease-in-out infinite;
}

.floating-element:nth-child(1) {
    width: 80px;
    height: 80px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.floating-element:nth-child(2) {
    width: 120px;
    height: 120px;
    top: 70%;
    left: 80%;
    animation-delay: 2s;
}

.floating-element:nth-child(3) {
    width: 60px;
    height: 60px;
    top: 20%;
    left: 85%;
    animation-delay: 4s;
}

@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(10deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

/* ===== AUTH LAYOUT ===== */
.auth-layout {
    min-height: 100vh;
}

.no-gutters {
    margin-right: 0;
    margin-left: 0;
}

.no-gutters > .col,
.no-gutters > [class*="col-"] {
    padding-right: 0;
    padding-left: 0;
}

/* ===== WELCOME SECTION ===== */
.welcome-section {
    background: linear-gradient(135deg, var(--primary) 0%, #4CAF50 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: white;
    position: relative;
    overflow: hidden;
}

.welcome-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,0 L100,0 L100,100 Z" fill="rgba(255,255,255,0.05)"/></svg>');
    background-size: cover;
}

.welcome-content {
    text-align: center;
    z-index: 1;
    position: relative;
    max-width: 500px;
    width: 100%;
}

.company_logo {
    margin-bottom: 30px;
}

.company_logo img {
    max-width: 100%;
    height: auto;
    filter: brightness(0) invert(1);
}

.main_heading {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.heading_caption {
    font-size: 18px;
    margin-bottom: 40px;
    opacity: 0.9;
}

.welcome-features {
    margin-top: 50px;
}

.feature-item {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 16px;
    gap: 15px;
}

.feature-item i {
    font-size: 20px;
    width: 24px;
}

/* ===== FORM SECTION ===== */
.form-section {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.form-container {
    width: 100%;
    max-width: 400px;
    animation: fadeIn 0.8s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-header {
    text-align: center;
    margin-bottom: 30px;
}

.form_main_heading {
    font-size: 32px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 10px;
    position: relative;
    padding-bottom: 15px;
}

.form_main_heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, var(--primary), var(--accent));
    border-radius: 3px;
}

.form-header p {
    color: var(--text-light);
    font-size: 16px;
}

/* ===== FORM ELEMENTS ===== */
.input-field {
    margin-top: 20px;
}

.form-group {
    margin-bottom: 25px;
    animation: slideIn 0.5s ease forwards;
    opacity: 0;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animation delays for multiple form groups */
.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }
.form-group:nth-child(4) { animation-delay: 0.4s; }
.form-group:nth-child(5) { animation-delay: 0.5s; }

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== CLEAN INPUT FIELDS ===== */
.input-field {
    position: relative;
    width: 100%;
}

.input-field .form-control {
    width: 100%;
    height: 52px;
    padding: 0 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    font-family: 'Poppins', 'Tajawal', sans-serif;
    transition: var(--transition);
    background: var(--light);
}

.input-field .form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.1);
    background: white;
}

/* Placeholder styling */
.input-field .form-control::placeholder {
    color: var(--text-light);
    opacity: 0.7;
}

/* ===== PASSWORD FIELD ===== */
.password-field {
    position: relative;
    width: 100%;
}

.password-field .form-control {
    padding-right: 50px; /* Make space for the eye icon */
}

.password-toggle {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    background: none;
    border: none;
    font-size: 18px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: var(--primary);
}

/* ===== SELECT ELEMENTS ===== */
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236C757D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 20px center;
    background-size: 16px;
    padding-right: 50px;
}

/* ===== BUTTONS ===== */
.btn-login {
    display: block;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(74, 108, 247, 0.3);
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: var(--transition);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(74, 108, 247, 0.4);
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:active {
    transform: translateY(0);
}

/* ===== ALERT MESSAGES ===== */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.alert-danger {
    background-color: rgba(244, 67, 54, 0.1);
    color: var(--danger);
    border: 1px solid rgba(244, 67, 54, 0.2);
}

.alert-success {
    background-color: rgba(76, 175, 80, 0.1);
    color: var(--success);
    border: 1px solid rgba(76, 175, 80, 0.2);
}

/* ===== FORM FOOTER ===== */
.form-footer {
    text-align: center;
    margin-top: 25px;
    font-size: 14px;
    color: var(--text-light);
}

.form-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    display: inline-block;
}

.form-footer a:hover {
    text-decoration: underline;
    transform: translateY(-2px);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 991px) {
    .auth-layout {
        flex-direction: column;
    }
    
    .welcome-section, 
    .form-section {
        width: 100%;
        min-height: 50vh;
    }
    
    .welcome-content {
        max-width: 400px;
    }
    
    .main_heading {
        font-size: 36px;
    }
}

@media (max-width: 768px) {
    .welcome-section, 
    .form-section {
        padding: 30px 20px;
    }
    
    .main_heading {
        font-size: 32px;
    }
    
    .form_main_heading {
        font-size: 28px;
    }
    
    .company_logo img {
        max-width: 160px;
    }
}

@media (max-width: 480px) {
    .welcome-section, 
    .form-section {
        padding: 25px 15px;
    }
    
    .main_heading {
        font-size: 28px;
    }
    
    .form_main_heading {
        font-size: 24px;
    }
    
    .input-field .form-control {
        height: 48px;
        font-size: 15px;
    }
    
    .btn-login {
        padding: 14px;
        font-size: 15px;
    }
    
    .company_logo img {
        max-width: 140px;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.form-control:focus-visible,
.btn-login:focus-visible,
.form-select:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary: #0000FF;
        --secondary: #000080;
        --text: #000000;
        --border: #000000;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --light: #1a1a1a;
        --dark: #ffffff;
        --text: #e0e0e0;
        --text-light: #a0a0a0;
        --border: #444444;
    }
    
    .form-section {
        background: rgba(30, 30, 30, 0.95);
        color: var(--text);
    }
    
    .input-field .form-control {
        background: #2a2a2a;
        color: var(--text);
        border-color: var(--border);
    }
    
    .input-field .form-control:focus {
        background: #333333;
    }
}