/* Modern Authentication Pages CSS - Kindergarten Theme */

:root {
    --primary-color: #7fad39;
    --primary-dark: #6a9a2f;
    --primary-light: #a8d06a;
    --secondary-color: #ff6b6b;
    --accent-color: #4ecdc4;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --background-light: #f8f9fa;
    --white: #ffffff;
    --border-color: #e9ecef;
    --error-color: #e74c3c;
    --success-color: #27ae60;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.auth-bg-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Animated background elements */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(127, 173, 57, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 107, 107, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(78, 205, 196, 0.1) 0%, transparent 50%);
    animation: float 6s ease-in-out infinite;
    z-index: 1;
    pointer-events: none;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.auth-container {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 1200px;
    max-height: calc(100vh - 40px);
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    position: relative;
    z-index: 2;
}

.auth-illustration {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--white);
    position: relative;
    overflow: hidden;
    min-height: 0;
}

.auth-illustration::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255,255,255,0.05) 10px,
        rgba(255,255,255,0.05) 20px
    );
    animation: slide 20s linear infinite;
}

@keyframes slide {
    0% { transform: translateX(-100px) translateY(-100px); }
    100% { transform: translateX(100px) translateY(100px); }
}

.illustration-content {
    text-align: center;
    z-index: 1;
    position: relative;
}

.illustration-icon {
    font-size: 80px;
    margin-bottom: 30px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.illustration-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
}

.illustration-description {
    font-size: 1.1rem;
    opacity: 0.9;
    line-height: 1.6;
    max-width: 400px;
}

.auth-form-section {
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--white);
    min-height: 0;
}

.auth-header {
    text-align: center;
    margin-bottom: 40px;
}

.auth-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.auth-subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.form-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--background-light);
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(127, 173, 57, 0.1);
}

.form-input.error {
    border-color: var(--error-color);
}

.form-input.success {
    border-color: var(--success-color);
}

.password-container {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
    transition: var(--transition);
}

.password-toggle:hover {
    color: var(--primary-color);
}

.form-select {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--background-light);
    cursor: pointer;
    transition: var(--transition);
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--white);
}

.btn {
    width: 100%;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--accent-color);
    color: var(--white);
}

.btn-secondary:hover {
    background: #45b7aa;
    transform: translateY(-2px);
}

.form-footer {
    text-align: center;
    margin-top: 30px;
}

.form-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.form-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.error-message {
    color: var(--error-color);
    font-size: 0.85rem;
    margin-top: 5px;
    display: none;
}

.error-message.show {
    display: block;
}

.success-message {
    color: var(--success-color);
    font-size: 0.85rem;
    margin-top: 5px;
    display: none;
}

.success-message.show {
    display: block;
}

/* Role selection cards for signup */
.role-selection {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.role-card {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--background-light);
}

.role-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.role-card.selected {
    border-color: var(--primary-color);
    background: rgba(127, 173, 57, 0.1);
}

.role-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.role-title {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.role-description {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Responsive Design */
@media (min-width: 769px) and (min-height: 700px) {
    .auth-container {
        min-height: 600px;
    }
}

@media (max-width: 768px) {
    .auth-container {
        grid-template-columns: 1fr;
        max-width: 500px;
        min-height: auto;
    }
    
    .auth-illustration {
        padding: 40px 30px;
        min-height: 200px;
    }
    
    .illustration-title {
        font-size: 2rem;
    }
    
    .illustration-description {
        font-size: 1rem;
    }
    
    .auth-form-section {
        padding: 40px 30px;
    }
    
    .auth-title {
        font-size: 2rem;
    }
    
    .role-selection {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .auth-container {
        border-radius: 8px;
        max-height: calc(100vh - 20px);
    }
    
    .auth-illustration {
        padding: 30px 20px;
    }
    
    .illustration-icon {
        font-size: 60px;
    }
    
    .illustration-title {
        font-size: 1.8rem;
    }
    
    .auth-form-section {
        padding: 30px 20px;
    }
    
    .auth-title {
        font-size: 1.8rem;
    }
    
    .form-input,
    .form-select {
        padding: 12px 15px;
        font-size: 0.95rem;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 1rem;
    }
}

/* Loading states */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid var(--white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility improvements */
.form-input:focus-visible,
.form-select:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    body {
        background: white;
    }
    
    .auth-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .auth-illustration {
        background: #f0f0f0;
        color: black;
    }
/* Signup page specific styles */
.signup-illustration {
    background: linear-gradient(135deg, var(--accent-color) 0%, #45b7aa 100%);
}

.signup-illustration::before {
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 15px,
        rgba(255,255,255,0.08) 15px,
        rgba(255,255,255,0.08) 30px
    );
}

.signup-illustration .illustration-icon {
    color: rgba(255,255,255,0.9);
}
}
