/* ===========================================
   FICHIER : style.css
   DESCRIPTION : Styles principaux du site Nakemi
   AUTEUR : Ton Nom
   DATE : 2024
   =========================================== */

/* 
  IMPORTANT : Ce fichier contient tous les styles
  du site. Organisé par sections.
*/

/* ===========================================
   1. RESET & VARIABLES GLOBALES
   =========================================== */

/* Reset des marges et paddings */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* Inclut padding/border dans width/height */
    font-family: "Poppins", sans-serif;
}

/* Variables CSS (couleurs, espacements) */
:root {
    /* Couleurs principales */
    --primary-color: #4a6fa5;       /* Bleu principal */
    --secondary-color: #166088;     /* Bleu foncé */
    --accent-color: #ff6b6b;        /* Rouge/Orange accent */
    --light-color: #f8f9fa;         /* Fond clair */
    --dark-color: #343a40;          /* Texte foncé */
    
    /* Couleurs de notification */
    --success-color: #2ed573;       /* Vert succès */
    --error-color: #ff4757;         /* Rouge erreur */
    --warning-color: #ffa502;       /* Orange avertissement */
    
    /* Espacements standards */
    --spacing-xs: 5px;
    --spacing-sm: 10px;
    --spacing-md: 20px;
    --spacing-lg: 30px;
    --spacing-xl: 50px;
    
    /* Rayons de bordure */
    --border-radius-sm: 5px;
    --border-radius-md: 15px;
    --border-radius-lg: 25px;
    
    /* Ombres */
    --shadow-light: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-medium: 0 4px 20px rgba(0,0,0,0.15);
    --shadow-heavy: 0 8px 30px rgba(0,0,0,0.2);
}

/* ===========================================
   2. STYLES GÉNÉRAUX DU BODY
   =========================================== */

body {
    height: 100vh; /* Prend toute la hauteur de la fenêtre */
    background-image: url(../asset/bac8.jpg); /* Image de fond */
    
    /* Centrage du contenu */
    display: flex;
    justify-content: center; /* Centre horizontalement */
    align-items: center;     /* Centre verticalement */
    
    /* Image de fond */
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    
    /* Pour mobile : permet le scrolling si contenu trop long */
    min-height: 100vh;
    overflow-x: hidden; /* Cache la scrollbar horizontale */
}

/* ===========================================
   3. SECTION PRINCIPALE (Formulaire)
   =========================================== */

/* Style de la section contenant le formulaire */
section {
    background-color: transparent; /* Fond transparent */
    border: 2px solid rgba(255, 255, 255, 0.2); /* Bordure blanche semi-transparente */
    backdrop-filter: blur(20px); /* Effet de flou derrière */
    padding: var(--spacing-lg); /* Utilise la variable d'espacement */
    width: 420px; /* Largeur fixe */
    border-radius: var(--border-radius-lg); /* Coins arrondis */
    
    /* Pour mobile : s'adapte à l'écran */
    max-width: 90%; /* Ne dépasse pas 90% de l'écran */
    margin: var(--spacing-md); /* Marge sur les côtés */
}

/* Titre de la section */
section h1 {
    font-size: 30px;
    text-align: center;
    color: white;
    margin-bottom: var(--spacing-lg);
    
    /* Ombre sur le texte pour meilleure lisibilité */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* ===========================================
   4. CHAMPS DE FORMULAIRE (Inputs)
   =========================================== */

/* Conteneur d'un champ input */
.input-box {
    width: 100%;
    position: relative; /* Pour positionner l'icône */
    margin-bottom: var(--spacing-lg);
}

/* Style des inputs */
.input-box input {
    width: 100%;
    padding: 15px;
    border-radius: var(--border-radius-lg);
    outline: none; /* Supprime le contour par défaut */
    background-color: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding-right: 40px; /* Espace pour l'icône */
    font-size: 16px; /* Taille de police standard */
    transition: all 0.3s ease; /* Animation fluide */
}

/* Placeholder des inputs */
.input-box input::placeholder {
    color: white;
    opacity: 0.7; /* Légère transparence */
}

/* Effet au focus (quand on clique sur l'input) */
.input-box input:focus {
    border-color: rgba(255, 255, 255, 0.5); /* Bordure plus visible */
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2); /* Lueur */
}

/* Icônes à l'intérieur des inputs */
.input-box i {
    position: absolute;
    transform: translateY(-50%); /* Centre verticalement */
    right: 20px;
    top: 50%;
    color: white;
    pointer-events: none; /* L'icône ne bloque pas le clic */
}

/* ===========================================
   5. CHECKBOX "SE SOUVENIR DE MOI"
   =========================================== */

.remember-forgot {
    display: flex;
    justify-content: space-between; /* Espace entre les éléments */
    align-items: center;
    font-size: 14px;
    color: white;
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap; /* Passe à la ligne si pas assez de place */
}

/* Style des liens dans .remember-forgot */
.remember-forgot a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

/* Effet hover sur les liens */
.remember-forgot a:hover {
    text-decoration: underline;
    color: var(--accent-color); /* Change de couleur au survol */
}

/* Style du label checkbox */
.remember-forgot label {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs); /* Espace entre checkbox et texte */
    cursor: pointer; /* Curseur main */
}

/* Style personnalisé de la checkbox */
.remember-forgot input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-color); /* Couleur de la checkbox */
}

/* ===========================================
   6. BOUTON DE CONNEXION
   =========================================== */

.login-btn {
    width: 100%;
    padding: 15px;
    border-radius: var(--border-radius-lg);
    outline: none;
    border: 0;
    font-weight: bold;
    font-size: 16px;
    border: 2px solid transparent; /* Bordure invisible par défaut */
    transition: all 0.5s ease;
    cursor: pointer;
    background-color: white; /* Fond blanc */
    color: #333; /* Texte foncé */
    
    /* Effet 3D léger */
    box-shadow: var(--shadow-light);
}

/* Effet au survol du bouton */
.login-btn:hover {
    background-color: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateY(-2px); /* Léger soulèvement */
    box-shadow: var(--shadow-medium);
}

/* Effet quand on clique sur le bouton */
.login-btn:active {
    transform: translateY(0); /* Retour à la position initiale */
    box-shadow: var(--shadow-light);
}

/* ===========================================
   7. LIEN D'INSCRIPTION
   =========================================== */

.register-link {
    text-align: center;
    margin-top: var(--spacing-lg);
    color: #fff;
    font-size: 14px;
}

/* Style des liens dans .register-link */
.register-link a {
    color: white;
    text-decoration: none;
    transition: color 0.5s;
    font-weight: bold;
}

/* Effet hover sur les liens d'inscription */
.register-link a:hover {
    text-decoration: underline;
    color: var(--accent-color); /* Même couleur que les autres liens */
}

/* ===========================================
   8. MEDIA QUERIES (RESPONSIVE)
   =========================================== */

/* Tablettes (écrans de 768px et moins) */
@media (max-width: 768px) {
    section {
        width: 90%; /* Prend plus de place sur tablette */
        padding: var(--spacing-md);
    }
    
    section h1 {
        font-size: 26px; /* Titre plus petit */
    }
    
    .input-box input {
        padding: 12px; /* Padding réduit */
    }
    
    .remember-forgot {
        flex-direction: column; /* Empile les éléments */
        align-items: flex-start;
        gap: var(--spacing-sm);
    }
}

/* Téléphones (écrans de 480px et moins) */
@media (max-width: 480px) {
    section {
        width: 95%;
        padding: 15px;
        border-radius: var(--border-radius-md); /* Coins moins arrondis */
    }
    
    section h1 {
        font-size: 22px;
        margin-bottom: var(--spacing-md);
    }
    
    .input-box {
        margin-bottom: var(--spacing-md);
    }
    
    .input-box input {
        padding: 10px;
        font-size: 14px;
    }
    
    .login-btn {
        padding: 12px;
        font-size: 14px;
    }
    
    .register-link {
        font-size: 12px;
    }
}

/* Très petits écrans (écrans de 320px et moins) */
@media (max-width: 320px) {
    section {
        border: 1px solid rgba(255, 255, 255, 0.2); /* Bordure plus fine */
        backdrop-filter: blur(10px); /* Moins de flou */
    }
    
    .input-box i {
        right: 10px; /* Icône plus proche du bord */
        font-size: 14px;
    }
}

/* ===========================================
   9. CLASSES UTILITAIRES (réutilisables)
   =========================================== */

/* Pour cacher un élément */
.hidden {
    display: none !important;
}

/* Pour rendre un élément invisible mais garder sa place */
.invisible {
    visibility: hidden;
}

/* Message d'erreur */
.error-message {
    color: var(--error-color);
    font-size: 14px;
    margin-top: var(--spacing-xs);
    display: none; /* Caché par défaut */
}

/* Message de succès */
.success-message {
    color: var(--success-color);
    font-size: 14px;
    margin-top: var(--spacing-xs);
}

/* Loader/spinner */
.loader {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===========================================
   10. ÉTATS SPÉCIAUX
   =========================================== */

/* Input en état d'erreur */
.input-error {
    border-color: var(--error-color) !important;
    background-color: rgba(255, 71, 87, 0.1) !important;
}

/* Input en état de succès */
.input-success {
    border-color: var(--success-color) !important;
    background-color: rgba(46, 213, 115, 0.1) !important;
}

/* Bouton désactivé */
.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
}

/* Bouton désactivé au hover */
.btn-disabled:hover {
    transform: none !important;
    box-shadow: var(--shadow-light) !important;
}

/* 
   TODO: À AJOUTER PLUS TARD
   - Dark/light mode toggle
   - Animations d'entrée
   - Styles pour les modales
   - Styles pour les notifications toast
*/

/* 
   FIXME: PROBLÈMES CONNUS
   - Sur iOS, le backdrop-filter peut ralentir l'animation
   - Sur vieux navigateurs, les variables CSS ne sont pas supportées
   - Le placeholder blanc sur fond clair n'est pas visible
*/