/* ============================================================
   SymbioMail — bandeau des témoins (cookies), « carte postale »
   ------------------------------------------------------------
   Modèle commun SymbioteK (Studio, 19/11/2026), adapté le 2026-11-23.
   Gabarit : application/resources/views/legal/temoins.blade.php
   Comportement : public/js/cookie-consent.js
   Couleur et polices : celles de SymbioMail (--sm-primary-fixed,
   --sm-font-text, --sm-font-title), thème clair ou sombre.
   Tout est préfixé .sm-temoins pour ne jamais toucher au thème hôte.
   ============================================================ */

.sm-temoins {
    --smt-fond: #fdfcfa;
    --smt-encre: #2c2c2e;
    --smt-doux: #5d6470;
    --smt-titre: #060b18;
    --smt-cat: #f3efe6;
    --smt-ico: #ffffff;
    --smt-filet: rgba(44, 44, 46, .14);
    --smt-survol: rgba(44, 44, 46, .06);
    --smt-accent: var(--sm-primary-fixed, #1f438f);
    --smt-sur-accent: #ffffff;
    --smt-badge-fond: #e3f1e5;
    --smt-badge: #1d5a33;
    --smt-inter: #8f877b;
    --smt-erreur: #8a2c14;
    --smt-anneau: #2563eb;

    position: fixed;
    left: 24px;
    bottom: 24px;
    z-index: 2147483000;
    box-sizing: border-box;
    width: 400px;
    max-width: calc(100vw - 48px);
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    padding: 22px 22px 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 0;
    border-radius: 22px;
    background: var(--smt-fond);
    color: var(--smt-encre);
    box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .55), 0 0 0 1px rgba(0, 0, 0, .06);
    font: 15px/1.55 var(--sm-font-text, Nunito, "Segoe UI", Roboto, Arial, sans-serif);
    letter-spacing: normal;
    text-align: left;
}

html[data-sm-theme="dark"] .sm-temoins {
    --smt-fond: #0c1424;
    --smt-encre: #e6e9ef;
    --smt-doux: #a7b0c0;
    --smt-titre: #f5f7fb;
    --smt-cat: #131e33;
    --smt-ico: #1b2741;
    --smt-filet: rgba(230, 233, 239, .16);
    --smt-survol: rgba(230, 233, 239, .08);
    --smt-accent: #8fb4ec;
    --smt-sur-accent: #06142e;
    --smt-badge-fond: #173726;
    --smt-badge: #a8e0b8;
    --smt-inter: #5b6478;
    --smt-erreur: #f3a58f;
    --smt-anneau: #8fb4ec;
}
@media (prefers-color-scheme: dark) {
    html[data-sm-theme="system"] .sm-temoins {
        --smt-fond: #0c1424;
        --smt-encre: #e6e9ef;
        --smt-doux: #a7b0c0;
        --smt-titre: #f5f7fb;
        --smt-cat: #131e33;
        --smt-ico: #1b2741;
        --smt-filet: rgba(230, 233, 239, .16);
        --smt-survol: rgba(230, 233, 239, .08);
        --smt-accent: #8fb4ec;
        --smt-sur-accent: #06142e;
        --smt-badge-fond: #173726;
        --smt-badge: #a8e0b8;
        --smt-inter: #5b6478;
        --smt-erreur: #f3a58f;
        --smt-anneau: #8fb4ec;
    }
}

.sm-temoins[hidden],
.sm-temoins [hidden] { display: none !important; }

/* Une fenêtre modale ouverte passe devant la carte (modèle Studio du 20/11/2026) : la carte
   s'efface le temps qu'elle est ouverte et revient à sa fermeture, sans rien enregistrer.
   Signaux : Bootstrap (body.modal-open), SweetAlert2 hors toast (html.swal2-shown), <dialog>
   ouvert par showModal(), fenêtre des textes juridiques, html.sm-modale-ouverte pour une fenêtre
   faite main, et html.sm-modale-auto, posé par cookie-consent.js pour toute fenêtre aria-modal
   visible (fenêtres Vue de l'application). */
body.modal-open .sm-temoins,
html.swal2-shown:not(.swal2-toast-shown) .sm-temoins,
html.sm-modale-ouverte .sm-temoins,
html.sm-modale-auto .sm-temoins { visibility: hidden; opacity: 0; pointer-events: none; }
html:has(dialog:modal) .sm-temoins,
html:has(.sm-legal-modal:not([hidden])) .sm-temoins { visibility: hidden; opacity: 0; pointer-events: none; }

.sm-temoins *,
.sm-temoins *::before,
.sm-temoins *::after { box-sizing: border-box; }
.sm-temoins p { margin: 0; color: inherit; font: inherit; }
.sm-temoins button { margin: 0; font: inherit; letter-spacing: normal; text-transform: none; box-shadow: none; }

.sm-temoins__illu {
    display: flex; align-items: center; justify-content: center;
    width: 54px; height: 54px; margin-bottom: 12px; border-radius: 16px;
    background: color-mix(in srgb, var(--smt-accent) 14%, var(--smt-fond));
    color: var(--smt-accent);
}
.sm-temoins__titre {
    margin: 0 0 8px !important; padding-right: 32px;
    color: var(--smt-titre) !important;
    font-family: var(--sm-font-title, "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif) !important;
    font-size: 20px !important; font-weight: 600 !important; line-height: 1.25 !important;
}
.sm-temoins__titre:focus { outline: none; }
.sm-temoins__texte { margin: 0 0 16px !important; color: var(--smt-encre) !important; font-size: 14.5px !important; }

.sm-temoins__boutons { display: flex; gap: 8px; }
.sm-temoins__bouton {
    flex: 1 1 0; min-height: 48px; padding: 10px 16px;
    border: 1px solid var(--smt-encre); border-radius: 12px;
    background: transparent; color: var(--smt-encre);
    font-weight: 700 !important; cursor: pointer;
    transition: transform .15s ease, background-color .2s ease;
}
.sm-temoins__bouton:hover { background: var(--smt-survol); }
.sm-temoins__bouton:active { transform: scale(.97); }
.sm-temoins__bouton--plein,
.sm-temoins__bouton--plein:hover { border-color: var(--smt-accent); background: var(--smt-accent); color: var(--smt-sur-accent); }

.sm-temoins__bas {
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
    gap: 8px 12px; margin-top: 12px; color: var(--smt-doux); font-size: 13px;
}
.sm-temoins__lien {
    min-height: 32px; padding: 0; border: 0; background: none;
    color: var(--smt-encre); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.sm-temoins__bas a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

.sm-temoins__chapeau { margin: 0 0 14px !important; color: var(--smt-doux) !important; font-size: 14px !important; }
.sm-temoins__cat { margin-bottom: 10px; padding: 14px 14px 12px; border-radius: 14px; background: var(--smt-cat); }
.sm-temoins__tete { display: flex; gap: 12px; align-items: flex-start; }
.sm-temoins__ico {
    flex: none; display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 10px; background: var(--smt-ico); font-size: 18px;
}
.sm-temoins__txt { flex: 1; min-width: 0; }
.sm-temoins__nom { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font-weight: 700 !important; }
.sm-temoins__badge {
    padding: 2px 8px; border-radius: 999px; background: var(--smt-badge-fond); color: var(--smt-badge);
    font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
}
.sm-temoins__promesse { margin-top: 2px !important; color: var(--smt-encre) !important; font-size: 13.5px !important; opacity: .9; }

.sm-temoins__inter {
    flex: none; position: relative; width: 46px; height: 28px; padding: 0;
    border: 0; border-radius: 999px; background: var(--smt-inter); cursor: pointer; transition: background-color .2s;
}
.sm-temoins__inter::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
    border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s;
}
.sm-temoins__inter[aria-checked="true"] { background: var(--smt-accent); }
.sm-temoins__inter[aria-checked="true"]::after { transform: translateX(18px); }
.sm-temoins__inter:disabled { opacity: .55; cursor: not-allowed; }
/* Cible tactile de 44 px autour de l'interrupteur, sans grossir le dessin. */
.sm-temoins__inter::before { content: ""; position: absolute; inset: -8px -2px; }

.sm-temoins__plus {
    min-height: 32px; margin: 6px 0 0 48px; padding: 0; border: 0; background: none;
    color: var(--smt-encre); font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.sm-temoins__det { margin: 8px 0 0 48px; }
.sm-temoins__det table { width: 100%; margin: 0; border-collapse: collapse; background: none; font-size: 12.5px; }
.sm-temoins__det td {
    padding: 6px 8px 6px 0; border: 0; border-top: 1px solid var(--smt-filet);
    background: none; color: inherit; vertical-align: top;
}
.sm-temoins__det td:first-child { width: 36%; font-weight: 700; }
.sm-temoins__det td:last-child { padding-right: 0; color: var(--smt-doux); text-align: right; white-space: nowrap; }
.sm-temoins__note { margin-top: 8px !important; color: var(--smt-doux) !important; font-size: 12.5px !important; }

.sm-temoins__pied { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.sm-temoins__pied .sm-temoins__bouton { flex: 1 1 140px; }
.sm-temoins__etat { margin-top: 12px !important; color: var(--smt-erreur) !important; font-weight: 600 !important; }

.sm-temoins__fermer {
    position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; padding: 0;
    border: 0; border-radius: 10px; background: transparent; color: var(--smt-doux);
    font-size: 26px !important; line-height: 1; cursor: pointer;
}
.sm-temoins__fermer:hover { background: var(--smt-survol); }

.sm-temoins button:focus-visible,
.sm-temoins a:focus-visible { outline: 3px solid var(--smt-anneau); outline-offset: 2px; }

@media (max-width: 480px) {
    .sm-temoins {
        left: 8px; right: 8px; bottom: 8px; width: auto; max-width: none;
        max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px);
        padding: 18px 16px 16px;
    }
    .sm-temoins__titre { font-size: 18px !important; }
    .sm-temoins__pied {
        position: sticky; bottom: -16px; margin: 14px -16px -16px; padding: 12px 16px 16px;
        background: var(--smt-fond);
    }
    .sm-temoins__plus,
    .sm-temoins__det { margin-left: 0; }
    .sm-temoins__plus,
    .sm-temoins__lien { min-height: 44px; }
    .sm-temoins__det td:first-child { width: 34%; }
    .sm-temoins__det td:last-child { white-space: normal; }
}

@media (prefers-reduced-motion: no-preference) {
    .sm-temoins { animation: sm-temoins-entree .45s cubic-bezier(.2, .7, .2, 1); transition: opacity .2s ease, visibility 0s linear 0s; }
    body.modal-open .sm-temoins,
    html.swal2-shown:not(.swal2-toast-shown) .sm-temoins,
    html.sm-modale-ouverte .sm-temoins,
    html.sm-modale-auto .sm-temoins { transition: opacity .15s ease, visibility 0s linear .15s; }
}
@keyframes sm-temoins-entree { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media print { .sm-temoins { display: none !important; } }
