/* =====================================================================
   base.css — SOCLE COMMUN Amagatewax
   ---------------------------------------------------------------------
   ROLE      : styles partages par TOUTES les pages (client, admin, cours).
   CHARGE    : sur chaque page, EN PREMIER (avant les feuilles specifiques).
   CONTIENT  : variables de theme, reset, structure/en-tete, navigation,
               cartes, titres, alertes, formulaires, boutons, pied de page,
               bandeau cookies, et le responsive commun a ces elements.
   EXCLUT    : dashboard, messages, patrons, legal, connexion, contact,
               administration -> chacun dans sa propre feuille.
   SOURCE    : extrait de l'ancien main.css (sections communes uniquement).
   ===================================================================== */


/* =========================
   VARIABLES DE THEME & RESET
   ========================= */

:root{
    --brand-primary: #f4a12e;
    --brand-primary-2: #e88c2f;
    --brand-brown: #5B3721;
    --brand-ink: #121212;
    --brand-muted: #6b5e55;

    --bg-soft: #fff6ee;
    --border: rgba(91, 55, 33, 0.14);
    --shadow: 0 10px 24px rgba(18, 18, 18, 0.08);
    --shadow-hover: 0 16px 40px rgba(18, 18, 18, 0.12);

    --success-bg: #edf8f1;
    --success-text: #1f6b3b;
    --error-bg: #fff1f1;
    --error-text: #9a1f1f;

    --r-lg: 16px;
    --r-md: 12px;
}

*{
    box-sizing: border-box;
}

html{
    scroll-behavior: smooth;
}

body{
    margin: 0;
    padding: 0 2rem;
    background: radial-gradient(1200px 600px at 50% -100px, var(--bg-soft) 0%, #fff 55%, #fff 100%);
    color: var(--brand-ink);
    font-family: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
}

a{
    color: var(--brand-primary-2);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover{
    color: var(--brand-ink);
}


/* =========================
   STRUCTURE GLOBALE (en-tete, coquille, marque, logo)
   ========================= */

.shell,
.site-shell{
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main{
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 3rem 0 4rem;
    flex: 1 0 auto;
}

.header{
    background: linear-gradient(180deg, #fff 0%, #fff 50%, rgba(255, 246, 238, 0.8) 100%);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 6px 18px rgba(18, 18, 18, 0.06);
    margin-left: -2rem;
    margin-right: -2rem;
    padding: 0 2rem;
}

.header-shell,
.footer-inner{
    max-width: 1360px;
    margin: 0 auto;
}

.header-bar{
    min-height: 108px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.header-brand{
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
    flex: 0 0 auto;
}

.header-brand-link{
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.brand-text{
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.header p,
.brand-subtitle{
    color: var(--brand-muted);
}

.logo{
    width: 72px;
    height: 72px;
    flex: 0 0 72px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: transparent;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
}

.logo img{
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}

.brand-title{
    margin: 0;
    font-size: 2rem;
    line-height: 1.1;
    color: #1f2940;
    font-weight: 800;
}

.brand-subtitle{
    margin: 0.2rem 0 0;
    font-size: 1rem;
    line-height: 1.3;
}

.header-nav{
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2rem;
    flex-wrap: wrap;
    margin-left: auto;
    text-align: right;
}

.logout-link{
    font-weight: 700;
    color: var(--brand-brown);
    text-decoration: none;
}

.logout-link:hover{
    color: var(--brand-ink);
}


/* =========================
   NAVIGATION (liens d'en-tete + pastille messagerie)
   NB : la pastille messagerie fait partie de l'en-tete partage,
   elle reste donc dans le socle commun.
   ========================= */

.nav-link{
    color: var(--brand-brown) !important;
    font-weight: 700;
    opacity: 0.92;
    position: relative;
}

.nav-link:hover{
    color: var(--brand-ink) !important;
}

.nav-link::after{
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 100%;
    height: 3px;
    border-radius: 999px;
    background: var(--brand-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s ease;
}

.nav-link:hover::after{
    transform: scaleX(1);
}


.nav-link--messages{
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.nav-message-badge{
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.38rem;
    border-radius: 999px;

    background: #9a1f1f;
    color: #fff;

    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.35rem;
    text-align: center;

    box-shadow: 0 6px 14px rgba(154, 31, 31, 0.28);
}


/* =========================
   BLOCS / CARTES
   ========================= */

.card,
.auth-card,
.section-presentation,
.section-contact,
.download-card{
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
}

.card,
.auth-card{
    padding: 2.2rem;
}

.card{
    margin-bottom: 1.5rem;
}

.auth-card{
    max-width: 720px;
    margin: 0 auto;
}

.section-presentation,
.section-contact{
    padding: 2rem;
}

.download-card{
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.download-card:hover{
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(244, 161, 46, 0.35);
}


/* =========================
   TITRES / TEXTES
   ========================= */

.page-title,
.title{
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--brand-brown);
    margin: 0 0 0.75rem;
}

.intro,
.page-intro{
    text-align: center;
    margin: 0 0 1.8rem;
    color: #2a2a2a;
}

.section-presentation h2,
.section-contact h2,
.download-card h3,
.page-card h3{
    color: var(--brand-brown);
}

.page-card h3{
    margin: 0 0 0.75rem;
    font-size: 1.2rem;
}

.prose p{
    color: #2a2a2a;
}

/* Marge basse par defaut entre paragraphes de la presentation.
   :where() garde une faible specificite : si tu mets une classe
   Tailwind (mb-4, mb-6...), c'est elle qui prime. */
.prose :where(p){
    margin-bottom: 1rem;
}

.prose p.text-sm{
    color: var(--brand-muted) !important;
}


/* =========================
   BANDEAU MODE APERCU CLIENT
   ---------------------------------------------------------------
   Bandeau affiche en haut de page quand l admin previsualise
   l espace avec les acces d une cliente.
   IMPORTANT : ces regles doivent rester dans base.css et NON dans
   admin.css. En mode apercu, la session pose is_admin = false,
   donc header.php ne charge PAS admin.css : le bandeau y serait
   affiche sans aucun style.
   ========================= */

.admin-preview-banner {
    margin: 1.5rem auto;
    padding: 0.9rem 1.25rem;
    background: #fff3cd;
    border-bottom: 1px solid #f4d27a;
    color: #5b3721;
    text-align: center;
    font-weight: 600;
}

.admin-preview-banner-link {
    display: inline-block;
    margin-left: 0.75rem;
    color: #5b3721;
    font-weight: 800;
    text-decoration: underline;
}


/* =========================
   ALERTES (messages flash)
   ========================= */

.flash{
    border-radius: 12px;
    padding: 0.95rem 1rem;
    margin-bottom: 1.2rem;
    font-weight: 600;
}

/* Marge haute uniquement si le bandeau suit un autre element
   (boutons, texte...). S'il est le premier element de sa carte,
   il reste colle en haut : aucun changement sur les pages
   clientes ou le bandeau est en tete. */
.flash:not(:first-child){
    margin-top: 1.2rem;
}

.flash-success{
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid rgba(31, 107, 59, 0.12);
}

.flash-error{
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid rgba(154, 31, 31, 0.12);
}

.wax-alert{
    color: #7a1f12;
    font-weight: 700;
}


/* =========================
   FORMULAIRES
   ========================= */

.form-group{
    margin-bottom: 1.2rem;
}

.form-label,
.label{
    display: block;
    margin-bottom: 0.45rem;
    font-weight: 700;
    color: #121212;
}

.form-input,
.input{
    width: 100%;
    border: 1px solid rgba(91, 55, 33, 0.18);
    border-radius: 12px;
    padding: 0.95rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    color: #121212;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input{
    font-size: 1.2rem;
    letter-spacing: 0.2rem;
    text-align: center;
}

.form-input:focus,
.input:focus{
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px rgba(244, 161, 46, 0.16);
}

.helper-text,
.helper{
    font-size: 0.95rem;
    color: var(--brand-muted);
    margin-top: 0.45rem;
}

.submit-row{
    text-align: center;
    margin-top: 1.5rem;
}

/* ----- Pot de miel anti-spam -------------------------------------
   Champ leurre "Entreprise" present dans le HTML mais invisible a
   l ecran. Les robots le remplissent, pas les humaines : un envoi
   avec ce champ rempli est rejete par le serveur.

   IMPORTANT : cette regle doit rester dans base.css. Elle est
   utilisee par contact-form-block.php, reply-thread.php ET
   inscription.php, qui ne chargent pas tous contact.css. Si le
   masquage disparait, le champ devient visible pour les clientes
   et la protection anti-spam ne sert plus a rien.
   ---------------------------------------------------------------- */
.contact-hp{
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}


/* =========================
   BOUTONS
   ========================= */

.btn,
.submit-btn,
.download-btn{
    display: inline-block;
    font-size: 1rem;
    background: var(--brand-primary);
    color: #000;
    font-weight: 700;
    padding: 0.95rem 1.6rem;
    border: none;
    border-radius: 12px;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, color 0.18s ease;
    box-shadow: 0 10px 18px rgba(244, 161, 46, 0.22);
    cursor: pointer;
    white-space: nowrap;
}

.btn,
.submit-btn,
.download-btn {
    display: inline-flex; /* 🔥 au lieu de inline-block */
    align-items: center;
    justify-content: center;

    font-family: inherit; /* 🔥 important pour la police */
    line-height: 1; /* 🔥 évite les différences de hauteur */
}

/* 🔥 reset spécifique aux <button> */
button.btn,
button.submit-btn,
button.download-btn {
    appearance: none;
    -webkit-appearance: none;
}

.btn:hover,
.submit-btn:hover,
.download-btn:hover{
    background: #000;
    color: var(--brand-primary);
    box-shadow: 0 14px 26px rgba(0, 0, 0, 0.18);
    transform: translateY(-1px);
}

.btn:active,
.submit-btn:active,
.download-btn:active{
    transform: translateY(0);
}

.btn:focus-visible,
.submit-btn:focus-visible,
.download-btn:focus-visible,
.nav-link:focus-visible{
    outline: 3px solid rgba(244, 161, 46, 0.45);
    outline-offset: 3px;
    border-radius: 12px;
}

/* Variante compacte, pour les boutons places dans les cellules
   d'un tableau. */
.btn.btn--sm{
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    box-shadow: 0 8px 16px rgba(244, 161, 46, 0.18);
}


/* =========================
   PIED DE PAGE
   ========================= */

.footer,
.footer-news{
    margin-left: -2rem;
    margin-right: -2rem;
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding: 2.5rem 2rem;
}

.footer-inner{
    max-width: 960px;
    text-align: center;
}

.footer-social{
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
}

.social-btn{
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    font-size: 1.2rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.social-btn:hover{
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.social-btn.fb{
    color: #1877F2;
}

.social-btn.ig{
    color: #E1306C;
}

.social-btn.yt{
    color: #FF0000;
}

.footer-site{
    margin: 0 0 14px;
    font-weight: 700;
}

.footer-site a{
    color: #1f2937;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.footer-site a:hover{
    color: #000;
}

.footer-legal{
    font-size: 0.9rem;
    line-height: 1.6;
    color: #374151;
    margin-top: 10px;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    text-align: center;
}

.footer-company{
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.5px;
    color: #121212;
}

.footer-line{
    display: block;
}

.footer-meta{
    font-size: 0.85rem;
    color: #6b7280;
}

.footer-legal::before{
    content: "";
    display: block;
    width: 60px;
    height: 3px;
    background: var(--brand-primary);
    border-radius: 999px;
    margin-bottom: 10px;
    opacity: 0.8;
}


/* =========================
   PIED DE PAGE — BAS (LEGAL)
   ========================= */

.footer-bottom{
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* liens */
.footer-links{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 18px;
    font-size: 0.9rem;
}

.footer-links a{
    color: #6b7280;
    text-decoration: none;
    position: relative;
    transition: color 0.2s ease;
    font-weight: 500;
}

.footer-links a:hover{
    color: #000;
}

/* séparateurs élégants */
.footer-links a::after{
    content: "•";
    margin-left: 12px;
    color: #d1d5db;
}

.footer-links a:last-child::after{
    content: "";
}

/* copyright */
.footer-copy{
    font-size: 0.8rem;
    color: #9ca3af;
    text-align: center;
}


/* =========================
   LIENS SECONDAIRES
   ========================= */

.back-link{
    display: block;
    text-align: center;
    margin-top: 1rem;
    color: var(--brand-brown);
    text-decoration: none;
    font-weight: 700;
}

.back-link:hover{
    color: var(--brand-ink);
}


/* =========================
   COOKIES — bandeau de consentement + lien "Gerer les cookies"
   NB : la vignette video YouTube (.yt-facade) N'EST PAS ici,
   elle ira dans la feuille des pages a video (patrons/atelier).
   ========================= */

.cookie-banner{
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: #fff;
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 24px rgba(18, 18, 18, 0.10);
    padding: 16px 20px;
}
.cookie-banner[hidden]{
    display: none;
}
.cookie-banner-inner{
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}
.cookie-banner-text{
    flex: 1 1 320px;
    color: var(--brand-ink);
    font-size: 0.92rem;
    line-height: 1.45;
}
.cookie-banner-text strong{
    display: block;
    margin-bottom: 4px;
}
.cookie-banner-text p{
    margin: 0;
    color: var(--brand-muted);
}
.cookie-banner-text a{
    color: var(--brand-primary-2);
    text-decoration: underline;
}
.cookie-banner-actions{
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}
.cookie-banner .btn-ghost{
    background: #fff;
    color: var(--brand-brown);
    border: 1.5px solid var(--border);
    box-shadow: none;
}
.cookie-banner .btn-ghost:hover{
    background: var(--bg-soft);
}

/* --- Lien « Gérer les cookies » (footer) --- */
.cookie-manage-link{
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
cursor: pointer;
    text-decoration: underline;
}


/* =========================
   ETIQUETTES (TAGS)
   NB : composant generique, utilise aussi bien sur le tableau de bord
   client que sur plusieurs pages d'administration. Il vit donc dans le
   socle commun, et non dans dashboard.css.
   ========================= */

.tag-list{
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    justify-content: center;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}

.tag{
    background: #fff6ee;
    color: var(--brand-brown);
    border-left: 6px solid var(--brand-primary);
    border-radius: 12px;
    padding: 0.7rem 1rem;
    font-weight: 700;
}

.tag-link{
    text-decoration: none;
    color: var(--brand-brown);
    display: inline-block;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.tag-link:hover{
    box-shadow: 0 6px 16px rgba(18, 18, 18, 0.08);
    transform: translateY(-1px);
}


/* =========================
   TABLEAUX DE DONNEES (.admin-table)
   NB : malgre son nom historique, ce composant n'a rien d'administratif :
   il sert aussi sur la page client messages.php. Il vit donc en entier
   dans le socle commun (table, ligne vide, alignement, enveloppe de
   defilement). A renommer en .data-table lors du chantier 4.
   ========================= */

.admin-table{
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.admin-table th,
.admin-table td{
    border-bottom: 1px solid rgba(0,0,0,0.08);
    padding: 0.6rem 0.5rem;
    text-align: left;
    font-size: 0.95rem;
}

.admin-table th{
    font-weight: 700;
}

/* Ligne affichee quand le tableau ne contient aucune donnee. */
.admin-table-empty{
    text-align: center;
    color: var(--brand-muted);
    font-style: italic;
}

/* Centrage vertical des cellules dans les tableaux de messagerie
   (utilise par messages.php cote client et admin-messages.php). */
.messages-table td{
    vertical-align: middle;
}

/* Enveloppe de defilement : sur petit ecran, un tableau large defile
   horizontalement a l'interieur de sa carte au lieu de deborder de la
   page. Sans effet sur grand ecran (le tableau tient dans la largeur). */
.table-wrap{
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-wrap .admin-table{
    min-width: 600px;
}


/* =========================
   RESPONSIVE (commun : corps, en-tete, cartes, titres)
   ========================= */

@media (max-width: 700px){
    body{
        padding: 0 1rem;
    }

    .header,
    .footer,
    .footer-news{
        margin-left: -1rem;
        margin-right: -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .header-bar{
        min-height: auto;
        padding: 1.2rem 0;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 1rem;
    }

    .header-brand{
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .brand-text{
        align-items: center;
    }

    .header-nav{
        width: 100%;
        justify-content: center;
        text-align: center;
        gap: 1rem 1.25rem;
    }

    .auth-card,
    .card,
    .section-presentation,
    .section-contact{
        padding: 1.4rem;
    }

    .brand-title,
    .page-title,
    .title{
        font-size: 1.7rem;
    }
}


@media (max-width: 768px){
    .header.is-sticky-mobile{
        position: sticky;
        top: 0;
        z-index: 50;
        backdrop-filter: blur(8px);
    }
}