/* ===========================================
   Auth Pages - Al-Husseini Model Nursery
   Professional SaaS-grade Authentication UI
   =========================================== */

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

/* ===== CSS Variables ===== */
:root {
    --auth-primary: #0F766E;
    --auth-primary-light: #14B8A6;
    --auth-primary-dark: #115E59;
    --auth-primary-50: #F0FDFA;
    --auth-primary-100: #CCFBF1;
    --auth-accent: #F59E0B;
    --auth-accent-light: #FDE68A;
    --auth-bg: #F4F7F8;
    --auth-card-bg: #ffffff;
    --auth-text: #1E293B;
    --auth-text-secondary: #64748B;
    --auth-text-muted: #94A3B8;
    --auth-border: #E2E8F0;
    --auth-border-focus: #0F766E;
    --auth-danger: #EF4444;
    --auth-danger-bg: #FEF2F2;
    --auth-success: #10B981;
    --auth-success-bg: #F0FDF4;
    --auth-radius: 16px;
    --auth-radius-sm: 12px;
    --auth-radius-xs: 8px;
    --auth-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
    --auth-shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --auth-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Base Reset ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

/* ===== Body ===== */
.auth-body {
    font-family: 'Cairo', sans-serif;
    background: var(--auth-bg);
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    color: var(--auth-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
}

/* ===== Main Container ===== */
.auth-container {
    display: flex;
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== Split Layout Wrapper ===== */
.auth-wrapper {
    display: flex;
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== Left Panel - Illustration ===== */
.auth-illustration {
    flex: 0 0 45%;
    max-width: 45%;
    background: linear-gradient(160deg, #0F766E 0%, #0D9488 35%, #14B8A6 70%, #2DD4BF 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 3rem;
    min-width: 0;
}

/* Decorative Background Elements */
.auth-illustration::before {
    content: '';
    position: absolute;
    top: -15%;
    right: -15%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.auth-illustration::after {
    content: '';
    position: absolute;
    bottom: -10%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    border-radius: 50%;
}

/* Floating Dots Animation */
.auth-illustration .floating-dots {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.auth-illustration .floating-dots span {
    position: absolute;
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    animation: float-up 12s infinite ease-in-out;
}

.auth-illustration .floating-dots span:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 10s; }
.auth-illustration .floating-dots span:nth-child(2) { left: 25%; animation-delay: 2s; animation-duration: 14s; width: 6px; height: 6px; }
.auth-illustration .floating-dots span:nth-child(3) { left: 40%; animation-delay: 4s; animation-duration: 11s; }
.auth-illustration .floating-dots span:nth-child(4) { left: 55%; animation-delay: 1s; animation-duration: 13s; width: 10px; height: 10px; }
.auth-illustration .floating-dots span:nth-child(5) { left: 70%; animation-delay: 3s; animation-duration: 9s; }
.auth-illustration .floating-dots span:nth-child(6) { left: 85%; animation-delay: 5s; animation-duration: 15s; width: 5px; height: 5px; }

@keyframes float-up {
    0%, 100% { transform: translateY(100vh) scale(0); opacity: 0; }
    10% { opacity: 1; transform: translateY(80vh) scale(1); }
    90% { opacity: 1; }
    100% { transform: translateY(-10vh) scale(0.5); opacity: 0; }
}

/* Illustration Content */
.illustration-content {
    position: relative;
    z-index: 2;
    color: #fff;
    text-align: center;
    max-width: 400px;
}

.illustration-logo {
    width: 90px;
    height: 90px;
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.illustration-logo svg {
    width: 50px;
    height: 50px;
}

.illustration-content h1 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.illustration-content .tagline {
    font-size: 1rem;
    font-weight: 400;
    opacity: 0.85;
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

/* Feature List */
.illustration-features {
    text-align: right;
    list-style: none;
    padding: 0;
    margin: 0;
}

.illustration-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.9;
}

.illustration-features li .feature-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.illustration-features li .feature-icon svg {
    width: 18px;
    height: 18px;
}

/* ===== Right Panel - Form ===== */
.auth-form {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: var(--auth-bg);
    overflow-y: auto;
    min-width: 0;
}

.auth-form-inner {
    width: 100%;
    max-width: 440px;
    animation: slideIn 0.5s ease-out;
}

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

/* ===== Form Card ===== */
.auth-card {
    background: var(--auth-card-bg);
    border-radius: var(--auth-radius);
    padding: 2.5rem;
    box-shadow: var(--auth-shadow);
    border: 1px solid rgba(226, 232, 240, 0.6);
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.auth-card-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-card-header .mobile-logo {
    display: none;
}

.auth-card-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--auth-text);
    margin-bottom: 0.5rem;
}

.auth-card-header p {
    font-size: 0.875rem;
    color: var(--auth-text-secondary);
    font-weight: 400;
}

/* ===== Form Styles ===== */
.auth-form-group {
    margin-bottom: 1.25rem;
}

.auth-form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--auth-text);
    margin-bottom: 0.5rem;
}

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

.auth-input-wrapper .input-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--auth-text-muted);
    pointer-events: none;
    transition: var(--auth-transition);
    z-index: 2;
}

.auth-input-wrapper .input-icon svg {
    width: 18px;
    height: 18px;
}

.auth-input {
    width: 100%;
    padding: 0.8125rem 1rem 0.8125rem 2.75rem;
    font-size: 0.875rem;
    font-family: 'Cairo', sans-serif;
    color: var(--auth-text);
    background: var(--auth-bg);
    border: 1.5px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    transition: var(--auth-transition);
    outline: none;
}

.auth-input:focus {
    border-color: var(--auth-border-focus);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.auth-input:focus + .input-icon,
.auth-input:focus ~ .input-icon {
    color: var(--auth-primary);
}

.auth-input::placeholder {
    color: var(--auth-text-muted);
    font-weight: 400;
}

/* Has icon - add right padding */
.auth-input-wrapper .auth-input {
    padding-right: 2.75rem;
}

/* Password toggle */
.password-toggle {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--auth-text-muted);
    cursor: pointer;
    padding: 4px;
    z-index: 2;
    transition: var(--auth-transition);
}

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

.password-toggle svg {
    width: 18px;
    height: 18px;
}

/* ===== Form Row (2 cols) ===== */
.auth-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ===== Checkbox ===== */
.auth-checkbox-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.auth-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.8125rem;
    color: var(--auth-text-secondary);
    font-weight: 500;
}

.auth-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--auth-primary);
    border-radius: 4px;
    cursor: pointer;
}

.auth-link {
    font-size: 0.8125rem;
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--auth-transition);
}

.auth-link:hover {
    color: var(--auth-primary-dark);
    text-decoration: underline;
}

/* ===== Submit Button ===== */
.auth-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    color: #fff;
    background: linear-gradient(135deg, var(--auth-primary) 0%, var(--auth-primary-light) 100%);
    border: none;
    border-radius: var(--auth-radius-sm);
    cursor: pointer;
    transition: var(--auth-transition);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(15, 118, 110, 0.4);
}

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

.auth-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.auth-btn svg {
    width: 18px;
    height: 18px;
}

/* Button Loading Spinner */
.auth-btn .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.auth-btn.loading .spinner { display: inline-block; }
.auth-btn.loading .btn-text { display: none; }

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

/* ===== Alerts ===== */
.auth-alert {
    padding: 0.875rem 1rem;
    border-radius: var(--auth-radius-xs);
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: slideIn 0.3s ease-out;
}

.auth-alert svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.auth-alert-danger {
    background: var(--auth-danger-bg);
    color: var(--auth-danger);
    border: 1px solid #FECACA;
}

.auth-alert-success {
    background: var(--auth-success-bg);
    color: var(--auth-success);
    border: 1px solid #BBF7D0;
}

.auth-alert ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.auth-alert ul li {
    padding: 2px 0;
}

/* ===== Footer Links ===== */
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.8125rem;
    color: var(--auth-text-secondary);
}

.auth-footer a {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 700;
    transition: var(--auth-transition);
}

.auth-footer a:hover {
    color: var(--auth-primary-dark);
    text-decoration: underline;
}

/* ===== Terms Checkbox ===== */
.auth-terms {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 1.25rem;
    font-size: 0.8125rem;
    color: var(--auth-text-secondary);
}

.auth-terms input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--auth-primary);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 3px;
}

.auth-terms a {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 600;
}

/* ===== Input Error State ===== */
.auth-input.is-invalid {
    border-color: var(--auth-danger);
}

.auth-input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.invalid-feedback {
    font-size: 0.75rem;
    color: var(--auth-danger);
    margin-top: 0.375rem;
    font-weight: 500;
}

/* ===== Responsive ===== */

/* Mobile Small (≤480px) */
@media (max-width: 480px) {
    .auth-wrapper {
        flex-direction: column;
    }
    
    .auth-illustration {
        display: none;
    }
    
    .auth-form {
        padding: 1rem;
        padding-top: 2rem;
        min-height: 100vh;
        align-items: flex-start;
    }
    
    .auth-card {
        padding: 1.5rem;
        border-radius: var(--auth-radius-sm);
    }
    
    .auth-card-header h2 {
        font-size: 1.25rem;
    }
    
    .auth-card-header .mobile-logo {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 1.5rem;
    }
    
    .auth-card-header .mobile-logo .logo-icon {
        width: 56px;
        height: 56px;
        background: linear-gradient(135deg, var(--auth-primary), var(--auth-primary-light));
        border-radius: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .auth-card-header .mobile-logo .logo-icon svg {
        width: 30px;
        height: 30px;
        color: #fff;
    }
    
    .auth-form-row {
        grid-template-columns: 1fr;
    }
    
    .auth-input {
        font-size: 0.875rem;
    }
}

/* Mobile (≤768px) */
@media (max-width: 768px) {
    .auth-wrapper {
        flex-direction: column;
    }
    
    .auth-illustration {
        display: none;
    }
    
    .auth-form {
        padding: 1.5rem;
        min-height: 100vh;
        align-items: flex-start;
        padding-top: 3rem;
    }
    
    .auth-card {
        padding: 1.75rem;
    }
    
    .auth-card-header .mobile-logo {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 1.5rem;
    }
    
    .auth-card-header .mobile-logo .logo-icon {
        width: 56px;
        height: 56px;
        background: linear-gradient(135deg, var(--auth-primary), var(--auth-primary-light));
        border-radius: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .auth-card-header .mobile-logo .logo-icon svg {
        width: 30px;
        height: 30px;
        color: #fff;
    }
    
    .auth-form-row {
        grid-template-columns: 1fr;
    }
}

/* Tablet (≤1024px) */
@media (max-width: 1024px) {
    .auth-illustration {
        flex: 0 0 40%;
        max-width: 40%;
        padding: 2rem;
    }
    
    .illustration-content h1 {
        font-size: 1.5rem;
    }
    
    .auth-card {
        padding: 2rem;
    }
}
