/* 
 * Feuille de style pour le formulaire Hairly Guide Capillaire
 * Design moderne, sobre et élégant - Couleurs : blanc, noir, marron clair
 */

/* Import de la police Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 50%, #654321 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* Header */
.header {
    background: linear-gradient(135deg, #2c2c2c, #1a1a1a);
    color: white;
    text-align: center;
    padding: 40px 20px;
}

.header h1 {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.header p {
    font-size: 1.2em;
    opacity: 0.9;
    font-weight: 300;
}

/* Conteneur du formulaire */
.form-container {
    padding: 40px;
}

/* Groupes de champs */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c2c2c;
    font-size: 1.1em;
}

.required::after {
    content: " *";
    color: #A0522D;
    font-weight: bold;
}

/* Champs de saisie */
.form-control {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    font-family: 'Roboto', sans-serif;
    transition: all 0.3s ease;
    background: #fafafa;
}

.form-control:focus {
    outline: none;
    border-color: #A0522D;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(160, 82, 45, 0.1);
    transform: translateY(-2px);
}

.form-control:hover {
    border-color: #8B4513;
    background: #fff;
}

/* Groupes de cases à cocher */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fafafa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.checkbox-item:hover {
    border-color: #A0522D;
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.checkbox-item input[type="checkbox"] {
    margin-right: 10px;
    width: 20px;
    height: 20px;
    accent-color: #A0522D;
}

.checkbox-item.checked {
    border-color: #A0522D;
    background: #fff;
    box-shadow: 0 4px 12px rgba(160, 82, 45, 0.2);
}

/* Groupes de boutons radio */
.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.radio-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.radio-item:hover {
    border-color: #A0522D;
    background: #fff;
    transform: translateY(-2px);
}

.radio-item input[type="radio"] {
    margin-right: 8px;
    accent-color: #A0522D;
}

.radio-item.checked {
    border-color: #A0522D;
    background: #fff;
    box-shadow: 0 4px 12px rgba(160, 82, 45, 0.2);
}

/* Champ WhatsApp conditionnel */
.whatsapp-field {
    display: none;
    margin-top: 15px;
}

.whatsapp-field.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bouton de soumission */
.submit-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #A0522D, #8B4513);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 30px;
}

.submit-btn:hover {
    background: linear-gradient(135deg, #8B4513, #654321);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(160, 82, 45, 0.3);
}

.submit-btn:active {
    transform: translateY(-1px);
}

.submit-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Messages d'erreur */
.error-message {
    color: #d32f2f;
    font-size: 0.9em;
    margin-top: 5px;
    display: none;
}

.error-message.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Messages de succès */
.success-message {
    background: #4caf50;
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    display: none;
}

.success-message.show {
    display: block;
    animation: fadeIn 0.5s ease;
}

/* États de chargement */
.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 #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */

/* Tablettes */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 15px;
    }

    .header {
        padding: 30px 15px;
    }

    .header h1 {
        font-size: 2em;
    }

    .form-container {
        padding: 25px;
    }

    .checkbox-group {
        grid-template-columns: 1fr;
    }

    .radio-group {
        flex-direction: column;
    }
}

/* Mobiles */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .header h1 {
        font-size: 1.8em;
    }

    .header p {
        font-size: 1em;
    }

    .form-container {
        padding: 20px;
    }

    .form-control {
        padding: 12px;
        font-size: 16px; /* Évite le zoom sur iOS */
    }

    .checkbox-item,
    .radio-item {
        padding: 10px;
        font-size: 0.9em;
    }

    .submit-btn {
        padding: 15px;
        font-size: 1.1em;
    }
}

/* Très petits écrans */
@media (max-width: 320px) {
    .header {
        padding: 20px 10px;
    }

    .form-container {
        padding: 15px;
    }

    .header h1 {
        font-size: 1.5em;
    }
}

/* Mode sombre (détection automatique) */
@media (prefers-color-scheme: dark) {
    /* Vous pouvez ajouter des styles pour le mode sombre si souhaité */
}

/* Amélioration de l'accessibilité */
.form-control:focus,
.checkbox-item:focus-within,
.radio-item:focus-within,
.submit-btn:focus {
    outline: 3px solid rgba(160, 82, 45, 0.3);
    outline-offset: 2px;
}

/* Animation au chargement de la page */
.container {
    animation: slideUp 0.6s ease-out;
}

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

/* Styles pour l'impression */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .container {
        box-shadow: none;
        border-radius: 0;
    }
    
    .submit-btn {
        display: none;
    }
}