/* =============================================================================
   Documents juridiques d'Astramed (mentions légales, CGU, CGV, confidentialité)
   =============================================================================
   Deux usages, une seule feuille :
   1. Les pages autonomes (body.lg-page) : même identité que la page
      d'accueil — fond noir voilé de bleu, grille de points, marque de
      l'en-tête (logotype + ASTRAMED aux A sans barre), cartes de verre à
      liseré lumineux, polices Plus Jakarta Sans / Hanken Grotesk.
   2. La fenêtre de l'application (#docModal .lg-doc.lg-integre) : le même
      contenu, chargé depuis la page, aux couleurs de la palette choisie
      (finitions.css, section 17.14). Rien ici ne touche à l'application hors
      de ces conteneurs : toutes les règles sont préfixées.
   ========================================================================== */

/* ---- 1. Page autonome : socle ------------------------------------------- */
body.lg-page {
    --lg-texte: #c4cde6;
    --lg-doux: #8a93ad;
    --lg-titre: #ffffff;
    --lg-bord: rgba(255, 255, 255, 0.08);
    --lg-carte: rgba(255, 255, 255, 0.03);
    --lg-carte-forte: rgba(255, 255, 255, 0.055);
    --lg-accent-1: #93c5fd;
    --lg-accent-2: #a5b4fc;
    --lg-accent-3: #c4b5fd;
    --lg-lien: #93c5fd;
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(ellipse 90% 60% at 50% -10%, rgba(37, 99, 235, 0.13), transparent 60%), #050505;
    color: var(--lg-texte);
    font: 16px/1.7 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    color-scheme: dark;
}
body.lg-page *, body.lg-page *::before, body.lg-page *::after { box-sizing: border-box; }
html:has(body.lg-page) { scroll-behavior: smooth; scroll-padding-top: 92px; background: #050505; }

/* Décor fixe : deux lueurs (sans flou coûteux) et la grille de points. */
.lg-decor { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.lg-decor::before, .lg-decor::after {
    content: '';
    position: absolute;
    border-radius: 50%;
}
.lg-decor::before {
    width: 900px; height: 900px; left: -320px; top: -360px;
    background: radial-gradient(closest-side, rgba(59, 130, 246, 0.13), transparent);
}
.lg-decor::after {
    width: 700px; height: 700px; right: -260px; bottom: -300px;
    background: radial-gradient(closest-side, rgba(99, 102, 241, 0.12), transparent);
}
.lg-grille {
    position: absolute; inset: 0; opacity: 0.05;
    background-image: radial-gradient(#3b82f6 1px, transparent 1px);
    background-size: 40px 40px;
    -webkit-mask-image: radial-gradient(circle at 50% 30%, black 0%, transparent 70%);
    mask-image: radial-gradient(circle at 50% 30%, black 0%, transparent 70%);
}
.lg-page-contenu { position: relative; z-index: 1; }

/* ---- 2. En-tête : la marque de la page d'accueil ------------------------- */
.lg-barre {
    position: sticky; top: 0; z-index: 10;
    background: rgba(5, 5, 5, 0.6);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.lg-barre-ligne {
    max-width: 1180px; margin: 0 auto; padding: 14px 20px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.lg-marque {
    display: inline-flex; align-items: center; gap: 0.85rem;
    text-decoration: none; border-radius: 14px;
    -webkit-tap-highlight-color: transparent;
}
.lg-marque:focus-visible { outline: 2px solid rgba(147, 197, 253, 0.7); outline-offset: 6px; }
.lg-marque-signe { position: relative; flex: none; width: 2.5rem; height: 2.5rem; }
.lg-marque-signe::before {
    content: ''; position: absolute; inset: -6px; border-radius: 9999px;
    background: radial-gradient(closest-side, rgba(59, 130, 246, 0.42), rgba(59, 130, 246, 0));
    opacity: 0.6; transform: scale(0.9);
    transition: opacity 0.5s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.lg-marque:hover .lg-marque-signe::before { opacity: 1; transform: scale(1.3); }
.lg-marque-signe img {
    position: relative; display: block; width: 100%; height: 100%; object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.45));
}
.lg-marque-mot {
    position: relative; display: inline-block;
    font: 700 1.2rem/1.4286 'Space Grotesk', system-ui, sans-serif;
    letter-spacing: 0.42em; margin-right: -0.42em;
    text-transform: uppercase; white-space: nowrap;
}
.lg-marque-mot > span {
    color: #dbeafe;
    color: color-mix(in srgb, #bfdbfe calc(var(--i, 0) * 13%), #ffffff);
    transition: color 0.45s ease; transition-delay: calc(var(--i, 0) * 40ms);
}
.lg-marque:hover .lg-marque-mot > span {
    color: #93c5fd;
    color: color-mix(in srgb, #60a5fa calc(15% + var(--i, 0) * 9%), #e0f2fe);
}
/* Le A sans barre : même découpe que la page d'accueil (glyphe Space Grotesk 700). */
.lg-marque-mot .a-nobar {
    display: inline-block;
    clip-path: polygon(-50% -50%, 150% -50%, 150% 150%,
        0.4879em 150%, 0.4879em 1.0893em, 0.3263em 0.4429em,
        0.3076em 0.4429em, 0.1460em 1.0893em, 0.1460em 150%, -50% 150%);
}
.lg-actions { display: flex; align-items: center; gap: 10px; }
.lg-bouton, .lg-bouton-verre {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 42px; padding: 0 18px; border-radius: 12px;
    font: 700 14px/1 'Hanken Grotesk', system-ui, sans-serif; text-decoration: none; white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, color 0.2s ease;
}
.lg-bouton {
    color: #ffffff;
    background: linear-gradient(90deg, #2563eb, #4f46e5);
    box-shadow: 0 8px 24px -8px rgba(59, 130, 246, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.lg-bouton:hover { transform: translateY(-1px); box-shadow: 0 12px 30px -8px rgba(99, 102, 241, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.22); }
.lg-bouton-verre {
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
}
.lg-bouton-verre:hover { color: #ffffff; background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.18); }
.lg-bouton:focus-visible, .lg-bouton-verre:focus-visible { outline: 2px solid #93c5fd; outline-offset: 3px; }
.lg-fleche { width: 14px; height: 14px; flex: none; }

/* ---- 3. Titre du document ---------------------------------------------- */
.lg-principal { max-width: 1180px; margin: 0 auto; padding: 56px 20px 72px; }
.lg-entete-doc { max-width: 760px; margin: 0 auto 36px; text-align: center; }
.lg-surtitre {
    display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px;
    font: 700 11px/1 'Manrope', system-ui, sans-serif; letter-spacing: 0.24em; text-transform: uppercase;
    color: var(--lg-accent-1);
}
.lg-surtitre::before, .lg-surtitre::after {
    content: ''; width: 28px; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(147, 197, 253, 0.6));
}
.lg-surtitre::after { transform: scaleX(-1); }
.lg-entete-doc h1 {
    margin: 0 0 18px;
    font: 800 clamp(30px, 6vw, 52px)/1.08 'Plus Jakarta Sans', system-ui, sans-serif;
    letter-spacing: -0.025em; color: var(--lg-titre);
}
.lg-degrade {
    background: linear-gradient(90deg, #93c5fd, #a5b4fc 45%, #c4b5fd);
    -webkit-background-clip: text; background-clip: text;
    color: transparent; -webkit-text-fill-color: transparent;
}
.lg-version {
    display: inline-block; margin: 0; line-height: 1.5;
    padding: 7px 14px; border-radius: 999px;
    font-size: 13px; font-weight: 600; color: var(--lg-doux);
    background: rgba(255, 255, 255, 0.04); border: 1px solid var(--lg-bord);
}
.lg-version::before { content: ''; display: inline-block; vertical-align: middle; margin: -2px 8px 0 0; width: 6px; height: 6px; border-radius: 50%; background: #34d399; box-shadow: 0 0 10px rgba(52, 211, 153, 0.7); }

/* Onglets entre les documents : pilule de verre, comme les sélecteurs de l'appli. */
.lg-onglets {
    display: flex; gap: 4px; width: max-content; max-width: 100%; margin: 0 auto 36px;
    padding: 5px; border-radius: 999px; overflow-x: auto; scrollbar-width: none;
    background: rgba(255, 255, 255, 0.035); border: 1px solid var(--lg-bord);
}
.lg-onglets::-webkit-scrollbar { display: none; }
.lg-onglets a {
    flex: none; padding: 9px 16px; border-radius: 999px;
    font-size: 14px; font-weight: 600; color: var(--lg-doux); text-decoration: none;
    border: 1px solid transparent; transition: color 0.2s ease, background-color 0.2s ease;
}
.lg-onglets a:hover { color: #ffffff; background: rgba(255, 255, 255, 0.05); }
.lg-onglets a[aria-current="page"] {
    color: #ffffff;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.28), rgba(79, 70, 229, 0.28));
    border-color: rgba(147, 197, 253, 0.30);
    box-shadow: 0 0 18px -6px rgba(99, 102, 241, 0.7);
}
.lg-court { display: none; }

/* ---- 4. Mise en page : sommaire + contenu ------------------------------- */
.lg-mise-en-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; max-width: 820px; margin: 0 auto; }
@media (min-width: 1040px) {
    .lg-mise-en-page { grid-template-columns: 250px minmax(0, 1fr); gap: 32px; max-width: 1110px; }
}
.lg-sommaire {
    align-self: start; border-radius: 18px;
    background: var(--lg-carte); border: 1px solid var(--lg-bord);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
@media (min-width: 1040px) { .lg-sommaire { position: sticky; top: 92px; } }
.lg-sommaire summary {
    list-style: none; cursor: pointer; padding: 14px 18px;
    display: flex; align-items: center; justify-content: space-between;
    font: 700 11px/1 'Manrope', system-ui, sans-serif; letter-spacing: 0.2em; text-transform: uppercase; color: var(--lg-doux);
}
.lg-sommaire summary::-webkit-details-marker { display: none; }
.lg-sommaire summary::after {
    content: ''; width: 8px; height: 8px; margin-right: 4px;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(45deg); transition: transform 0.25s ease;
}
.lg-sommaire[open] summary::after { transform: rotate(-135deg); }
.lg-sommaire ol { list-style: none; margin: 0; padding: 0 10px 12px; counter-reset: lg-som; }
.lg-sommaire li { counter-increment: lg-som; }
.lg-sommaire a {
    display: flex; gap: 10px; align-items: baseline; padding: 7px 10px; border-radius: 10px;
    font-size: 14px; line-height: 1.35; color: var(--lg-texte); text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.lg-sommaire a::before {
    content: counter(lg-som, decimal-leading-zero);
    flex: none; font: 600 11px/1 'Space Grotesk', system-ui, sans-serif; color: var(--lg-accent-1); opacity: 0.8;
}
.lg-sommaire a:hover { color: #ffffff; background: rgba(255, 255, 255, 0.05); }

/* ---- 5. Le contenu (commun à la page et à la fenêtre de l'appli) --------- */
.lg-doc { min-width: 0; color: var(--lg-texte); }
.lg-doc .lg-section {
    position: relative; margin: 0 0 16px; padding: 24px 26px 20px; border-radius: 20px;
    background: var(--lg-carte); border: 1px solid var(--lg-bord);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    scroll-margin-top: 92px;
}
/* Liseré lumineux en haut, signature des cartes de la page d'accueil. */
.lg-doc .lg-section::before {
    content: ''; position: absolute; top: 0; left: 12%; right: 12%; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(147, 197, 253, 0.45) 50%, transparent);
    opacity: 0.7; pointer-events: none;
}
.lg-doc h2 {
    display: flex; align-items: center; gap: 12px; margin: 0 0 14px;
    font: 700 19px/1.3 'Plus Jakarta Sans', system-ui, sans-serif; letter-spacing: -0.01em; color: var(--lg-titre);
}
.lg-doc .lg-num {
    flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px;
    font: 600 13px/1 'Space Grotesk', system-ui, sans-serif; color: var(--lg-accent-1);
    background: color-mix(in srgb, var(--lg-accent-1) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--lg-accent-1) 28%, transparent);
}
.lg-doc h3 { margin: 20px 0 6px; font: 700 15px/1.4 'Plus Jakarta Sans', system-ui, sans-serif; color: var(--lg-titre); }
.lg-doc p { margin: 0 0 12px; }
.lg-doc p:last-child { margin-bottom: 0; }
.lg-doc strong { color: var(--lg-titre); font-weight: 700; }
.lg-doc a { color: var(--lg-lien); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--lg-lien) 40%, transparent); text-underline-offset: 3px; }
.lg-doc a:hover { text-decoration-color: currentColor; }
/* Boutons posés dans un contenu (page 404) : pas l'allure d'un lien de texte. */
.lg-doc a.lg-bouton { color: #ffffff; text-decoration: none; }
.lg-doc a.lg-bouton-verre { color: #cbd5e1; text-decoration: none; }
.lg-doc a.lg-bouton-verre:hover { color: #ffffff; }
.lg-doc ul, .lg-doc ol:not(.lg-etapes) { margin: 0 0 12px; padding: 0; list-style: none; }
.lg-doc ul > li, .lg-doc ol:not(.lg-etapes) > li { position: relative; margin: 8px 0; padding-left: 20px; }
.lg-doc ul > li::before {
    content: ''; position: absolute; left: 3px; top: 0.72em; width: 6px; height: 6px; border-radius: 50%;
    background: linear-gradient(135deg, var(--lg-accent-1), var(--lg-accent-2));
}
/* Étapes numérotées (commande). */
.lg-doc ol { counter-reset: lg-etape; }
.lg-doc ol > li { counter-increment: lg-etape; }
.lg-doc ol > li::before {
    content: counter(lg-etape); position: absolute; left: 0; top: 0.2em;
    font: 600 12px/1.5 'Space Grotesk', system-ui, sans-serif; color: var(--lg-accent-1);
}
.lg-doc ol > li { padding-left: 22px; }

/* Encart (« En bref », avertissement médical) : bordure en dégradé. */
.lg-doc .lg-encart {
    position: relative; margin: 0 0 16px; padding: 20px 22px; border-radius: 18px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--lg-accent-1) 8%, transparent), color-mix(in srgb, var(--lg-accent-3, var(--lg-accent-2)) 5%, transparent));
}
.lg-doc .lg-encart::after {
    content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
    background: linear-gradient(135deg, color-mix(in srgb, var(--lg-accent-1) 60%, transparent), color-mix(in srgb, var(--lg-accent-2) 15%, transparent) 60%, color-mix(in srgb, var(--lg-accent-3, var(--lg-accent-2)) 35%, transparent));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.lg-doc .lg-section .lg-encart { margin: 4px 0 12px; }

/* Fiche (mentions légales) : intitulé / valeur. */
.lg-doc dl.lg-fiche {
    margin: 0; display: grid; grid-template-columns: minmax(130px, 210px) 1fr; gap: 0;
    border-radius: 14px; overflow: hidden; border: 1px solid var(--lg-bord);
}
.lg-doc dl.lg-fiche dt, .lg-doc dl.lg-fiche dd { margin: 0; padding: 11px 14px; border-bottom: 1px solid var(--lg-bord); }
.lg-doc dl.lg-fiche dt { color: var(--lg-doux); font-size: 14px; background: rgba(255, 255, 255, 0.025); }
.lg-doc dl.lg-fiche > :nth-last-child(-n+2) { border-bottom: 0; }

/* Tableaux : verre, intitulés en petites capitales. */
.lg-doc .lg-tableau-cadre { margin: 4px 0 14px; border-radius: 14px; border: 1px solid var(--lg-bord); overflow-x: auto; }
.lg-doc table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.55; }
.lg-doc th {
    padding: 11px 14px; text-align: left; vertical-align: bottom; white-space: nowrap;
    font: 700 11px/1.3 'Manrope', system-ui, sans-serif; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--lg-doux); background: rgba(255, 255, 255, 0.03); border-bottom: 1px solid var(--lg-bord);
}
.lg-doc td { padding: 11px 14px; vertical-align: top; border-bottom: 1px solid var(--lg-bord); }
.lg-doc tr:last-child td { border-bottom: 0; }
.lg-doc td:first-child { color: var(--lg-titre); font-weight: 600; }


/* Cases à compléter par l'éditeur : bien visibles tant qu'elles manquent. */
.lg-page .a-completer, .lg-doc .a-completer { padding: 1px 7px; border-radius: 7px; background: rgba(251, 191, 36, 0.14); color: #fcd34d; font-weight: 700; }

/* Formulaire de rétractation. */
.lg-doc .lg-formulaire { padding: 18px 20px; border-radius: 16px; border: 1px dashed color-mix(in srgb, var(--lg-accent-1) 35%, transparent); background: rgba(255, 255, 255, 0.02); }

/* Téléphone : cartes plus serrées, tableaux à deux colonnes empilés. */
@media (max-width: 640px) {
    .lg-principal { padding: 36px 16px 56px; }
    .lg-entete-doc { margin-bottom: 26px; }
    .lg-barre-ligne { padding: 12px 16px; }
    .lg-marque-signe { width: 2.25rem; height: 2.25rem; }
    .lg-marque-mot { font-size: 1.02rem; letter-spacing: 0.34em; margin-right: -0.34em; }
    .lg-actions .lg-bouton-verre { display: none; }
    .lg-bouton { min-height: 38px; padding: 0 14px; font-size: 13px; }
    .lg-long { display: none; }
    .lg-court { display: inline; }
    .lg-onglets { margin-bottom: 24px; }
    .lg-doc .lg-section { padding: 20px 18px 16px; border-radius: 18px; }
    .lg-doc h2 { font-size: 17px; }
    .lg-doc .lg-num { width: 30px; height: 30px; border-radius: 10px; font-size: 12px; }
    .lg-doc table.lg-pile, .lg-doc table.lg-pile tbody, .lg-doc table.lg-pile tr, .lg-doc table.lg-pile td { display: block; width: 100%; }
    .lg-doc table.lg-pile thead { display: none; }
    .lg-doc table.lg-pile tr { padding: 12px 14px; border-bottom: 1px solid var(--lg-bord); }
    .lg-doc table.lg-pile tr:last-child { border-bottom: 0; }
    .lg-doc table.lg-pile td { padding: 0; border: 0; }
    .lg-doc table.lg-pile td:first-child {
        margin-bottom: 4px; font: 700 11px/1.4 'Manrope', system-ui, sans-serif;
        letter-spacing: 0.12em; text-transform: uppercase; color: var(--lg-accent-1);
    }
    .lg-doc table.lg-cartes, .lg-doc table.lg-cartes tbody, .lg-doc table.lg-cartes td { display: block; width: 100%; }
    .lg-doc table.lg-cartes thead { display: none; }
    .lg-doc table.lg-cartes tr {
        display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px 12px;
        padding: 14px; border-bottom: 1px solid var(--lg-bord);
    }
    .lg-doc table.lg-cartes tr:last-child { border-bottom: 0; }
    .lg-doc table.lg-cartes td { padding: 0; border: 0; font-size: 14px; }
    .lg-doc table.lg-cartes td:first-child { grid-column: 1 / -1; font: 700 15px/1.4 'Plus Jakarta Sans', system-ui, sans-serif; }
    .lg-doc table.lg-cartes td:not(:first-child)::before {
        content: attr(data-label); display: block; margin-bottom: 3px;
        font: 700 10px/1.3 'Manrope', system-ui, sans-serif; letter-spacing: 0.12em; text-transform: uppercase; color: var(--lg-doux);
    }
    .lg-doc dl.lg-fiche { grid-template-columns: 1fr; }
    .lg-doc dl.lg-fiche dt { border-bottom: 0; padding-bottom: 2px; background: none; font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; }
    .lg-doc dl.lg-fiche dd { padding-top: 0; }
    .lg-doc dl.lg-fiche > :nth-last-child(2) { border-bottom: 0; }
}

/* ---- 6. Pied de page ---------------------------------------------------- */
.lg-pied { border-top: 1px solid rgba(255, 255, 255, 0.06); padding: 30px 20px 40px; text-align: center; color: var(--lg-doux); font-size: 14px; }
.lg-pied nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 20px; margin-bottom: 12px; }
.lg-pied a { color: var(--lg-doux); text-decoration: none; }
.lg-pied a:hover { color: #93c5fd; }
.lg-pied p { margin: 0; color: #4b5368; font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
    html:has(body.lg-page) { scroll-behavior: auto; }
    .lg-marque-mot > span { transition-delay: 0s; }
}

@media print {
    body.lg-page { background: #ffffff; color: #000000; }
    .lg-decor, .lg-barre, .lg-onglets, .lg-sommaire, .lg-pied nav { display: none !important; }
    .lg-doc .lg-section { background: none; border: 0; padding: 0; margin-bottom: 18px; }
    .lg-doc .lg-section::before { display: none; }
    .lg-doc, .lg-doc strong, .lg-doc h2, .lg-doc h3, .lg-entete-doc h1, .lg-degrade { color: #000000 !important; -webkit-text-fill-color: #000000; }
}
