/* ================================================================================================ */
/* CONTACT CLIENT CSS - "LA TABLE DE CONSULTATION"                                                 */
/* Vision: Bureau d'architecte au crépuscule - Palette "Soleil de 18h30"                         */
/* Approche: Mobile-First avec responsivité à toute épreuve                                       */
/* ================================================================================================ */

/* Variables CSS - Palette "Soleil de 18h30" */
:root {
    /* Fonds */
    --brun-cendre: #4A4644;
    --ambre-fonce: #2B2A2E;
    
    /* Lumière & Textes */
    --or-pale: #FFF5E1;
    
    /* Accents Chauds */
    --degrade-rayons: linear-gradient(45deg, #D95D39, #F0A27B);
    --orange-sanguine: #D95D39;
    --peche-douce: #F0A27B;
    
    /* Textures et Ombres */
    --texture-bois: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTAgMEg0MFY0MEgwVjBaIiBmaWxsPSIjNEE0NjQ0Ii8+CjxwYXRoIGQ9Ik0wIDEwSDQwTTAgMjBINDBNMCAzMEg0MCIgc3Ryb2tlPSIjM0EzNjM0IiBzdHJva2Utd2lkdGg9IjAuNSIgb3BhY2l0eT0iMC4zIi8+Cjwvc3ZnPgo=');
    --ombre-douce: 0 4px 20px rgba(0, 0, 0, 0.3);
    --ombre-profonde: 0 8px 40px rgba(0, 0, 0, 0.5);
    
    /* Transitions */
    --transition-smooth: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-quick: all 0.2s ease;
    
    /* Typographie */
    --font-heading: 'Georgia', 'Times New Roman', serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-manuscript: 'Caveat', 'Dancing Script', cursive;
}

/* Correction 1 : Empêcher le défilement horizontal */
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

/* Reset et Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--or-pale);
    background: var(--brun-cendre);
    overflow-x: hidden;
}

/* ================================================================================================ */
/* ACTE 1: LE SEUIL DE L'ATELIER (#contact-hero)                                                  */
/* ================================================================================================ */

#contact-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: var(--background-image-url);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(43, 42, 46, 0.8) 0%, 
        rgba(74, 70, 68, 0.7) 50%, 
        rgba(217, 93, 57, 0.3) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 400;
    color: var(--or-pale);
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
}

.typing-intro {
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    color: var(--or-pale);
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 3rem;
    line-height: 1.7;
    opacity: 0.9;
}

.scroll-invitation {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--peche-douce);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.scroll-invitation:hover {
    transform: translateY(-5px);
    color: var(--or-pale);
}

.scroll-arrow {
    width: 2px;
    height: 40px;
    background: var(--degrade-rayons);
    position: relative;
    animation: scrollPulse 2s infinite;
}

.scroll-arrow::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: -4px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 8px solid var(--peche-douce);
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.6; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(10px); }
}

/* ================================================================================================ */
/* SECTION CARREFOUR: WHATSAPP & COLLABORATEURS                                                   */
/* ================================================================================================ */

.guidance-and-gate-section {
    background: var(--ambre-fonce);
    padding: 3rem 1rem;
    border-top: 1px solid rgba(255, 245, 225, 0.1);
}

.whatsapp-guidance {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    background: rgba(255, 245, 225, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(255, 245, 225, 0.1);
    backdrop-filter: blur(10px);
}

.whatsapp-icon-container {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    background: var(--degrade-rayons);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--ombre-douce);
}

.whatsapp-icon-container svg {
    width: 30px;
    height: 30px;
}

.whatsapp-text {
    flex: 1;
}

.guidance-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--or-pale);
    margin-bottom: 1rem;
}

.guidance-description {
    color: rgba(255, 245, 225, 0.8);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.whatsapp-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--degrade-rayons);
    color: white;
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition-smooth);
    box-shadow: var(--ombre-douce);
}

.whatsapp-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--ombre-profonde);
}

.gate-separator {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin: 3rem 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.separator-line {
    flex: 1;
    height: 1px;
    background: var(--degrade-rayons);
    opacity: 0.6;
}

.separator-text {
    color: var(--peche-douce);
    font-weight: 500;
    letter-spacing: 0.1em;
    font-size: 0.9rem;
}

/* ================================================================================================ */
/* ACTE 2: LE QUESTIONNAIRE GUIDÉ (#guided-form)                                                  */
/* ================================================================================================ */

#guided-form {
    background: var(--brun-cendre);
    background-image: var(--texture-bois);
    min-height: 100vh;
    padding: 4rem 1rem;
}

.form-wrapper {
    max-width: 1400px;
    margin: 0 auto;
}

/* ================================================================================================ */
/* STRUCTURE DE LA GRILLE - MOBILE FIRST (CORRECTION PRINCIPALE)                                 */
/* ================================================================================================ */

/* MOBILE FIRST: Une seule colonne par défaut */
.form-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* COLONNE DU FORMULAIRE (.form-steps-column) - Mobile First */
.form-steps-column {
    order: 1; /* Formulaire en premier sur mobile */
}

/* COLONNE DU BLUEPRINT (.blueprint-column) - Mobile First */
.blueprint-column {
    order: 2; /* Blueprint en second sur mobile */
    /* PAS de position sticky sur mobile - trop de problèmes de performance */
}

/* DESKTOP: Configuration en deux colonnes UNIQUEMENT à partir de 1024px */
@media (min-width: 1024px) {
    .form-grid {
        display: grid;
        grid-template-columns: 1fr 500px;
        gap: 4rem;
    }
    
    .form-steps-column {
        order: 1; /* Formulaire à gauche sur desktop */
    }
    
    .blueprint-column {
        order: 2; /* Blueprint à droite sur desktop */
        position: sticky; /* Effet sticky UNIQUEMENT sur desktop */
        top: 2rem;
        height: fit-content;
    }
}

/* ================================================================================================ */
/* COLONNE DU FORMULAIRE (.form-steps-column)                                                     */
/* ================================================================================================ */

.consultation-form {
    max-width: 700px;
}

/* Étapes du formulaire */
.form-step {
    margin-bottom: 4rem;
    opacity: 0.3;
    transform: translateY(20px);
    transition: var(--transition-smooth);
}

.form-step.is-active {
    opacity: 1;
    transform: translateY(0);
}

.step-header {
    margin-bottom: 3rem;
    position: relative;
}

.step-number {
    display: inline-block;
    background: var(--degrade-rayons);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    box-shadow: var(--ombre-douce);
}

.step-title {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    color: var(--or-pale);
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.step-subtitle {
    color: rgba(255, 245, 225, 0.7);
    font-size: 1.1rem;
    font-style: italic;
}

/* Conteneur des champs */
.fields-container {
    display: grid;
    grid-template-columns: 1fr; /* Une seule colonne sur mobile */
    gap: 2rem;
}

/* Desktop: Deux colonnes pour les champs si l'espace le permet */
@media (min-width: 768px) {
    .fields-container {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

.field-wrapper {
    position: relative;
}

.field-wrapper.full-width {
    grid-column: 1 / -1;
}

/* Labels */
.field-label {
    display: block;
    color: var(--or-pale);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Correction 2 : Texte plus visible dans les champs de formulaire */
input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3); /* Bordure plus visible */
    color: #FFFFFF; /* Texte blanc pur pour meilleure visibilité */
    font-size: 1.1rem;
    padding: 1rem 0;
    font-family: var(--font-body);
    transition: var(--transition-smooth);
    outline: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
    border-bottom-color: var(--peche-douce);
    box-shadow: 0 2px 0 0 var(--orange-sanguine);
}

textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

select {
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e"); /* Icône blanche */
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
    appearance: none;
}

/* Placeholder styling */
input::placeholder,
textarea::placeholder {
    color: rgba(255, 255, 255, 0.7); /* Placeholder plus visible */
    font-style: italic;
}

/* Ligne décorative sous les champs */
.field-underline {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--degrade-rayons);
    transition: var(--transition-smooth);
}

.field-wrapper:focus-within .field-underline {
    width: 100%;
}

/* Section collaborateur */
.collaborator-gate {
    margin: 4rem 0 3rem;
    text-align: center;
    padding: 2rem;
    background: rgba(255, 245, 225, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 245, 225, 0.1);
}

.gate-text {
    color: rgba(255, 245, 225, 0.8);
    margin-bottom: 1rem;
    font-style: italic;
}

.gate-link {
    color: var(--peche-douce);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: var(--transition-quick);
}

.gate-link:hover {
    color: var(--or-pale);
    border-bottom-color: var(--peche-douce);
}

/* Bouton de soumission */
.submit-section {
    margin-top: 4rem;
    text-align: center;
}

.submit-button {
    position: relative;
    background: var(--degrade-rayons);
    color: white;
    border: none;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 1.2rem 3rem;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: var(--ombre-douce);
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: 100%; /* Pleine largeur sur mobile */
    max-width: 400px; /* Mais limitée en largeur maximale */
}

.submit-button:hover {
    transform: translateY(-3px);
    box-shadow: var(--ombre-profonde);
}

.submit-button:active {
    transform: translateY(-1px);
}

.submit-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.submit-button:hover .submit-glow {
    left: 100%;
}

/* ================================================================================================ */
/* COLONNE DU BLUEPRINT (.blueprint-column)                                                       */
/* ================================================================================================ */

.blueprint-canvas {
    background: rgba(255, 245, 225, 0.95);
    color: var(--ambre-fonce);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: var(--ombre-profonde);
    border: 1px solid rgba(74, 70, 68, 0.2);
    backdrop-filter: blur(10px);
    position: relative;
    margin-bottom: 2rem; /* Espacement sur mobile */
}

.blueprint-canvas::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 1px 1px, rgba(74, 70, 68, 0.1) 1px, transparent 0);
    background-size: 20px 20px;
    pointer-events: none;
    border-radius: 8px;
}

/* Header du blueprint */
.blueprint-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--ambre-fonce);
}

/* Desktop: Header en ligne */
@media (min-width: 768px) {
    .blueprint-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }
}

.blueprint-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ambre-fonce);
}

.logo-k {
    color: var(--orange-sanguine);
}

.blueprint-title {
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.blueprint-date {
    font-size: 0.9rem;
    color: rgba(43, 42, 46, 0.7);
    font-family: var(--font-manuscript);
}

/* Contenu du blueprint */
.blueprint-content {
    font-size: 0.9rem;
}

.blueprint-section {
    margin-bottom: 2rem;
    opacity: 0.3;
    transition: var(--transition-smooth);
}

.blueprint-section.is-active {
    opacity: 1;
}

.blueprint-section-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--ambre-fonce);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(43, 42, 46, 0.3);
    padding-bottom: 0.5rem;
}

.blueprint-field {
    display: flex;
    align-items: baseline;
    margin-bottom: 1rem;
    min-height: 1.5rem;
}

.blueprint-field.full-width {
    flex-direction: column;
    align-items: stretch;
}

.blueprint-label {
    font-weight: 600;
    color: var(--ambre-fonce);
    min-width: 100px;
    margin-right: 1rem;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

.blueprint-value {
    flex: 1;
    color: var(--orange-sanguine);
    font-family: var(--font-manuscript);
    font-size: 1rem;
    min-height: 1.2rem;
}

.blueprint-textarea {
    background: rgba(43, 42, 46, 0.05);
    padding: 0.8rem;
    border-radius: 4px;
    min-height: 60px;
    color: var(--orange-sanguine);
    font-family: var(--font-manuscript);
    font-size: 0.95rem;
    line-height: 1.4;
    margin-top: 0.5rem;
}

.blueprint-line {
    flex: 1;
    height: 1px;
    background: rgba(43, 42, 46, 0.3);
    margin-left: 1rem;
}

/* Footer du blueprint */
.blueprint-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(43, 42, 46, 0.3);
}

/* Desktop: Footer en ligne */
@media (min-width: 768px) {
    .blueprint-footer {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.blueprint-signature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.signature-line {
    width: 150px;
    height: 1px;
    background: var(--ambre-fonce);
}

.signature-label {
    font-size: 0.8rem;
    color: rgba(43, 42, 46, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.blueprint-stamp {
    opacity: 0;
    transition: var(--transition-smooth);
}

.blueprint-stamp.is-visible {
    opacity: 1;
}

.stamp-circle {
    width: 80px;
    height: 80px;
    border: 3px solid var(--orange-sanguine);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--orange-sanguine);
    font-weight: 600;
    transform: rotate(-15deg);
}

.stamp-text {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.stamp-date {
    font-size: 0.7rem;
    font-family: var(--font-manuscript);
}

/* ================================================================================================ */
/* ACTE 3: LA CONFIRMATION (#form-confirmation)                                                   */
/* ================================================================================================ */

#form-confirmation {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(43, 42, 46, 0.95);
    backdrop-filter: blur(20px);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
    padding: 2rem;
}

#form-confirmation.is-visible {
    opacity: 1;
    visibility: visible;
}

/* Animation du rouleau */
#blueprint-scroll-animation {
    margin-bottom: 3rem;
}

.scroll-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.blueprint-scroll {
    width: 300px;
    height: 400px;
    background: var(--or-pale);
    border-radius: 8px;
    box-shadow: var(--ombre-profonde);
    position: relative;
    transform: scale(0.8) rotateX(45deg);
    transition: var(--transition-smooth);
}

/* Mobile: Scroll plus petit */
@media (max-width: 480px) {
    .blueprint-scroll {
        width: 250px;
        height: 300px;
        transform: scale(0.7) rotateX(45deg);
    }
}

.blueprint-scroll::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 19px,
        rgba(43, 42, 46, 0.1) 20px
    );
    border-radius: 8px;
}

.wax-seal {
    position: relative;
    margin-top: -30px;
    z-index: 2;
}

.seal-circle {
    width: 60px;
    height: 60px;
    background: var(--degrade-rayons);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: var(--ombre-douce);
}

.wax-drips {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 15px;
    background: var(--orange-sanguine);
    border-radius: 0 0 50% 50%;
    opacity: 0.8;
}

/* Message de succès */
.success-message {
    text-align: center;
    max-width: 600px;
}

.success-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 3rem);
    color: var(--or-pale);
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.success-text {
    font-size: 1.1rem;
    color: rgba(255, 245, 225, 0.9);
    line-height: 1.7;
    margin-bottom: 2.5rem;
    font-style: italic;
}

.success-actions {
    margin-top: 2rem;
}

.back-home-button {
    display: inline-block;
    background: var(--degrade-rayons);
    color: white;
    text-decoration: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition-smooth);
    box-shadow: var(--ombre-douce);
}

.back-home-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--ombre-profonde);
}

/* ================================================================================================ */
/* RESPONSIVE DESIGN - MOBILE FIRST                                                               */
/* ================================================================================================ */

/* Smartphones (Portrait) */
@media (max-width: 480px) {
    .hero-content {
        padding: 1.5rem;
    }
    
    .whatsapp-guidance {
        padding: 1.5rem;
    }
    
    .whatsapp-icon-container {
        width: 50px;
        height: 50px;
    }
    
    .whatsapp-icon-container svg {
        width: 25px;
        height: 25px;
    }
    
    .blueprint-canvas {
        padding: 1.5rem;
    }
    
    .submit-button {
        padding: 1rem 2rem;
        font-size: 1rem;
    }
}

/* Tablettes - Configuration hybride */
@media (min-width: 768px) and (max-width: 1023px) {
    .whatsapp-guidance {
        flex-direction: row;
        text-align: left;
        gap: 2rem;
        padding: 2.5rem;
    }
    
    .whatsapp-icon-container {
        width: 80px;
        height: 80px;
    }
    
    .whatsapp-icon-container svg {
        width: 40px;
        height: 40px;
    }
    
    .blueprint-canvas {
        padding: 2.5rem;
    }
}

/* Desktop Large */
@media (min-width: 1400px) {
    .form-wrapper {
        max-width: 1600px;
    }
    
    .form-grid {
        grid-template-columns: 1fr 600px;
        gap: 6rem;
    }
    
    .blueprint-canvas {
        padding: 3rem;
    }
}

/* États de performance réduite */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .scroll-arrow {
        animation: none;
    }
}

/* Mode sombre système */
@media (prefers-color-scheme: dark) {
    :root {
        --brun-cendre: #2A2824;
        --ambre-fonce: #1A1A1E;
    }
}

/* Impression */
@media print {
    #form-confirmation,
    .whatsapp-guidance,
    .scroll-invitation {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .blueprint-canvas {
        background: white;
        box-shadow: none;
        border: 2px solid black;
    }
}

/* ================================================================================================ */
/* ÉTATS SPÉCIAUX ET ANIMATIONS                                                                   */
/* ================================================================================================ */

/* États de validation des champs */
.field-wrapper.has-error input,
.field-wrapper.has-error textarea,
.field-wrapper.has-error select {
    border-bottom-color: #ff6b6b;
    color: #ff6b6b;
}

.field-wrapper.has-error .field-underline {
    background: #ff6b6b;
}

.field-wrapper.has-success input,
.field-wrapper.has-success textarea,
.field-wrapper.has-success select {
    border-bottom-color: #51cf66;
}

.field-wrapper.has-success .field-underline {
    background: #51cf66;
}

/* Messages d'erreur */
.field-error {
    color: #ff6b6b;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    opacity: 0;
    transform: translateY(-10px);
    transition: var(--transition-quick);
}

.field-error.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Loading states */
.submit-button.is-loading {
    pointer-events: none;
    opacity: 0.7;
}

.submit-button.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animations d'entrée pour les sections */
.form-step.animate-in {
    animation: slideInUp 0.6s ease-out forwards;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.blueprint-section.animate-in {
    animation: fadeInScale 0.4s ease-out forwards;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animation du typing effect */
.typing-cursor::after {
    content: '|';
    animation: blink 1s infinite;
    color: var(--peche-douce);
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Animation de la soumission réussie */
.form-success-animation {
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* ================================================================================================ */
/* MICRO-INTERACTIONS ET DÉTAILS                                                                  */
/* ================================================================================================ */

/* Focus visible pour l'accessibilité */
*:focus-visible {
    outline: 2px solid var(--peche-douce);
    outline-offset: 2px;
}

/* Amélioration du contraste pour les éléments interactifs */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--or-pale);
    outline-offset: 3px;
}

/* Animation subtle pour les liens */
a {
    position: relative;
    transition: var(--transition-quick);
}

a:not(.whatsapp-button):not(.back-home-button):not(.submit-button)::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--degrade-rayons);
    transition: width 0.3s ease;
}

a:not(.whatsapp-button):not(.back-home-button):not(.submit-button):hover::after {
    width: 100%;
}

/* Glow effect pour les éléments importants */
.blueprint-canvas.is-updated {
    box-shadow: 
        var(--ombre-profonde),
        0 0 30px rgba(240, 162, 123, 0.3);
    animation: gentleGlow 1s ease-out;
}

@keyframes gentleGlow {
    0% { box-shadow: var(--ombre-profonde); }
    50% { box-shadow: var(--ombre-profonde), 0 0 30px rgba(240, 162, 123, 0.5); }
    100% { box-shadow: var(--ombre-profonde), 0 0 30px rgba(240, 162, 123, 0.3); }
}

/* Particules flottantes pour l'ambiance */
.hero-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, rgba(255, 245, 225, 0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(240, 162, 123, 0.2), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(217, 93, 57, 0.3), transparent);
    background-repeat: repeat;
    background-size: 100px 100px;
    animation: floatParticles 20s linear infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes floatParticles {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-50px, -50px) rotate(360deg); }
}

/* Effet de profondeur pour le blueprint */
.blueprint-canvas {
    position: relative;
    transform-style: preserve-3d;
}

.blueprint-canvas::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: -8px;
    bottom: -8px;
    background: rgba(43, 42, 46, 0.2);
    border-radius: 8px;
    z-index: -1;
    filter: blur(6px);
}

/* Responsive fine-tuning pour les très grands écrans */
@media (min-width: 1800px) {
    :root {
        font-size: 18px;
    }
}

/* Responsive fine-tuning pour les très petits écrans */
@media (max-width: 320px) {
    :root {
        font-size: 14px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .blueprint-canvas {
        padding: 1rem;
    }
    
    .whatsapp-guidance {
        padding: 1rem;
    }
}

/* ================================================================================================ */
/* OPTIMISATIONS PERFORMANCE                                                                      */
/* ================================================================================================ */

/* GPU acceleration pour les animations critiques */
.hero-overlay,
.submit-button,
.blueprint-canvas,
#form-confirmation {
    will-change: transform;
    transform: translateZ(0);
}

/* Lazy loading pour les éléments non critiques */
.blueprint-section:not(.is-active) {
    content-visibility: auto;
    contain-intrinsic-size: 200px;
}

/* Optimisation des repaint */
.form-step,
.blueprint-section {
    contain: layout style paint;
}

/* ================================================================================================ */
/* ACCESSIBILITÉ AVANCÉE                                                                         */
/* ================================================================================================ */

/* Mode haute contraste */
@media (prefers-contrast: high) {
    :root {
        --or-pale: #FFFFFF;
        --brun-cendre: #000000;
        --ambre-fonce: #1A1A1A;
    }
    
    .blueprint-canvas {
        background: #FFFFFF;
        border: 3px solid #000000;
    }
    
    input, textarea, select {
        border-bottom-width: 3px;
    }
}

/* Support pour les lecteurs d'écran */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Indicateurs visuels pour la navigation au clavier */
.form-step[tabindex="0"]:focus {
    outline: 3px solid var(--peche-douce);
    outline-offset: 5px;
    border-radius: 8px;
}

/* Messages d'état pour les technologies d'assistance */
.form-status {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-status.announce {
    position: static;
    width: auto;
    height: auto;
    padding: 1rem;
    background: var(--degrade-rayons);
    color: white;
    border-radius: 8px;
    margin: 1rem 0;
    font-weight: 500;
}

/* ================================================================================================ */
/* ÉTATS DARK MODE AVANCÉS                                                                       */
/* ================================================================================================ */

@media (prefers-color-scheme: dark) {
    .blueprint-canvas {
        background: rgba(255, 245, 225, 0.98);
        box-shadow: 
            var(--ombre-profonde),
            0 0 50px rgba(0, 0, 0, 0.5);
    }
    
    .hero-overlay {
        background: linear-gradient(135deg, 
            rgba(10, 10, 12, 0.9) 0%, 
            rgba(43, 42, 46, 0.8) 50%, 
            rgba(217, 93, 57, 0.4) 100%);
    }
}

/* ================================================================================================ */
/* FIN DU FICHIER - La Table de Consultation est prête                                           */
/* ================================================================================================ */