@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;1,500&family=Montserrat:wght@200;300;400;600&display=swap');

/* --- 1. GÉNÉRAUX & VARIABLES --- */
:root {
    --coffee-dark: rgb(19, 15, 10);
    --coffee-dark2: rgb(19, 15, 10);
    --coffee-brown: #653e26;
    --coffee-brown2: #8e3c00;
    --coffee-light: #9c8679;
    --coffee-light2: #c6ab9c;
    --coffee-cream: #c9c4bf;
    --text-light: #ffffff;
    --glass: rgba(255, 255, 255, 0.05);
    
    /* Variables de polices */
    --font-titles: 'Cormorant Garamond', serif;
    --font-body: 'Montserrat', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html, body {
    width: 100%;
    overflow-x: hidden;
    position: relative;
}

/* Chrome, Edge, Safari */
::-webkit-scrollbar {
    width: 12px;
    position: absolute; /* overlay */
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--coffee-brown);
    border-radius: 10px;
    border: 3px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--coffee-light);
}

/* Firefox */
html {
    scrollbar-width: thin;      /* Mince */
    scrollbar-color: var(--coffee-brown) transparent;
    overflow: overlay;          /* Important ! permet l'overlay sans décalage */
}

body::before {
    content: "";
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: url('https://www.transparenttextures.com/patterns/wood-pattern.png');
    opacity: 0.01;
    pointer-events: none;
    z-index: 0;
}

body { 
    color: var(--coffee-cream); 
    background: linear-gradient( to top, var(--coffee-dark) 40%, var(--coffee-brown) 96%, var(--coffee-light) 100% ); 
    min-height: 100vh; 
    line-height: 1.7; 
    font-family: var(--font-body);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
}

/* LOADER */

/* --- CONTENEUR PRINCIPAL (Plein écran) --- */
.loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--coffee-dark);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.6s ease, visibility 0.6s;
}

/* Classe activée par le JS pour faire disparaître le loader */
.loader-hidden {
    opacity: 0;
    visibility: hidden;
}

/* --- LA TASSE --- */
.cup-container {
    position: relative;
    width: 80px;
    height: 60px;
}

.coffee-cup {
    width: 100%;
    height: 100%;
    border: 4px solid var(--coffee-light2);
    border-radius: 2px 2px 30px 30px; /* Bord arrondi en bas */
    position: relative;
    overflow: hidden; /* Important pour couper la vague qui dépasse */
    background: transparent;
    z-index: 2;
}

/* L'anse de la tasse */
.cup-handle {
    width: 18px;
    height: 25px;
    border: 4px solid var(--coffee-light2);
    border-left: none;
    border-radius: 0 15px 15px 0;
    position: absolute;
    right: -22px;
    top: 30px;
}

/* --- LE CAFÉ (L'ANIMATION DE VAGUE) --- */
.coffee-liquid {
    position: absolute;
    top: 100%; /* Commence en bas */
    left: -50%;
    width: 200%;
    height: 200%; /* Plus haut que la tasse pour couvrir pendant la rotation */
    background-color: var(--coffee-brown2);
    border-radius: 38%; /* Crée l'effet de surface arrondie */
    animation: fillAndWave 4s infinite ease-in-out;
}

@keyframes fillAndWave {
    0% {
        top: 100%;
        transform: rotate(0deg);
    }
    50% {
        top: 0%; /* Tasse pleine */
        transform: rotate(180deg);
    }
    100% {
        top: -10%; /* Déborde légèrement ou reste plein */
        transform: rotate(360deg);
    }
}

/* --- LA VAPEUR --- */
.steam-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 8px;
}

.steam-line {
    width: 4px;
    height: 15px;
    background-color: var(--coffee-cream);
    margin: 0 4px;
    border-radius: 10px;
    opacity: 0;
    animation: steamRise 2s infinite;
}

@keyframes steamRise {
    0% { transform: translateY(0) scaleX(1); opacity: 0; }
    50% { transform: translateY(-10px) scaleX(1.5); opacity: 0.4; }
    100% { transform: translateY(-25px) scaleX(2); opacity: 0; }
}


h2, h3 {
    font-family: var(--font-titles);
    font-weight: 600;
    font-size: 1.6rem;
    margin-bottom: 15px;
    color: var(--text-light);
}

strong { font-weight: 600; color: var(--text-light); }

.name {
    font-size: 0.9rem;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- 2. HEADER --- */
header {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 50px;
    overflow: hidden;
}

.logo-container {
    position: relative; /* Devient la référence pour le marbre et les lignes */
    width: 90%;
    max-width: 800px;
    z-index: 10;
}

.logo-img {
    width: 100%;
    height: auto;
    display: block;
    position: relative;
    z-index: 10; /* Passe devant le marbre et les lignes */
    filter: drop-shadow(0 10px 25px rgba(0,0,0,0.4));
    opacity: 0; /* On force l'invisibilité au départ */
}

body.loaded .logo-img {
    animation: fadeInUp 0.8s ease forwards;
}

/* Le Marbre : il remplit le haut du logo jusqu'à la moitié */
.header-bg-image {
    position: absolute;
    top: -50px; /* Dépasse un peu en haut du logo */
    left: 50%;
    transform: translateX(-50%);
    width: 100vw; /* Très large pour couvrir tout l'écran */
    height: 60%; /* S'arrête à 70% de la hauteur du logo */
    background: 
        linear-gradient(rgba(243, 182, 31, 0.2), rgba(243, 182, 31, 0.2)), 
        url('./img/marble.jpg') center top / cover no-repeat;
    background-blend-mode: overlay;
    filter: brightness(1.1) contrast(0.9);
    z-index: 1; /* Derrière le logo */
}

/* Les Lignes : elles se collent juste sous le marbre */
.header-lines-container {
    position: absolute;
    top: calc(60% - 40px); /* Aligné précisément sur le bas du marbre */
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.line1 { width: 100%; height: 10px; background-color: var(--text-light); }
.line2 { width: 100%; height: 20px; background-color: var(--text-light); }

/* Conteneur du Logo Massif */
.logo-container {
    position: relative;
    z-index: 10; 
    width: 95%; /* Prend presque toute la largeur sur mobile */
    max-width: 800px; /* Très grand sur PC comme la maquette */
    margin-top: 10px;
}

/* --- 3. BENTO GRID --- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(150px, auto);
    gap: 24px;
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
    position: relative;
}

.bento-item {
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
    padding: 40px;
    border-radius: 5px;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    opacity: 0; 
    transform: translateY(20px);
}

body.loaded .bento-item {
    animation: fadeInUp 0.8s ease forwards;
}

.bento-item:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.partners p,
.products p {
    text-align: justify;
    hyphens: auto;
}


/* Bloc Produits (Image) */
.products {
    position: relative;
    grid-column: span 2;
    animation-delay: 0.5s;
    overflow: hidden;
    z-index: 0;
}

.products::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: linear-gradient(rgba(15, 11, 8, 0.7), rgba(15, 11, 8, 0.7)), url('./img/graindecafe.jpg');
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease;
    z-index: -1;
    opacity: 0.5;
}

.products:hover::before { transform: scale(1.15); opacity: 0.8; }

/* Positions Bento */
.welcome { grid-column: span 4; animation-delay: 0s; display: flex; justify-content: center; align-items: center;}
.info { grid-column: span 2; display: flex; justify-content: space-evenly; align-items: center; background: rgba(75, 46, 31, 0.6); animation-delay: 0.3s; }
.partners { grid-column: span 1; animation-delay: 0.7s; border-left: 3px solid var(--coffee-light) !important; }
.contact-form { grid-column: span 3; animation-delay: 0.9s; }

/* --- 4. FORMULAIRE (COMPACT & ÉPURÉ) --- */
form { 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
}

.user-type { 
    display: flex; 
    gap: 10px; 
    margin-bottom: 5px; 
}

.radio-card { 
    flex: 1; 
    cursor: pointer; 
    position: relative; 
}

.radio-card input { 
    position: absolute; 
    opacity: 0; 
}

.radio-card span {
    display: block; 
    padding: 10px; 
    text-align: center;
    background: rgba(255, 255, 255, 0.05); 
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px; 
    color: white; 
    font-size: 0.7rem; 
    text-transform: uppercase; 
    transition: 0.3s;
}

.radio-card input:checked + span { 
    background: var(--coffee-brown); 
    border-color: var(--coffee-cream); 
}

.form-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 10px; 
}

.full-width { 
    grid-column: span 2; 
}

input, textarea {
    width: 100%; 
    background: var(--coffee-light); 
    border: 1px solid transparent;
    border-radius: 12px; 
    padding: 14px; 
    font-family: var(--font-body);
    font-weight: 600; 
    font-size: 0.8rem; 
    color: white; 
    transition: 0.3s;
}

input::placeholder, textarea::placeholder { 
    color: rgba(255, 255, 255, 0.6); 
}

input:focus, textarea:focus { 
    background: var(--coffee-cream); 
    color: var(--coffee-dark); 
    outline: none; 
}

textarea { 
    resize: none; 
    height: 80px; 
    text-transform: none; 
    width: 100%;
}

/* --- INFOBULLES (TOOLTIPS) AVEC FLÈCHES --- */
.input-group { 
    position: relative; 
}

/* La bulle de texte */
.input-group[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    background: var(--coffee-brown);
    color: var(--coffee-cream);
    padding: 6px 12px;
    font-size: 0.7rem;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

/* La petite flèche triangle */
.input-group[data-tooltip]::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 2px);
    right: 15px;
    border-width: 8px 8px 0 8px;
    border-style: solid;
    border-color: var(--coffee-brown) transparent transparent transparent;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s ease;
    z-index: 1000;
}

/* Affichage au survol */
.input-group[data-tooltip]:hover::after,
.input-group[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateY(-5px); /* Petit effet de levitation */
}

/* Gestion du champ entreprise et messages */
.company-hint {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 6px;
    display: block;
    transition: opacity 0.3s;
}

.company-field input:disabled {
    background: rgba(255, 255, 255, 0.3);
    color: rgba(0, 0, 0, 0.5);
    cursor: not-allowed;
}

/* Bulle Message de succès */
#form-message {
    position: absolute; 
    bottom: 85px; 
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(75, 46, 31, 0.95); /* Marron foncé comme tooltips */
    backdrop-filter: blur(10px);
    padding: 12px 25px; 
    border-radius: 12px; 
    color: white;
    font-family: var(--font-titles); 
    font-style: italic;
    font-size: 0.9rem;
    opacity: 0; 
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 100;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* La pointe marron sous le message de succès */
#form-message::after {
    content: "";
    position: absolute;
    top: 100%; /* Pointe vers le bas */
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px 8px 0 8px;
    border-style: solid;
    border-color: rgba(75, 46, 31, 0.95) transparent transparent transparent;
}

/* État affiché (géré par le JS) */
#form-message.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Animation du bouton */
button {
    font-family: var(--font-body);
    letter-spacing: 2px; 
    font-weight: 700; 
    padding: 16px;
    border-radius: 15px; 
    background: var(--coffee-light);
    color: white; 
    border: none; 
    cursor: pointer; 
    transition: 0.3s;
}

button:hover { 
    background: var(--coffee-cream); 
    color: var(--coffee-dark); 
    transform: translateY(-2px); 
}

/* --- 5. FOOTER --- */
footer {
    padding: 40px 20px;
    text-align: center;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

footer a {
    color: var(--coffee-light);
    text-decoration: none;
    font-weight: 600;
}

/* --- 6. RESPONSIVE --- */

/* Tablettes et PC portables */
@media (max-width: 1100px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 900px;
        gap: 20px;
    }
    .welcome, .contact-form, .partners  { grid-column: span 2; }
    .info, .products{ grid-column: span 1; }
    
    .logo-container {
        max-width: 600px; /* Redimensionne le bloc logo et son décor avec */
    }

        .bento-item {
        padding: 10px;
    }
}

/* Mobiles et Tablettes portrait */
@media (max-width: 768px) {
    
    header {
        min-height: 380px;
        padding-top: 30px;
    }

    /* Le décor s'ajuste par rapport à la taille du logo container */
    .header-bg-image {
        height: 60%; /* Ancrage relatif au logo */
        background-position: center top; 
        background-size: 200%;
    }

    .header-lines-container {
        top: calc(56% - 30px); /* Suit la fin du marbre */
        gap: 8px;
    }

    .line1 { height: 6px; }
    .line2 { height: 12px; }

    .logo-container {
        margin-top: 0;
        margin-bottom: 0;
    }

    .bento-grid {
        grid-template-columns: 1fr;
        padding: 0 15px;
        margin-top: 20px;
    }

    .welcome, .info, .products, .partners, .contact-form {
        grid-column: span 1;
        text-align: center;
    }
    

    .welcome {
    text-align: center; /* Centre le texte pour un look mobile plus propre */
    min-height: 200px;  /* Donne un peu de hauteur pour que le texte respire */
}

.welcome h2 {
    font-size: 1.8rem;   /* Réduit légèrement la taille du titre si besoin */
    line-height: 1.2;
}

.welcome p {
    font-size: 0.95rem;  /* Ajuste la taille du corps de texte */
    max-width: 90%;      /* Évite que le texte ne colle trop aux bords de la bulle */
    margin: 0 auto;      /* Centre le bloc de texte */
}

    .bento-item {
        padding: 20px;
    }
}

/* Petits Mobiles */
@media (max-width: 480px) {
    header {
        min-height: 300px;
    }

    .header-bg-image {
        height: 60%; 
        background-size: 250%;
    }

    .header-lines-container {
        top: calc(51% - 20px);
        gap: 5px;
    }

    .line1 { height: 4px; }
    .line2 { height: 8px; }

    .logo-container {
        max-width: 95%;
    }

    h2, h3 { font-size: 1.3rem; }

    /* Formulaire simplifié pour mobile */
    .form-grid { grid-template-columns: 1fr; }
    .full-width { grid-column: span 1; }
    .radio-card span { padding: 8px; font-size: 0.7rem; }
    
    button { 
        padding: 14px; 
        font-size: 0.8rem; 
        letter-spacing: 1px;
    }

    .input-group::after { display: none !important; }

    #form-message {
        position: relative;
        left: 0;
        transform: none;
        margin: 10px auto;
        width: 100%;
        text-align: center;
    }
    
    .name {
        margin-top: 15px;
    }

}

/* Animation de secousse pour les erreurs */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
}

.shake {
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}