/* ════════════════════════════════
   LEGAL MODAL - Identité Aperitiu
   Utilisée pour CGU + Politique de confidentialité (ouvertes depuis la
   page register). Reprend la palette crème/orange/rouge + Erica One.
════════════════════════════════ */

:root {
    --lm-cream:     #f3e9d7;
    --lm-cream-2:   #fbf4e9;
    --lm-cream-3:   #f1ead8;
    --lm-orange:    #ffa200;
    --lm-red:       #e85a28;
    --lm-red-dark:  #b22222;
    --lm-dark:      #242323;
    --lm-muted:     #7a6b58;
    --lm-border:    rgba(36, 35, 35, 0.12);

    --lm-font-display: 'Darumadrop One', 'Caveat', 'Poppins', system-ui, sans-serif;
    --lm-font-body:    'DM Sans', 'Poppins', system-ui, sans-serif;
}

/* ── Overlay ── */
.legal-modal-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(36, 35, 35, 0.55);
    display: flex; align-items: center; justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
    padding: 20px;
}
.legal-modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

/* ── Modal ── */
.legal-modal {
    width: 680px;
    max-width: 100%;
    max-height: 86vh;
    background: var(--lm-cream-2);
    border-radius: 22px;
    box-shadow: 0 24px 64px rgba(36, 35, 35, 0.22);
    display: flex;
    flex-direction: column;
    transform: translateY(24px) scale(.96);
    transition: transform .35s cubic-bezier(.22,.68,0,1.2);
    overflow: hidden;
    position: relative;
    font-family: var(--lm-font-body);
}
.legal-modal-overlay.open .legal-modal {
    transform: translateY(0) scale(1);
}

/* Bande dégradée haute (identité hero / cookie banner) */
.legal-modal::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--lm-red) 0%, var(--lm-orange) 50%, var(--lm-red) 100%);
    z-index: 1;
}

/* ── Header ── */
.legal-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 26px 30px 18px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--lm-border);
}
.legal-modal-head h3 {
    font-family: var(--lm-font-display);
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--lm-dark);
    margin: 0;
    line-height: 1.15;
    letter-spacing: .01em;
}
.legal-modal-close {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(36, 35, 35, 0.06);
    border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: background .2s ease, transform .2s ease;
}
.legal-modal-close svg {
    width: 14px; height: 14px;
    stroke: var(--lm-dark);
    fill: none;
    stroke-width: 2.2;
    transition: stroke .2s ease;
}
.legal-modal-close:hover {
    background: var(--lm-red);
    transform: rotate(90deg);
}
.legal-modal-close:hover svg { stroke: #fff; }

/* ── Body (contenu HTML legal) ── */
.legal-modal-body {
    padding: 22px 30px 28px;
    overflow-y: auto;
    flex: 1;
    font-size: .92rem;
    color: var(--lm-dark);
    line-height: 1.7;
    font-weight: 400;
}

/* Scrollbar custom orange */
.legal-modal-body::-webkit-scrollbar { width: 8px; }
.legal-modal-body::-webkit-scrollbar-track { background: transparent; }
.legal-modal-body::-webkit-scrollbar-thumb {
    background: rgba(232, 90, 40, 0.3);
    border-radius: 4px;
}
.legal-modal-body::-webkit-scrollbar-thumb:hover { background: var(--lm-red); }

/* Hiérarchie de titres */
.legal-modal-body h1,
.legal-modal-body h2 {
    font-family: var(--lm-font-display);
    font-size: 1.35rem;
    font-weight: 400;
    color: var(--lm-dark);
    margin: 26px 0 12px;
    letter-spacing: .01em;
    line-height: 1.25;
}
.legal-modal-body h1:first-child,
.legal-modal-body h2:first-child { margin-top: 0; }

.legal-modal-body h3 {
    font-family: var(--lm-font-body);
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--lm-red);
    margin: 20px 0 8px;
    letter-spacing: .01em;
}

.legal-modal-body h4 {
    font-family: var(--lm-font-body);
    font-size: .92rem;
    font-weight: 600;
    color: var(--lm-dark);
    margin: 16px 0 6px;
}

.legal-modal-body p {
    margin: 0 0 12px;
    color: var(--lm-dark);
}

.legal-modal-body strong { color: var(--lm-dark); font-weight: 600; }
.legal-modal-body em { color: var(--lm-muted); }

/* Listes : puces orange custom */
.legal-modal-body ul,
.legal-modal-body ol {
    padding-left: 22px;
    margin: 10px 0 14px;
}
.legal-modal-body ul li {
    list-style: none;
    position: relative;
    padding-left: 4px;
    margin-bottom: 6px;
}
.legal-modal-body ul li::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 11px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--lm-red);
}
.legal-modal-body ol {
    list-style: decimal;
}
.legal-modal-body ol li {
    margin-bottom: 6px;
    padding-left: 4px;
}
.legal-modal-body ol li::marker {
    color: var(--lm-red);
    font-weight: 700;
}

/* Liens */
.legal-modal-body a {
    color: var(--lm-red);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 500;
    transition: color .15s ease;
}
.legal-modal-body a:hover { color: var(--lm-red-dark); }

/* Tables (article RGPD/cookies) */
.legal-modal-body table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 14px 0 18px;
    font-size: .85rem;
    border: 1.5px solid var(--lm-border);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}
.legal-modal-body th,
.legal-modal-body td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--lm-border);
    vertical-align: top;
}
.legal-modal-body tr:last-child th,
.legal-modal-body tr:last-child td { border-bottom: none; }

.legal-modal-body th {
    background: var(--lm-cream-3);
    font-weight: 700;
    color: var(--lm-dark);
    font-family: var(--lm-font-body);
    letter-spacing: .01em;
}

.legal-modal-body td { color: var(--lm-dark); }

/* Citations / encadrés (blockquote) */
.legal-modal-body blockquote {
    margin: 14px 0;
    padding: 14px 18px;
    background: rgba(255, 162, 0, 0.10);
    border-left: 4px solid var(--lm-orange);
    border-radius: 0 10px 10px 0;
    color: var(--lm-dark);
    font-style: italic;
}

/* Code inline */
.legal-modal-body code {
    background: var(--lm-cream-3);
    color: var(--lm-red-dark);
    padding: 2px 7px;
    border-radius: 5px;
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: .85em;
    border: 1px solid var(--lm-border);
}

/* Séparateurs */
.legal-modal-body hr {
    border: none;
    height: 1px;
    background: var(--lm-border);
    margin: 22px 0;
}

/* État chargement */
.legal-modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 14px;
    color: var(--lm-muted);
    font-size: .92rem;
}
.legal-modal-loading::before {
    content: '';
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 3px solid rgba(232, 90, 40, 0.25);
    border-top-color: var(--lm-red);
    animation: lmSpin .9s linear infinite;
}
@keyframes lmSpin {
    to { transform: rotate(360deg); }
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .legal-modal-overlay { padding: 12px; }
    .legal-modal { max-height: 92vh; border-radius: 18px; }
    .legal-modal-head { padding: 22px 22px 14px; }
    .legal-modal-head h3 { font-size: 1.35rem; }
    .legal-modal-body { padding: 18px 22px 24px; font-size: .88rem; }
    .legal-modal-body h1,
    .legal-modal-body h2 { font-size: 1.18rem; }
    .legal-modal-body table { font-size: .78rem; }
    .legal-modal-body th,
    .legal-modal-body td { padding: 8px 10px; }
}
