/* Polices auto-hébergées (RGPD + suppression du render-blocking Google Fonts) */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter-Gz7AlRl.woff2") format('woff2');
}

/* Accessibilite : skip-link visible au focus pour navigation clavier (WCAG 2.4.1).
   Le masquage repose sur la taille et le clip, pas sur `top: -40px` : une feuille
   chargee plus tard (home.css et son `body.gradient-page > *`) peut redefinir
   `position` a specificite egale et remettre le lien dans le flux, ou il devient
   visible en haut de page. Avec ce motif, meme repositionne, il reste invisible. */
body > .ez-skip-link,
.ez-skip-link {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10000;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    background: var(--primary-surface);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    border-radius: 0 0 8px 0;
}
body > .ez-skip-link:focus,
.ez-skip-link:focus {
    width: auto;
    height: auto;
    padding: 8px 16px;
    overflow: visible;
    clip-path: none;
    outline: 2px solid #fff;
    outline-offset: -4px;
}
/* Focus visible global pour navigation clavier */
:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
    border-radius: 4px;
}

i.fa.fa-fw, i.fab.fa-fw, i.far.fa-fw, i.fas.fa-fw {
    width: 1.25em;
    text-align: center
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important
    }
}

@media (min-width: 769px) {
    .show-mobile {
        display: none !important
    }
}

/* Les tokens (:root) et le theme sombre vivent desormais dans tokens.css :
   aucune palette ne doit etre redeclaree ici. */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box
}

/* Police de l'application. La vitrine surcharge avec Plus Jakarta Sans
   (home.css, charge uniquement par public_base.html.twig). */
body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, sans-serif;
    line-height: 1.6;
    background: var(--bg-secondary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color .3s ease, color .3s ease
}

body > .container, body > .page-container, body > main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column
}

.page-content {
    flex: 1 0 auto
}

footer {
    margin-top: auto;
    flex-shrink: 0
}

.container {
    max-width: 1200px
}

.container, .container-sm {
    margin: 0 auto;
    padding: 20px
}

.container-sm {
    max-width: 900px
}

.container-xs {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px
}

.btn-block {
    width: 100%
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 32px;
    transition: var(--transition)
}

.back-button:hover {
    transform: translateX(-4px)
}

.back-button-light {
    color: #fff;
    background: hsla(0, 0%, 100%, .1);
    padding: 12px 20px;
    border-radius: var(--radius-md)
}

.back-button-light:hover {
    background: hsla(0, 0%, 100%, .2)
}

.card-sm {
    padding: 24px;
    border-radius: var(--radius-lg)
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 8px;
    font-size: 14px
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--gray-100);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition)
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, .1)
}

textarea.form-control {
    min-height: 120px;
    resize: vertical
}

select.form-control {
    cursor: pointer;
}

.form-required {
    color: var(--danger)
}

/* Pas de `color` ici : les titres heritent de leur conteneur, sinon une section
   en .text-white (vitrine, en-tetes sur degrade) affiche un titre illisible. */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.02em
}

/* L'effet "texte en degrade" n'est plus applique d'office a tous les h1/h2 :
   sur un fond colore il rendait le titre illisible, ce qui obligeait chaque
   page a le neutraliser a coups de !important. Il reste disponible via la
   classe utilitaire .text-gradient. */
h1 {
    font-size: 48px;
    margin-bottom: 24px
}

h2 {
    font-size: 36px;
    margin-bottom: 20px
}

h3 {
    font-size: 28px;
    margin-bottom: 16px;
    color: var(--primary-dark)
}

h4 {
    font-size: 24px
}

h4, h5 {
    margin-bottom: 12px
}

h5 {
    font-size: 20px
}

h6 {
    font-size: 18px;
    margin-bottom: 8px
}

/* Pas de `color` impose ici : un paragraphe place sur fond sombre (pied de page
   de la vitrine, bandeaux degrades) heritait de gray-700 et devenait illisible
   (1.34:1). La couleur vient du conteneur. */
p {
    margin-bottom: 16px;
    line-height: 1.8
}

.text-primary {
    color: var(--primary) !important
}

.text-secondary {
    color: var(--secondary) !important
}

.text-accent {
    color: var(--accent-purple) !important
}

.text-muted {
    color: var(--gray-500) !important
}

.text-gradient {
    background: var(--gradient-purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text
}

.text-center {
    text-align: center
}

.text-right {
    text-align: right
}

.text-left {
    text-align: left
}

.mt-4 {
    margin-top: 16px
}

.mb-4 {
    margin-bottom: 16px
}

.mt-8 {
    margin-top: 32px
}

.mb-8 {
    margin-bottom: 32px
}

.p-4 {
    padding: 16px
}

.p-8 {
    padding: 32px
}

.flex {
    display: flex
}

.flex-col {
    flex-direction: column
}

.items-center {
    align-items: center
}

.justify-center {
    justify-content: center
}

.gap-4 {
    gap: 16px
}

/* Grande variante du .spinner defini dans components.css */
.spinner-lg {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-100);
    border-top-color: var(--primary);
}

@media (max-width: 768px) {
    h1 {
        font-size: 32px
    }

    h2 {
        font-size: 28px
    }

    h3 {
        font-size: 24px
    }

    .card {
        padding: 24px
    }

    .container, .container-sm, .container-xs {
        padding: 16px
    }
}

/* ===== Banniere de consentement cookies (CNIL / RGPD) ===== */
.ez-cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9000;
    background: #ffffff;
    color: #1a1a1a;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.12);
    padding: 16px 20px;
    font-size: 14px;
    line-height: 1.5;
}
body.dark-mode .ez-cookie-banner {
    background: #1f2333;
    color: #e7e9f1;
    border-top-color: rgba(255, 255, 255, 0.08);
}
.ez-cookie-banner__inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    align-items: center;
    justify-content: space-between;
}
.ez-cookie-banner__text { flex: 1 1 320px; min-width: 280px; }
.ez-cookie-banner__text strong { display: block; margin-bottom: 4px; font-size: 15px; }
.ez-cookie-banner__text p { margin: 0; color: var(--text-secondary); }
/* Le bandeau est blanc en theme clair et sombre en dark-mode : la couleur du
   lien suit, sinon le contraste tombe sous le seuil AA dans un des deux cas. */
.ez-cookie-banner__text a { color: var(--primary-accessible); text-decoration: underline; }
body.dark-mode .ez-cookie-banner__text p { color: #cbd0e0; }
body.dark-mode .ez-cookie-banner__text a { color: var(--primary-lighter); }
.ez-cookie-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.ez-btn {
    appearance: none;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    padding: 9px 16px;
    border-radius: 10px;
    transition: background-color .15s ease, transform .05s ease;
}
.ez-btn:active { transform: translateY(1px); }
.ez-btn-primary { background: var(--primary-surface); color: #fff; }
.ez-btn-primary:hover { background: #5567d6; }
.ez-btn-secondary { background: #e7e9f5; color: #2b2f44; }
body.dark-mode .ez-btn-secondary { background: #2c3146; color: #e7e9f1; }
.ez-btn-ghost { background: transparent; color: inherit; border-color: rgba(0,0,0,0.15); }
body.dark-mode .ez-btn-ghost { border-color: rgba(255,255,255,0.2); }

/* Modale de personnalisation */
.ez-cookie-modal {
    position: fixed;
    inset: 0;
    z-index: 9500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.ez-cookie-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}
.ez-cookie-modal__dialog {
    position: relative;
    background: #ffffff;
    color: #1a1a1a;
    border-radius: 16px;
    max-width: 560px;
    width: 100%;
    padding: 24px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}
body.dark-mode .ez-cookie-modal__dialog { background: #1f2333; color: #e7e9f1; }
.ez-cookie-modal__dialog h2 { margin-top: 0; font-size: 20px; }
.ez-cookie-modal__intro { color: inherit; opacity: 0.8; margin-bottom: 16px; }
.ez-cookie-category {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
}
body.dark-mode .ez-cookie-category { border-color: rgba(255, 255, 255, 0.1); }
.ez-cookie-category__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ez-cookie-category__title { font-weight: 600; }
.ez-cookie-category__desc { margin: 6px 0 0; font-size: 13px; opacity: 0.75; }
.ez-cookie-category__badge {
    font-size: 12px;
    background: #e7e9f5;
    color: #2b2f44;
    padding: 3px 8px;
    border-radius: 999px;
}
body.dark-mode .ez-cookie-category__badge { background: #2c3146; color: #e7e9f1; }
.ez-cookie-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
}
.ez-cookie-switch input { opacity: 0; width: 0; height: 0; }
.ez-cookie-switch__slider {
    position: absolute;
    inset: 0;
    background: #c8ccd9;
    border-radius: 999px;
    transition: background-color .15s ease;
}
.ez-cookie-switch__slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .15s ease;
}
.ez-cookie-switch input:checked + .ez-cookie-switch__slider { background: #667eea; }
.ez-cookie-switch input:checked + .ez-cookie-switch__slider::before { transform: translateX(18px); }
.ez-cookie-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}
@media (max-width: 600px) {
    .ez-cookie-banner__inner { flex-direction: column; align-items: stretch; }
    .ez-cookie-banner__actions { justify-content: stretch; }
    .ez-btn { flex: 1 1 0; }
}

/* ===== Pages d'erreur ===== */
.error-page {
    background: var(--bg-secondary);
}

.error-page__inner {
    max-width: 480px;
}

.error-page__code {
    font-size: 72px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.04em;
    background: var(--gradient-purple);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ===== Pages legales et informatives ===== */
.legal-page {
    background: var(--bg-secondary);
}

.legal-card h2 {
    font-size: 22px;
    margin-top: 32px;
    margin-bottom: 12px;
}

.legal-card h2:first-of-type {
    margin-top: 0;
}

.legal-card h3 {
    font-size: 18px;
    margin-top: 24px;
    margin-bottom: 8px;
}

.legal-card p,
.legal-card li {
    color: var(--text-secondary);
    line-height: 1.8;
}

.legal-card ul,
.legal-card ol {
    padding-left: 22px;
    margin-bottom: 16px;
}

.legal-card table {
    width: 100%;
    margin: 20px 0;
    border-collapse: collapse;
}

.legal-card th,
.legal-card td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-primary);
    text-align: left;
    vertical-align: top;
}

/* Repli des animations d'apparition.
   AOS applique une opacite nulle a tout element porteur de data-aos ; si le
   module ne demarre pas, la page reste blanche. Ce bloc rend le contenu quand
   le visiteur a demande a reduire les animations - AOS se desactive alors et ne
   retirera jamais l'opacite lui-meme. */
@media (prefers-reduced-motion: reduce) {
    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}
