/* ============================================
   AUTH PAGES - DESIGN MODERNE ET ÉPURÉ
   Pages: index.php, login.php, register.php, 
   forgot_password.php, reset_password.php
   ============================================ */

:root {
    --primary-color: #ec4899;
    --primary-dark: #db2777;
    --secondary-color: #f97316;
    --gold: #d4af37;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark: #1f2937;
    --gray: #6b7280;
    --light-gray: #f3f4f6;
    --white: #ffffff;
    --border-radius: 16px;
    --transition: all 0.3s ease;
}

/* ============== RESET & BASE ============== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, rgba(236,72,153,0.95) 0%, rgba(249,115,22,0.95) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.6;
    color: var(--dark);
}

/* ============== LAYOUT ============== */
.auth-container {
    width: 100%;
    max-width: 480px;
    animation: fadeInUp 0.6s ease;
}

.auth-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.auth-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: 40px 30px;
    text-align: center;
    position: relative;
}

.auth-header::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 1440 320"><path fill="rgba(255,255,255,0.1)" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,112C672,96,768,96,864,112C960,128,1056,160,1152,160C1248,160,1344,128,1392,112L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
    opacity: 0.3;
}

.auth-logo {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.auth-logo i {
    margin-right: 10px;
}

.auth-tagline {
    font-size: 0.95rem;
    opacity: 0.95;
    font-weight: 400;
    position: relative;
    z-index: 1;
}

.auth-body {
    padding: 40px 30px;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--dark);
}

.auth-subtitle {
    color: var(--gray);
    margin-bottom: 30px;
    font-size: 0.95rem;
}

/* ============== FORMS ============== */
.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--white);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.1);
}

.form-control::placeholder {
    color: #9ca3af;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="rgb(107,114,128)"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

/* ============== BUTTONS ============== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: inherit;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: var(--white);
}

.btn-block {
    width: 100%;
    display: flex;
}

.btn-google {
    background: var(--white);
    border: 2px solid #e5e7eb;
    color: var(--dark);
}

.btn-google:hover {
    background: var(--light-gray);
    border-color: #d1d5db;
}

/* ============== ALERTS ============== */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    animation: slideDown 0.3s ease;
}

.alert i {
    font-size: 1.25rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success-color);
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger-color);
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

/* ============== LINKS & TEXT ============== */
.form-footer {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.form-footer p {
    color: var(--gray);
    font-size: 0.95rem;
}

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.form-footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.text-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.text-link:hover {
    color: var(--primary-dark);
}

.forgot-password {
    text-align: right;
    margin-top: -16px;
    margin-bottom: 24px;
}

/* ============== DIVIDER ============== */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    color: var(--gray);
    font-size: 0.9rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e5e7eb;
}

.divider span {
    padding: 0 16px;
    font-weight: 500;
}

/* ============== HOME PAGE ============== */
.home-container {
    max-width: 1200px;
    margin: 0 auto;
}

.home-header {
    text-align: center;
    margin-bottom: 60px;
    color: var(--white);
}

.home-logo {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 16px;
    animation: fadeInDown 0.6s ease;
}

.home-tagline {
    font-size: 1.5rem;
    font-weight: 300;
    opacity: 0.95;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.home-cta {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 80px;
    flex-wrap: wrap;
    animation: fadeInUp 0.6s ease 0.4s both;
}

.home-cta .btn {
    min-width: 160px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
    animation: fadeInUp 0.6s ease 0.6s both;
}

.feature-card {
    background: var(--white);
    padding: 40px 30px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 2rem;
    color: var(--white);
    box-shadow: 0 8px 20px rgba(236, 72, 153, 0.3);
}

.feature-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--dark);
}

.feature-description {
    color: var(--gray);
    line-height: 1.7;
}

/* ============== PASSWORD STRENGTH ============== */
.password-strength {
    margin-top: 8px;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    transition: var(--transition);
}

.password-strength-bar {
    height: 100%;
    width: 0;
    transition: var(--transition);
}

.password-strength-bar.weak {
    width: 33%;
    background: var(--danger-color);
}

.password-strength-bar.medium {
    width: 66%;
    background: var(--warning-color);
}

.password-strength-bar.strong {
    width: 100%;
    background: var(--success-color);
}

.password-strength-text {
    font-size: 0.85rem;
    margin-top: 6px;
    font-weight: 500;
}

.password-strength-text.weak {
    color: var(--danger-color);
}

.password-strength-text.medium {
    color: var(--warning-color);
}

.password-strength-text.strong {
    color: var(--success-color);
}

/* ============== ANIMATIONS ============== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============== RESPONSIVE ============== */
@media (max-width: 640px) {
    body {
        padding: 10px;
    }
    
    .auth-header {
        padding: 30px 20px;
    }
    
    .auth-logo {
        font-size: 2rem;
    }
    
    .auth-body {
        padding: 30px 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .home-logo {
        font-size: 2rem;
    }
    
    .home-tagline {
        font-size: 1.2rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .home-cta {
        flex-direction: column;
        align-items: stretch;
    }
    
    .home-cta .btn {
        width: 100%;
    }
}

/* ============== LOADING STATE ============== */
.btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============== ACCESSIBILITY ============== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus visible pour l'accessibilité */
*:focus-visible {
    outline: 3px solid rgba(236, 72, 153, 0.5);
    outline-offset: 2px;
}
