/* =============================================================================
   AUTHENTICATION PAGES STYLES - SCSS CENTRALISÉ
   Pages d'authentification : login, register, forgot password
   ========================================================================== */

// Import UNIQUEMENT des mixins et variables (pas tout app-base)
@import "../core/abstracts/variables";
@import "../core/abstracts/mixins";

/* Variables CSS pour la cohérence des couleurs avec CookyBook */
:root {
    --auth-primary: var(--cookybook-primary);
    --auth-primary-dark: var(--cookybook-primary-dark);
    --auth-primary-light: var(--cookybook-primary-light);
    --auth-secondary: #667eea;
    --auth-secondary-dark: #764ba2;
    --auth-text-dark: #1e293b;
    --auth-text-muted: var(--cookybook-gray);
    --auth-border: #e2e8f0;
    --auth-white-transparent: rgba(255, 255, 255, 0.95);
    --auth-white-solid: rgba(255, 255, 255, 1);
    --auth-shadow-primary: rgba(111, 66, 193, 0.1);
    --auth-shadow-hover: rgba(111, 66, 193, 0.3);
    --auth-border-radius-lg: 20px;
    --auth-border-radius-md: 12px;
    --auth-border-radius-full: 50px;
    --auth-transition-smooth: all 0.3s ease;
}

/* =============================================================================
   LAYOUT GÉNÉRAL - SURCHARGE LES STYLES DE BASE
   ========================================================================== */

/* Cache la navbar sur les pages d'authentification */
.login-page, .register-page {
    /* Surcharge tous les styles de body pour les pages d'auth */
    &.hold-transition.layout-fixed {
        padding-top: 0 !important;
        min-height: 100vh !important;
        background: linear-gradient(135deg, var(--auth-secondary) 0%, var(--auth-secondary-dark) 100%) !important;
    }
    
    .navbar {
        display: none !important;
    }
}

/* Container principal pour centrer la carte */
.login-container,
.register-container {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--auth-secondary) 0%, var(--auth-secondary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    
    /* S'assurer que le container prend toute la hauteur */
    width: 100vw;
    margin: 0;
    overflow: hidden;
}

/* =============================================================================
   BOUTON RETOUR FLOTTANT
   ========================================================================== */

.back-button {
    position: fixed;
    top: 2rem;
    left: 2rem;
    background: rgba(255, 255, 255, 0.9);
    color: var(--auth-primary);
    padding: 0.75rem 1.5rem;
    border-radius: var(--auth-border-radius-full);
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    transition: var(--auth-transition-smooth);
    z-index: 1000;

    &:hover {
        background: var(--auth-white-solid);
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
        color: var(--auth-primary-dark);
        text-decoration: none;
    }

    /* Responsive */
    @media (max-width: 768px) {
        top: 1rem;
        left: 1rem;
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* =============================================================================
   CARTE PRINCIPALE
   ========================================================================== */

.login-card,
.register-card {
    border: none;
    border-radius: var(--auth-border-radius-lg);
    box-shadow: 0 10px 40px var(--auth-shadow-primary);
    background: var(--auth-white-transparent);
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 500px;
    padding: 3rem;
    text-align: center;
    
    /* Animation d'entrée */
    animation: fadeInUp 0.6s ease-out;

    /* Responsive */
    @media (max-width: 768px) {
        padding: 2rem;
        margin: 1rem;
    }
}

/* =============================================================================
   LOGO ET BRANDING
   ========================================================================== */

.logo-container {
    margin-bottom: 2rem;
    
    .logo {
        width: 64px;
        height: 64px;
        background: linear-gradient(135deg, #b64dcb 0%, #8b5cf6 100%);
        border-radius: var(--auth-border-radius-md);
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto;
        font-size: 24px;
        box-shadow: 0 4px 15px rgba(182, 77, 203, 0.25);
        color: white;
        
        svg {
            width: 32px;
            height: 32px;
            color: white;
        }
        
        img {
            width: 48px;
            height: 48px;
            filter: brightness(0) invert(1); // Rendre l'icône blanche
        }
    }
}

.welcome-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--auth-text-dark);
    margin-bottom: 0.5rem;
}

.welcome-subtitle {
    color: var(--auth-text-muted);
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* =============================================================================
   BOUTONS SOCIAUX
   ========================================================================== */

.social-btn {
    width: 100%;
    padding: 0.875rem;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-border-radius-md);
    background: var(--auth-white-solid);
    color: var(--auth-text-dark);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: var(--auth-transition-smooth);
    margin-bottom: 0.75rem;
    font-weight: 500;

    &:hover {
        background: #f8fafc;
        border-color: var(--auth-primary);
        text-decoration: none;
        color: var(--auth-text-dark);
        transform: translateY(-1px);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }

    svg {
        width: 20px;
        height: 20px;
    }
}

/* =============================================================================
   DIVIDER
   ========================================================================== */

.divider {
    margin: 1.5rem 0;
    color: var(--auth-text-muted);
    font-size: 0.875rem;
    position: relative;

    &::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 0;
        right: 0;
        height: 1px;
        background: var(--auth-border);
        z-index: 1;
    }

    span {
        background: var(--auth-white-transparent);
        padding: 0 1rem;
        position: relative;
        z-index: 2;
    }
}

/* =============================================================================
   FORMULAIRES
   ========================================================================== */

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

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

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--auth-border);
    border-radius: var(--auth-border-radius-md);
    font-size: 1rem;
    transition: var(--auth-transition-smooth);
    background: rgba(255, 255, 255, 0.9);

    &:focus {
        outline: none;
        border-color: var(--auth-primary);
        box-shadow: 0 0 0 3px rgba(182, 77, 203, 0.1);
        background: var(--auth-white-solid);
    }

    &::placeholder {
        color: var(--auth-text-muted);
    }
}

/* =============================================================================
   BOUTONS
   ========================================================================== */

.btn-primary {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, var(--auth-primary) 0%, var(--auth-primary-light) 100%);
    border: none;
    border-radius: var(--auth-border-radius-md);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--auth-transition-smooth);
    margin-bottom: 1rem;

    &:hover {
        background: linear-gradient(135deg, var(--auth-primary-dark) 0%, #9333ea 100%);
        transform: translateY(-2px);
        box-shadow: 0 8px 25px var(--auth-shadow-hover);
    }

    &:disabled {
        opacity: 0.6;
        transform: none;
        cursor: not-allowed;
    }
}

.btn-outline-danger {
    border: 2px solid var(--auth-primary);
    color: var(--auth-primary);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: var(--auth-border-radius-md);
    transition: var(--auth-transition-smooth);

    &:hover {
        background: linear-gradient(135deg, var(--auth-primary) 0%, var(--auth-primary-light) 100%);
        border-color: var(--auth-primary);
        color: white;
        transform: translateY(-2px);
        box-shadow: 0 8px 25px var(--auth-shadow-hover);
    }
}

/* =============================================================================
   LIENS D'AUTHENTIFICATION
   ========================================================================== */

.auth-links {
    margin-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    flex-wrap: wrap;
    gap: 1rem;

    a {
        color: var(--auth-primary);
        text-decoration: none;
        font-weight: 500;
        transition: var(--auth-transition-smooth);

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

    .text-muted {
        color: var(--auth-text-muted);
    }

    /* Responsive */
    @media (max-width: 480px) {
        flex-direction: column;
        text-align: center;
    }
}

/* =============================================================================
   ANIMATIONS
   ========================================================================== */

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

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

@media (max-width: 768px) {
    .login-container,
    .register-container {
        padding: 1rem;
    }

    .login-card,
    .register-card {
        max-width: 100%;
    }

    .welcome-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .social-btn {
        font-size: 0.875rem;
        
        svg {
            width: 18px;
            height: 18px;
        }
    }
}