/*
 * ====================================================================
 * Feuille de style unifiée pour l'application de formulaires Léo Téléassistance
 * Version: 2.0 (Architecture avec headers/footers séparés)
 * ====================================================================
 */

/* ---------------------------------- */
/*      Variables & Polices           */
/* ---------------------------------- */
:root {
    /* Couleurs primaires inspirées de votre site */
    --color-primary-teal: #4db6ac;
    --color-primary-teal-hover: #26a69a;
    --color-text-dark: #37474f;
    --color-text-light: #607d8b;
    --color-background-light: #f8f9fa;
    --color-footer-dark: #343a40;
    --color-border: #e0e0e0;

    /* Surcharge des variables de Pico.css pour la cohérence */
    --primary: var(--color-primary-teal);
    --primary-hover: var(--color-primary-teal-hover);
    --primary-focus: rgba(77, 182, 172, 0.25);
    --primary-inverse: #FFF;
    --h2-color: var(--color-text-dark);
    --h4-color: var(--color-text-dark);
    --muted-border-color: var(--color-border);
}

body {
    font-family: 'Work Sans', sans-serif;
    background-color: var(--color-background-light);
    color: var(--color-text-light);
}

h1,
h2,
h3,
h4,
h5,
h6,
summary {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    color: var(--color-text-dark);
}

/* Police des boutons */
button,
[type="submit"],
[role="button"] {
    font-family: 'Nunito', sans-serif;
}

/* ---------------------------------- */
/*      Header & Navigation           */
/* ---------------------------------- */
.site-header-wp {
    background-color: #ffffff;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.header-container { display: flex; justify-content: space-between; align-items: center; }
.main-logo { height: 50px; width: auto; }
.main-navigation { display: flex; align-items: center; gap: 1.5rem; }
.main-navigation ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.5rem; }
.main-navigation a { text-decoration: none; color: var(--color-text-dark); font-weight: 500; font-size: 0.9em; transition: color 0.2s ease; }
.main-navigation a:hover, .user-icon-link:hover svg { color: var(--primary); }
.user-icon-link svg { stroke: var(--color-text-dark); }

/* Styles spécifiques pour la page Héros */
.body-hero .site-header-wp {
    background-color: transparent;
    position: absolute;
    top: 0; left: 0; width: 100%;
    z-index: 100;
    border-bottom: none;
    box-shadow: none;
}
.body-hero .main-navigation a { color: #ffffff; }
.body-hero .user-icon-link svg { stroke: #ffffff; }

/* ---------------------------------- */
/*      Structure & "Hero" Background */
/* ---------------------------------- */
html {
    height: 100%;
}


body {
    /* --- LOGIQUE STICKY FOOTER --- */
    display: flex;
    flex-direction: column;
    min-height: 100%; /* S'assure que le body prend toute la hauteur */
}

.main, .hero-background {
    /* Le contenu principal (main ou hero) prendra tout l'espace disponible */
    flex-grow: 1;
}

.main-content-wrapper {
    display: flex;
    flex-direction: column;
}

.hero-background {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 150px;
    /* Pousse le formulaire vers le bas*/
    padding-bottom: 2rem;
    background-image:
        linear-gradient(rgba(40, 50, 60, 0.5), rgba(40, 50, 60, 0.5)),
        url('/images/background-form.webp');
    background-size: cover;
    background-position: center center;
}


/* ---------------------------------- */
/*      Header & Footer (Style WP)    */
/* ---------------------------------- */
.site-header-wp {
    background-color: #ffffff;
    padding: 0.5rem 0;
    /* Padding vertical réduit */
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-logo {
    height: 50px;
    width: auto;
}

.main-navigation {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.5rem;
}

.main-navigation a {
    text-decoration: none;
    color: var(--color-text-dark);
    font-weight: 500;
    font-size: 0.9em;
    transition: color 0.2s ease;
}

.main-navigation a:hover,
.user-icon-link:hover svg {
    color: var(--primary);
}

.user-icon-link svg {
    stroke: var(--color-text-dark);
}

.site-footer-wp {
    background-color: #ffffff;
    padding-top: 3rem;
    color: var(--color-text-light);
    border-top: 1px solid var(--color-border);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
    padding-bottom: 3rem;
}

.footer-column h4 {
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.footer-column h4::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: var(--primary);
}

.footer-column ul,
.contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column ul li {
    margin-bottom: 0.5rem;
}

.contact-list li {
    margin-bottom: 1rem;
    line-height: 1.4;
}

.footer-column a {
    text-decoration: none;
    color: var(--color-text-light);
}

.footer-column a:hover {
    color: var(--primary);
}

.footer-sap-logo {
    max-width: 100px;
    margin-top: 1rem;
}

.social-icons {
    display: flex;
    gap: 0.5rem;
}

.footer-bottom {
    background-color: var(--color-footer-dark);
    color: #ced4da;
    padding: 1rem 0;
    font-size: 0.85em;
    text-align: center;
    position: relative;
}

.footer-bottom .container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}

.footer-bottom a {
    color: #ffffff;
}

.back-to-top {
    position: absolute;
    right: 30px;
    bottom: 50%;
    transform: translateY(50%);
    background-color: var(--primary);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.5em;
    transition: opacity 0.2s;
}

.back-to-top:hover {
    opacity: 0.8;
}

.site-footer-wp {
    flex-shrink: 0; /* Empêche le footer de rétrécir */
}

/* ---------------------------------- */
/*      Footer (Style QR Code)        */
/* ---------------------------------- */
.site-footer-qr {
    /* background-color: var(--color-footer-dark); */
    color: #ced4da;
    padding: 1rem 0;
    font-size: 0.85em;
    text-align: center;
    margin-top: 4rem;
}

.site-footer-qr a {
    color: #ffffff;
    text-decoration: underline;
}

.site-footer-qr {
    flex-shrink: 0; /* Empêche le footer de rétrécir */
}

/* ---------------------------------- */
/*   Bannière de Contexte (Pages QR)  */
/* ---------------------------------- */
.context-banner {
    display: flex;
    justify-content: space-between;
    /* CORRECTION: Pousse les éléments de part et d'autre */
    align-items: center;
    gap: 2rem;
    padding: 1rem 1.5rem;
    /* CORRECTION: Padding vertical réduit */
    background-color: #ffffff;
    border: 1px solid var(--muted-border-color);
    border-radius: var(--border-radius);
    margin-bottom: 2.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin: 0 auto 2.5rem auto;
    /* Centre la bannière au-dessus du formulaire */
    max-width: 1152px;
    /* Correspond à la largeur max de .container de Pico */
    width: calc(100% - 2rem);
}

/* PARTIE GAUCHE (logo Léo, etc.) */
.brand-logo,
.brand-partnership {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.main-logo-in-banner {
    height: 45px;
    width: auto;
}

.separator {
    width: 1px;
    align-self: stretch;
    background-color: var(--muted-border-color);
}

/* PARTIE DROITE (infos partenaire) */
.partner-context,
.partner-details-enhanced {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    /* CORRECTION: Aligne le contenu à droite */
}

.partner-context small,
.partner-details-enhanced small {
    font-size: 0.8em;
    color: var(--muted-color);
    margin-bottom: 0.25rem;
}

.partner-id-line {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.partner-logo-in-banner {
    max-height: 35px;
    max-width: 90px;
    object-fit: contain;
}

.portal-access-button-container {
    flex-shrink: 0;
}

@media (max-width: 992px) {
    .qr-context-banner {
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
    }

    .portal-access-button-container {
        padding-top: 1.5rem;
        border-top: 1px solid var(--muted-border-color);
        text-align: center;
    }

    .portal-access-button-container a {
        width: 100%;
        justify-content: center;
    }
}

/*
/* ---------------------------------- */
/*      Styles de Boutons Unifiés     */
/* ---------------------------------- */

/* Style de base pour tous les boutons principaux (type="submit", role="button") */
button,
[type="submit"],
[role="button"] {
    /* On définit les variables de Pico.css pour le fond et la bordure */
    --background-color: var(--primary);
    --border-color: var(--primary);

    /* --- CORRECTION CRUCIALE --- */
    /* On applique la couleur du texte directement pour surcharger la règle générale */
    color: var(--primary-inverse) !important;

    font-weight: bold;
}

/* Style au survol pour tous les boutons principaux */
button:hover,
[type="submit"]:hover,
[role="button"]:hover {
    --background-color: var(--primary-hover);
    --border-color: var(--primary-hover);
    color: var(--primary-inverse) !important;
    /* On s'assure que le texte reste blanc au survol */
}

/* Cas spécifique du bouton "portal-button" (on garde la règle pour son icône) */
.portal-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 12px 20px;
}

.portal-button svg {
    flex-shrink: 0;
}

/* Cas spécifique des boutons "outline" que vous pourriez vouloir réutiliser */
/* On s'assure qu'ils sont lisibles aussi */
[role="button"].outline {
    --background-color: transparent;
    --border-color: var(--primary);
    --color: var(--primary);
    /* Texte de la couleur primaire */
}

[role="button"].outline:hover {
    --background-color: var(--primary);
    --color: var(--primary-inverse);
    /* Inverse les couleurs au survol */
}

/* Cas du bouton de chargement "secondary" */
button.secondary[aria-busy="true"] {
    color: var(--muted-color);
    /* Un texte gris clair pour le bouton de chargement */
}

/* ---------------------------------- */
/*      Mise en page & Formulaire     */
/* ---------------------------------- */
/* .container {
    padding: 2rem;
} */

main {
    padding: 0;
    background-color: transparent;
    border: none;
    box-shadow: none;
}

.form-container {
    background-color: #ffffff;
    padding: 2.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.07);
    margin-bottom: 2.5rem;
}

.hero-background .form-container {
    max-width: 800px;
    margin: 0 auto;
}

.form-container h2 {
    text-align: center;
    margin-bottom: 2.5rem;
}

.choice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.choice-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem;
    border: 2px solid var(--muted-border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-align: center;
}

.choice-card:hover {
    border-color: var(--primary-hover);
    background-color: #fafafa;
    transform: translateY(-3px);
}

.choice-card.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-focus);
    background-color: #ffffff;
}

.choice-card svg {
    width: 36px;
    height: 36px;
    stroke: var(--primary);
    margin-bottom: 0.5rem;
    flex-shrink: 0;
}

.hidden {
    display: none !important;
}

#fields-wrapper {
    transition: all 0.3s ease-in-out;
    padding: 2rem;
    margin-top: 2rem;
    border: 1px solid var(--muted-border-color);
    border-radius: var(--border-radius);
}

.conditional-group {
    border-top: 1px dashed var(--muted-border-color);
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}

.conditional-group:first-child {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

.sub-choice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.choice-card-small {
    padding: 0.75rem;
    border: 2px solid var(--muted-border-color);
    border-radius: var(--border-radius);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.choice-card-small:hover {
    border-color: var(--primary-hover);
    background-color: #fafafa;
}

.choice-card-small.active {
    border-color: var(--primary);
    background-color: var(--primary);
    color: var(--primary-inverse);
    font-weight: bold;
}

.submit-container {
    margin-top: 1.5rem;
}

.submit-container button {
    width: 100%;
}


/* ---------------------------------- */
/*       Styles Page Partenaire       */
/* ---------------------------------- */
.offers-section,
.action-section,
.faq-section {
    margin-bottom: 3rem;
    padding: 2rem;
    border: 1px solid var(--muted-border-color);
    border-radius: var(--border-radius);
    background-color: #ffffff;
}

.action-section {
    background-color: #f8f9fa;
}

.offers-section header,
.action-section header,
.faq-section header {
    text-align: center;
    margin-bottom: 2rem;
}

.offers-section header p,
.action-section header p {
    max-width: 60ch;
    margin-left: auto;
    margin-right: auto;
}

.offers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.offer-card-compare {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    border: 1px solid var(--muted-border-color);
    border-radius: var(--border-radius);
}

.offer-card-compare h4 {
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

.offer-description {
    flex-grow: 1;
    margin-bottom: 1.5rem;
    color: var(--muted-color);
}

/* ---------------------------------- */
/*         Styles pour Erreurs        */
/* ---------------------------------- */
.centered-content {
    text-align: center;
    padding: 3rem 1rem;
    max-width: 70ch;
    margin: 2rem auto;
    background-color: #ffffff;
    border: 1px solid var(--muted-border-color);
    border-radius: var(--border-radius);
}

/* ---------------------------------- */
/*      Assistant Aide au Choix       */
/* ---------------------------------- */
.quiz-link-container {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--muted-border-color);
}
.quiz-link-container span {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--color-text-light);
}
.quiz-link-container a {
    font-weight: bold;
    text-decoration: none;
}

.quiz-step {
    display: none;
}
.quiz-step.active {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.quiz-nav {
    margin-top: 2rem;
    text-align: center;
}
.muted-button {
    background: none;
    border: none;
    padding: 0;
    color: var(--muted-color);
    text-decoration: none;
    cursor: pointer;
}
.muted-button:hover {
    text-decoration: underline;
}

#quiz-result .offer-card-compare {
    transition: all 0.3s ease;
    border-width: 2px;
}
#quiz-result .offer-card-compare.recommended {
    border-color: var(--primary);
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.recommendation-badge {
    background-color: var(--primary);
    color: var(--primary-inverse);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: bold;
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
}

/* ---------------------------------- */
/*      Résultats Aide au Choix       */
/* ---------------------------------- */

/* On force la grille des résultats à avoir 3 colonnes sur les grands écrans */
#quiz-result .result-grid {
    grid-template-columns: repeat(3, 1fr);
    display: grid; /* Assure l'affichage par défaut */
}

/* Style de la carte recommandée */
#quiz-result .offer-card-compare.recommended {
    border-color: var(--primary);
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    z-index: 2; /* Pour passer au-dessus des autres cartes */
}
.recommendation-badge {
    background-color: var(--primary);
    color: var(--primary-inverse);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: bold;
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
}

/* --- GESTION DE L'AFFICHAGE MOBILE --- */

/* Par défaut, l'affichage mobile est caché */
.mobile-result {
    display: none;
}
.view-all-offers-link {
    display: block;
    text-align: center;
    margin-top: 2rem;
    font-weight: bold;
}

/* Media Query pour les écrans de moins de 992px (tablettes et mobiles) */
@media (max-width: 992px) {
    /* On cache la grille complète */
    #quiz-result .result-grid {
        display: none;
    }
    /* On affiche la version mobile simplifiée */
    .mobile-result {
        display: block;
    }
    /* On s'assure que la carte recommandée sur mobile n'est pas trop grande */
    .mobile-result .offer-card-compare.recommended {
        transform: none; /* On annule le zoom */
    }
}

/* ---------------------------------- */
/* Formulaire Inscription Partenaire */
/* ---------------------------------- */

.form-card-enhanced {
    /* On retire la bordure par défaut pour la remplacer par une plus subtile */
    border: none;
    /* On ajoute un accent de couleur en haut */
    border-top: 4px solid var(--primary);
}

.form-header {
    text-align: center;
    padding: 1rem 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--muted-border-color);
}

.main-logo-in-form {
    height: 60px; /* Logo un peu plus grand pour plus d'impact */
    width: auto;
}

.form-card-enhanced hgroup {
    text-align: center;
    margin-bottom: 2rem;
}
.form-card-enhanced hgroup p {
    font-size: 1.1em;
    color: var(--color-text-light);
}

.form-card-enhanced fieldset {
    border-width: 1px;
    padding: 1.5rem;
}
.form-card-enhanced legend {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    padding: 0 0.5rem;
}

/* Centrer le reCAPTCHA */
.g-recaptcha {
    display: flex;
    justify-content: center;
}

/*
/* ---------------------------------- */
/*      Styles Espace Partenaire Auth */
/* ---------------------------------- */

/* Message d'erreur sur la page de login */
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid #f5c6cb;
    border-radius: var(--border-radius);
}

/* Lien en bas des formulaires (login/register) */
.form-footer-link {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9em;
}

/* En-tête du tableau de bord */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--muted-border-color);
}
.header-title {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.header-title h1 {
    margin: 0;
    font-size: 1.75em;
}
.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--color-text-light);
}
/* Bouton de déconnexion plus visible */
.logout-button {
    --background-color: var(--primary);
    --color: var(--primary-inverse);
    --border-color: var(--primary);
    font-weight: bold;
    font-size: 0.9em;
}

/* Carte principale du dashboard */
.dashboard-card {
    background-color: #ffffff;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 25px rgba(0,0,0,0.07);
}

/* Badges de statut colorés */
.status-badge {
    padding: 0.25em 0.75em;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: bold;
    color: #fff;
    white-space: nowrap;
}
.status-badge.status-open {
    background-color: #28a745; /* Vert */
}
.status-badge.status-closed {
    background-color: #dc3545; /* Rouge */
}

/* Message d'accueil quand il n'y a pas de clients */
.no-clients-row td {
    padding: 3rem 1rem !important; /* Forcer le padding */
    text-align: center;
}
.empty-state h4 {
    margin-bottom: 0.5rem;
}
.empty-state p {
    max-width: 50ch;
    margin: auto;
    color: var(--color-text-light);
}

/* Rendre les tableaux responsives */
.table-responsive {
    overflow-x: auto;
}

/* Style pour les identifiants en petits caractères */
.client-id, .device-id {
    display: block; /* Met l'ID sur une nouvelle ligne */
    font-size: 0.8em;
    color: var(--muted-color);
    margin-top: 0.25rem;
}

/* Améliorer l'espacement et l'alignement dans les cellules du tableau */
table td {
    vertical-align: middle; /* Centre verticalement le contenu des cellules */
}

table thead th {
    white-space: nowrap; /* Empêche les titres de passer à la ligne */
}

/*
/* ---------------------------------- */
/*      Mise en page Dashboard Grid   */
/* ---------------------------------- */

.dashboard-grid {
    display: grid;
    grid-template-columns: 350px 1fr; /* Colonne de gauche fixe, colonne de droite flexible */
    gap: 2rem;
}

.dashboard-tools {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* On ajuste les styles des sections réutilisées pour qu'elles s'intègrent bien */
.dashboard-tools .action-section,
.dashboard-tools .faq-section {
    margin-bottom: 0; /* On retire la marge du bas car le gap de la grille s'en charge */
}

/* Réorganisation du tableau pour être plus lisible */
.dashboard-clients table td {
    vertical-align: top;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

/* Style pour le numéro de téléphone mis en évidence */
.dashboard-clients table strong {
    display: block; /* Met le nom du client sur sa propre ligne */
}

/* Responsive pour le dashboard */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr; /* Passe en une seule colonne sur tablette/mobile */
    }
}

/*
/* ---------------------------------- */
/*      Mise en page Dashboard */
/* ---------------------------------- */
.dashboard-grid {
    display: grid;
    /* Grille à 2 colonnes: la 2ème prend 2/3 de l'espace, la 1ère 1/3 */
    grid-template-columns: 1fr 320px; 
    grid-template-areas: "main sidebar"; /* On nomme nos zones */
    gap: 2rem;
    align-items: start;
}

.dashboard-main-content {
    grid-area: main; /* Assigne cette section à la zone "main" */
}

.dashboard-sidebar {
    grid-area: sidebar; /* Assigne cette section à la zone "sidebar" */
}

/* Rendre la barre latérale "collante" au défilement */
.sidebar-sticky {
    position: sticky;
    top: 2rem; /* Commence à se coller à 2rem du haut de la fenêtre */
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* On ajuste les sections réutilisées pour qu'elles s'intègrent dans la sidebar */
.dashboard-sidebar .action-section,
.dashboard-sidebar .faq-section {
    margin-bottom: 0;
    padding: 1.5rem; /* Un peu moins de padding pour être plus compact */
}
.dashboard-sidebar .action-section header h3,
.dashboard-sidebar .faq-section header h3 {
    margin-bottom: 0;
    font-size: 1.1em; /* Titres un peu plus petits */
}
.dashboard-sidebar .action-section header p {
    display: none; /* On cache le sous-titre pour gagner de la place */
}
.dashboard-sidebar .choice-card {
    padding: 1rem; /* Cartes de choix plus compactes */
    gap: 0.5rem;
}
.dashboard-sidebar .choice-card svg {
    width: 24px; height: 24px;
}


/* Responsive pour le dashboard */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr; /* Passe en une seule colonne */
        grid-template-areas: 
            "main"
            "sidebar";
    }
    .sidebar-sticky {
        position: static; /* On annule l'effet collant sur mobile */
    }
}

/*
/* ---------------------------------- */
/*      Interface à Onglets Dashboard */
/* ---------------------------------- */

.dashboard-nav {
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--muted-border-color);
}
.dashboard-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 2rem;
}
.dashboard-nav a.tab-link {
    display: block;
    padding: 0.75rem 0.25rem;
    text-decoration: none;
    color: var(--color-text-light);
    font-weight: bold;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}
.dashboard-nav a.tab-link:hover {
    color: var(--color-text-dark);
}
.dashboard-nav a.tab-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Gestion du contenu des onglets */
.tab-pane {
    display: none; /* Caché par défaut */
}
.tab-pane.active {
    display: block; /* Affiché quand actif */
    animation: fadeIn 0.5s ease-in-out;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Montant de la commission */
.commission-amount {
    font-size: 1.1em;
    font-weight: bold;
    color: var(--color-text-dark);
}

/* Badges de statut de commission */
.status-badge.status-pending { background-color: #6c757d; } /* Gris */
.status-badge.status-action-required { background-color: #ffc107; color: #000; } /* Jaune */
.status-badge.status-processing { background-color: #17a2b8; } /* Cyan */
.status-badge.status-success { background-color: #28a745; } /* Vert */

/* Style pour la modale d'upload */
dialog#upload-modal::backdrop {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
}
dialog#upload-modal article {
    width: 500px;
}

/* Style pour les boutons "outline" pour garantir la lisibilité */
button.outline, [role="button"].outline {
    --background-color: transparent;
    --border-color: var(--primary);
    
    /* On force la couleur du texte à être la couleur primaire */
    color: var(--primary) !important;
}

/* Au survol, on inverse les couleurs pour un effet clair */
button.outline:hover, [role="button"].outline:hover {
    --background-color: var(--primary);
    --color: var(--primary-inverse) !important; /* Le texte redevient blanc */
}

/*
/* ---------------------------------- */
/*      Styles Espace Partenaire Auth */
/* ---------------------------------- */

/* Page de Connexion */
.login-portal {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.login-card {
    background-color: #ffffff;
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    box-shadow: 0 4px 25px rgba(0,0,0,0.07);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-footer-link {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9em;
}

/* Gestion du texte "ou" / "et" pour le design des formulaires */
.login-portal {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}
.login-portal article {
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--muted-border-color);
    background-color: #fff;
}
.login-portal h3 {
    text-align: center;
}
/* Conteneur pour les boutons de la page de connexion */
.login-actions {
    display: grid; /* On utilise une grille pour un contrôle parfait */
    grid-template-columns: 1fr 1.5fr; /* Le bouton principal est 1.5x plus large */
    align-items: stretch;
    gap: 0.75rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

/* Le bouton principal (n'a pas besoin de style spécifique, il hérite du style global) */
.login-actions .login-button {
    /* Le 'grid-template-columns' s'occupe de sa largeur */
}

/* Le bouton lien magique (action secondaire) */
.login-actions .magic-link-button {
    /* On utilise les styles 'outline' et 'secondary' de Pico.css */
    /* On s'assure que le texte est lisible */
    color: var(--color-text-dark) !important;
    border-color: var(--muted-border-color);
    
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem; /* Espace entre l'icône et le texte */
}
.login-actions .magic-link-button:hover {
    border-color: var(--primary);
    background-color: transparent;
    color: var(--primary) !important;
}
.login-actions .magic-link-button:hover svg {
    stroke: var(--primary); /* L'icône change aussi de couleur au survol */
}
.login-actions .magic-link-button svg {
    width: 20px;
    height: 20px;
    stroke: var(--color-text-light);
    transition: stroke 0.2s ease;
}
/* Style du lien "Mot de passe oublié" */
.forgot-password-link {
    display: block;
    text-align: right;
    font-size: 0.85em;
    margin-top: -0.5rem;
    margin-bottom: 1.5rem;
}

/* Styles pour le Wizard d'inscription */
/* Styles pour le Wizard d'inscription */
.wizard-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2.5rem; /* Espace augmenté */
    counter-reset: step;
}
.step-indicator {
    color: var(--muted-color);
    position: relative;
    text-align: center;
    width: 33.33%;
    font-size: 0.9em;
}
.step-indicator span {
    display: block;
    width: 30px;
    height: 30px;
    line-height: 26px; /* Ajustement pour centrer verticalement */
    border: 2px solid var(--muted-border-color);
    border-radius: 50%;
    margin: 0 auto 10px auto;
    background-color: #fff;
    transition: all 0.3s ease;
}
.step-indicator.active span {
    border-color: var(--primary);
    background-color: var(--primary);
    color: var(--primary-inverse);
    transform: scale(1.1);
}
.step-indicator.completed span {
    border-color: var(--primary);
    background-color: #fff;
    color: var(--primary);
}
.step-indicator.completed::after {
    background: var(--primary);
}
.step-indicator:not(:last-child)::before,
.step-indicator:not(:last-child)::after {
    content: '';
    width: 100%;
    height: 2px;
    background: var(--muted-border-color);
    position: absolute;
    left: 50%;
    top: 14px;
    z-index: -1;
    transition: background 0.3s ease;
}

/* --- RÈGLES CRUCIALES POUR L'AFFICHAGE --- */
.wizard-step {
    display: none; /* Toutes les étapes sont cachées par défaut */
}
.wizard-step.active {
    display: block; /* L'étape active est affichée */
    animation: fadeIn 0.5s;
}
/* ------------------------------------------- */

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

.wizard-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    border-top: 1px solid var(--muted-border-color);
    padding-top: 1.5rem;
}
.wizard-nav .hidden {
    visibility: hidden; /* On cache le bouton mais on garde l'espace */
}

/* Mention pour les champs obligatoires */
.required-fields-info {
    font-size: 0.85em;
    color: var(--muted-color);
    text-align: right; /* Aligne le texte à droite du formulaire */
    margin-top: 1.5rem;
}

.captcha-container {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

/* Ajoute un astérisque aux labels des champs requis */
.form-group label:has(+ input[required])::after,
.form-group label:has(+ textarea[required])::after,
.form-group label:has(+ select[required])::after {
    content: " *";
    color: var(--pico-color-red-500, #d32f2f);
    font-weight: bold;
}

/* Espacement entre les groupes de champs */
.form-group {
    margin-bottom: var(--pico-form-element-spacing-vertical);
}

/* Réinitialise le style du fieldset dans les formulaires pour un meilleur alignement */
.form-container fieldset {
    border: none; /* Retire la bordure */
    padding: 0;   /* Retire le padding interne */
    margin: 0;    /* Retire la marge externe */
}

/* On peut garder un espacement propre pour la légende */
.form-container fieldset legend {
    font-size: 1em; /* Garde la même taille que les autres labels */
    padding: 0;
    margin-bottom: var(--pico-form-element-spacing-vertical);
    font-weight: 500; /* Un poids normal pour ne pas trop ressortir */
    color: var(--color-text-dark);
}


/* Message d'aide sous un champ de formulaire */
.help-text {
    display: block; /* S'assure qu'il est sur sa propre ligne */
    margin-top: 0.5rem;
    font-size: 0.85em;
    color: var(--muted-color);
}

.help-text a {
    text-decoration: underline;
    font-weight: 500;
}