/* Sentinelle Dark Web : les adresses et leurs fuites, en détail (voir js/fuites-detail.js).
   Même langage que Réglages : un contour fin dans le bleu-violet du thème, vert quand tout est en règle.
   Jetons du design system seulement. */

.fd-liste { display: grid; gap: var(--space-lg); max-width: var(--largeur-bandeau); margin: 0 auto var(--space-lg); }

/* ═════════════ Une adresse ═════════════ */
.fd-adresse {
  --ton: var(--action);
  position: relative; overflow: hidden;
  padding: 22px 24px 24px; border-radius: 26px;
  background:
    radial-gradient(90% 55% at 100% 0%, color-mix(in srgb, var(--ton) 12%, transparent), transparent 70%),
    linear-gradient(180deg, #fff 0%, color-mix(in srgb, var(--ton) 5%, #fff) 100%);
  border: 1.5px solid var(--ton);
  box-shadow: inset 0 1px 0 #fff, 0 0 0 4px color-mix(in srgb, var(--ton) 9%, transparent), 0 24px 44px -32px color-mix(in srgb, var(--ton) 70%, rgba(25, 20, 62, .5));
}
.fd-adresse[data-etat="sur"] { --ton: #14a37f; }
.fd-adresse[data-etat="vigilance"] { --ton: var(--action); }
.fd-adresse[data-etat="critique"] { --ton: var(--action); }

.fd-adresse__tete { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.fd-adresse__tuile {
  flex: none; width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; color: var(--ton);
  background: color-mix(in srgb, var(--ton) 12%, #fff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ton) 26%, transparent), 0 10px 20px -12px color-mix(in srgb, var(--ton) 75%, transparent);
}
.fd-adresse__id { flex: 1 1 280px; min-width: 0; }
.fd-adresse__mail { margin: 0; font-family: var(--font-display); font-size: 18px; font-weight: 600; letter-spacing: -.2px; color: var(--brand-1); overflow-wrap: break-word; }
.fd-adresse__verif { margin: 2px 0 0; font-size: 13px; color: var(--ink-muted-48); }

.fd-pastille { display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px 6px 11px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; color: var(--ton); background: color-mix(in srgb, var(--ton) 11%, #fff); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ton) 28%, transparent); }
.fd-pastille i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.fd-pastille--vigilance, .fd-pastille--critique { color: #a35f00; background: #fff4e3; box-shadow: inset 0 0 0 1px rgba(176, 112, 11, .35); }
.fd-pastille--vigilance i, .fd-pastille--critique i { animation: fdPouls 1.9s ease-out infinite; }
.fd-pastille--sur { color: #0e7a5f; }
@keyframes fdPouls { 0% { box-shadow: 0 0 0 0 rgba(176, 112, 11, .55); } 70%, 100% { box-shadow: 0 0 0 8px rgba(176, 112, 11, 0); } }
.fd-retirer { min-height: 36px; }

.fd-compteurs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 18px 0 4px; }
.fd-compteurs > div { padding: 12px 14px; border-radius: 16px; background: #fff; border: 1.5px solid color-mix(in srgb, var(--ton) 30%, #fff); }
.fd-compteurs dt { font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-muted-48); }
.fd-compteurs dd { margin: 3px 0 0; font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -.8px; color: var(--brand-1); font-variant-numeric: tabular-nums; }
.fd-compteurs .is-accent { border-color: #d98b1c; background: #fffaf1; }
.fd-compteurs .is-accent dd { color: #a35f00; }
.fd-compteurs .is-sur { border-color: #14a37f; background: #f2fbf8; }
.fd-compteurs .is-sur dd { color: #0e7a5f; }

.fd-vide { margin: 16px 0 0; padding: 14px 16px; border-radius: 16px; background: color-mix(in srgb, var(--ton) 8%, #fff); font-size: 14.5px; line-height: 1.5; color: var(--ink-muted-80); }
.fd-vide--page { background: #fff; border: 1.5px dashed color-mix(in srgb, var(--action) 45%, #fff); }
.fd-calme { display: flex; gap: 14px; align-items: center; margin-top: 16px; padding: 16px 18px; border-radius: 18px; background: #f2fbf8; border: 1.5px solid #14a37f; color: var(--ink-muted-80); font-size: 14.5px; line-height: 1.5; }
.fd-calme svg { flex: none; color: #14a37f; }
.fd-calme b { color: var(--brand-1); }

/* ═════════════ Les sections d'une adresse ═════════════ */
.fd-section { margin-top: 18px; display: grid; gap: 12px; }
.fd-section__tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.fd-section__tete h3 { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #a35f00; display: flex; align-items: center; gap: 8px; }
.fd-section__tete h3::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #d98b1c; }
.fd-section--vues { padding: 0; margin-top: 16px; }
.fd-section--vues > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; background: #f2fbf8; border: 1.5px solid color-mix(in srgb, #14a37f 55%, #fff); color: #0e7a5f; font-size: 14px; font-weight: 700; }
.fd-section--vues > summary::-webkit-details-marker { display: none; }
.fd-section--vues > summary span { flex: 1; }
.fd-section--vues > summary b { min-width: 24px; padding: 1px 8px; border-radius: 999px; background: #14a37f; color: #fff; text-align: center; font-size: 12.5px; }
.fd-section--vues > summary svg { transition: transform var(--dur-fast) var(--ease-standard); }
.fd-section--vues[open] > summary svg { transform: rotate(180deg); }
.fd-section--vues[open] > summary { margin-bottom: 12px; }
.fd-section--vues > .fd-fuite + .fd-fuite { margin-top: 12px; }

/* ═════════════ Une fuite ═════════════ */
.fd-fuite {
  --g: var(--ink-muted-48);
  position: relative; overflow: hidden; border-radius: 20px;
  background:
    radial-gradient(85% 120% at 0% 0%, color-mix(in srgb, var(--g) 17%, transparent) 0%, transparent 62%) padding-box,
    linear-gradient(180deg, #fff 0%, color-mix(in srgb, var(--g) 4%, #fff) 100%) padding-box,
    linear-gradient(135deg, color-mix(in srgb, var(--g) 70%, #fff) 0%, color-mix(in srgb, var(--g) 16%, #fff) 55%, color-mix(in srgb, var(--g) 46%, #fff) 100%) border-box;
  border: 1.5px solid transparent;
  box-shadow: inset 0 1px 0 #fff, 0 20px 34px -26px color-mix(in srgb, var(--g) 70%, rgba(25, 20, 62, .6));
  transition: box-shadow var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard);
}
.fd-fuite[data-gravite="rouge"] { --g: #d2264f; }
.fd-fuite[data-gravite="ambre"] { --g: #d98b1c; }
.fd-fuite[data-gravite="neutre"] { --g: var(--action); }
.fd-fuite.is-vue { --g: #14a37f; }

.fd-fuite__tete { appearance: none; border: 0; background: transparent; font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%; display: flex; align-items: center; gap: 14px; padding: 16px 18px 6px 22px; }
.fd-fuite__tete:focus-visible { outline: 2px solid var(--action-focus); outline-offset: -3px; border-radius: 18px; }
.fd-logo { position: relative; flex: none; width: 56px; height: 56px; display: grid; place-items: center; }
.fd-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.fd-logo b { font-family: var(--font-display); font-size: 24px; font-weight: 700; color: #fff; }
.fd-fuite__tete .fd-logo::before { content: ""; position: absolute; inset: -7px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--g) 30%, transparent), transparent); }
.fd-logo.is-vide { background: linear-gradient(135deg, var(--brand-3), var(--brand-5)); box-shadow: none; }
.fd-fuite__id { flex: 1 1 auto; min-width: 0; display: grid; gap: 1px; }
.fd-fuite__titre { font-family: var(--font-display); font-size: 18px; font-weight: 600; letter-spacing: -.2px; color: var(--brand-1); overflow-wrap: anywhere; }
.fd-fuite__domaine { font-size: 13px; color: var(--ink-muted-48); }
.fd-fuite__plus { flex: none; color: var(--ink-muted-48); transition: transform var(--dur-fast) var(--ease-standard); }
.fd-fuite__tete[aria-expanded="true"] .fd-fuite__plus { transform: rotate(180deg); }

.fd-etat { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.fd-etat--nouvelle { color: #a35f00; background: #fff4e3; box-shadow: inset 0 0 0 1px rgba(176, 112, 11, .35); }
.fd-etat--nouvelle i { width: 7px; height: 7px; border-radius: 50%; background: #d98b1c; animation: fdPouls 1.9s ease-out infinite; }
.fd-etat--vue { color: #0e7a5f; background: #e8f8f2; box-shadow: inset 0 0 0 1px rgba(20, 163, 127, .35); }

.fd-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 4px 18px 12px 22px; font-size: 13px; color: var(--ink-muted-80); }
.fd-meta__item { display: inline-flex; align-items: center; gap: 6px; }
.fd-meta__item svg { color: var(--ink-muted-48); flex: none; }
.fd-meta__discret { color: var(--ink-muted-48); }

.fd-fuite__corps { padding: 4px 20px 18px 22px; display: grid; gap: 10px; border-top: 1px dashed color-mix(in srgb, var(--g) 38%, #fff); margin: 0 0 0; padding-top: 14px; }
.fd-fuite__corps[hidden] { display: none; }
.fd-titre-section { margin: 4px 0 0; font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-muted-48); }

.fd-donnees { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.fd-donnee { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px 5px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: #f3f2fa; color: var(--ink-muted-80); box-shadow: inset 0 0 0 1px rgba(94, 83, 152, .14); }
.fd-donnee--rouge { background: #fdecf0; color: #b11f45; box-shadow: inset 0 0 0 1px rgba(210, 38, 79, .35); }
.fd-donnee--ambre { background: #fff4e3; color: #98590a; box-shadow: inset 0 0 0 1px rgba(176, 112, 11, .32); }

.fd-conseils { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fd-conseils li { position: relative; padding-left: 20px; font-size: 14.5px; line-height: 1.5; color: var(--ink-muted-80); }
.fd-conseils li::before { content: ""; position: absolute; left: 0; top: .6em; width: 8px; height: 8px; border-radius: 3px; transform: rotate(45deg); background: var(--g); opacity: .8; }

.fd-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.fd-bouton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 999px; font: inherit; font-size: 14.5px; font-weight: 600; text-decoration: none; cursor: pointer; border: 1.5px solid transparent; transition: transform var(--dur-fast) var(--ease-standard), box-shadow var(--dur-fast) var(--ease-standard), background var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard); }
.fd-bouton:focus-visible { outline: 2px solid var(--action-focus); outline-offset: 3px; }
.fd-bouton--plein { color: #fff; background: linear-gradient(135deg, #0f9a76, #14a37f); box-shadow: 0 14px 24px -14px rgba(10, 100, 80, .9); }
.fd-bouton--plein:hover { transform: translateY(-1px); box-shadow: 0 18px 28px -14px rgba(10, 100, 80, .95); }
.fd-bouton--aide { color: var(--action-focus); background: #fff; border-color: color-mix(in srgb, var(--action) 55%, #fff); }
.fd-bouton--aide:hover { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--action-focus), var(--action)); text-decoration: none; }
.fd-bouton--discret { min-height: 38px; padding: 0 16px; font-size: 13.5px; color: var(--ink-muted-80); background: #fff; border-color: rgba(94, 83, 152, .25); }
.fd-bouton--discret:hover { border-color: var(--action); color: var(--action-focus); }

@media (max-width: 640px) {
  .fd-adresse { padding: 18px 16px 18px; border-radius: 22px; }
  .fd-compteurs { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .fd-compteurs > div { padding: 10px; }
  .fd-compteurs dt { font-size: 10px; letter-spacing: .05em; }
  .fd-compteurs dd { font-size: 22px; }
  .fd-pastille { order: 3; }
  .fd-fuite__tete { flex-wrap: wrap; padding: 14px 14px 4px 18px; gap: 12px; }
  .fd-logo { width: 48px; height: 48px; }
  .fd-etat { order: 4; margin-left: 60px; }
  .fd-fuite__plus { margin-left: auto; position: absolute; right: 14px; top: 20px; }
  .fd-meta { padding: 6px 14px 10px 18px; }
  .fd-fuite__corps { padding: 12px 14px 16px 18px; }
  .fd-actions .fd-bouton { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) { .fd-pastille i, .fd-etat i { animation: none; } }

/* ═════════════ Les cartes d'adresse : fond « aurore » ═════════════
   Une lumière colorée par l'état de l'adresse (rose s'il y a des fuites à examiner, ambre pour une seule, vert quand tout est pris en
   compte, violet sinon), un halo violet à l'opposé, un contour dégradé. Les cartes de fuite posées dessus restent blanches : lisibles,
   et les logos y gardent leurs couleurs. */
.fd-adresse {
  --ton: #6d6ab6;
  background:
    radial-gradient(110% 80% at 0% 0%, color-mix(in srgb, var(--ton) 15%, transparent) 0%, transparent 60%) padding-box,
    radial-gradient(90% 90% at 100% 100%, rgba(110, 106, 177, .17) 0%, transparent 64%) padding-box,
    linear-gradient(165deg, #fdfcff 0%, #efecfa 100%) padding-box,
    linear-gradient(140deg, color-mix(in srgb, var(--ton) 82%, #fff) 0%, rgba(110, 106, 177, .55) 52%, color-mix(in srgb, var(--ton) 36%, #fff) 100%) border-box;
  border: 1.5px solid transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 28px 48px -32px color-mix(in srgb, var(--ton) 62%, rgba(25, 20, 62, .7)), 0 2px 6px -2px rgba(66, 55, 122, .12);
}
.fd-adresse[data-etat="critique"] { --ton: #d2264f; }
.fd-adresse[data-etat="vigilance"] { --ton: #d98b1c; }
.fd-adresse[data-etat="sur"] { --ton: #14a37f; }
.fd-adresse[data-etat="neutre"] { --ton: #6d6ab6; }
.fd-pastille--critique { color: #b11f45; background: #fdecf0; box-shadow: inset 0 0 0 1px rgba(210, 38, 79, .35); }
.fd-pastille--critique i { animation-name: fdPoulsRose; }
@keyframes fdPoulsRose { 0% { box-shadow: 0 0 0 0 rgba(210, 38, 79, .5); } 70%, 100% { box-shadow: 0 0 0 8px rgba(210, 38, 79, 0); } }

/* Le logo tel quel : pas de vignette, pas de fond. Un très léger contour d'ombre garde lisible un logo blanc. */
.fd-logo { background: none; box-shadow: none; border-radius: 0; overflow: visible; width: 56px; height: 56px; }
.fd-logo img { padding: 0; filter: drop-shadow(0 0 1px rgba(25, 20, 62, .55)) drop-shadow(0 1px 2px rgba(25, 20, 62, .18)); }
.fd-logo.is-vide { border-radius: 16px; background: linear-gradient(135deg, var(--brand-3), var(--brand-5)); }
@media (max-width: 640px) { .fd-logo { width: 48px; height: 48px; } }

/* ═════════════ Le détail d'une fuite : le récit, les faits, ce que ça permet ═════════════ */
.fd-recit { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ink-muted-80); text-wrap: pretty; }
.fd-faits { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 2px 0 4px; }
.fd-faits > div { padding: 9px 12px; border-radius: 14px; background: #f6f5fc; box-shadow: inset 0 0 0 1px rgba(94, 83, 152, .14); }
.fd-faits dt { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted-48); }
.fd-faits dd { margin: 2px 0 0; font-family: var(--font-display); font-size: 15.5px; font-weight: 700; letter-spacing: -.2px; color: var(--brand-1); }
.fd-conseils--risques li::before { background: #d2264f; }
.fd-source { border-radius: 14px; background: #f6f5fc; box-shadow: inset 0 0 0 1px rgba(94, 83, 152, .14); }
.fd-source > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-size: 13.5px; font-weight: 700; color: var(--action-focus); flex-wrap: wrap; }
.fd-source > summary::-webkit-details-marker { display: none; }
.fd-source > summary small { flex: 1; font-size: 12px; font-weight: 400; color: var(--ink-muted-48); }
.fd-source > summary svg { margin-left: auto; transition: transform var(--dur-fast) var(--ease-standard); }
.fd-source[open] > summary svg { transform: rotate(180deg); }
.fd-source > p { margin: 0; padding: 0 14px 14px; font-size: 13.5px; line-height: 1.6; color: var(--ink-muted-80); }

/* Vérification immédiate d'une adresse qu'on vient d'ajouter */
.fd-attente { display: flex; gap: 14px; align-items: center; margin-top: 16px; padding: 16px 18px; border-radius: 18px; background: color-mix(in srgb, var(--ton) 9%, #fff); border: 1.5px solid color-mix(in srgb, var(--ton) 35%, #fff); color: var(--ink-muted-80); font-size: 14.5px; line-height: 1.5; }
.fd-attente b { color: var(--brand-1); }
.fd-attente__rond { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 3px solid color-mix(in srgb, var(--ton) 25%, #fff); border-top-color: var(--ton); animation: fdTourne .8s linear infinite; }
@keyframes fdTourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .fd-attente__rond { animation-duration: 2.4s; } }

/* Quand la carte est étroite, l'adresse garde toute la largeur à côté de l'icône ; l'état et « Retirer »
   passent dessous, alignés sur l'adresse. Une adresse ne se coupe plus au milieu d'un mot. */
.fd-adresse { container-type: inline-size; }
@container (max-width: 680px) {
  .fd-adresse__id { flex: 1 1 calc(100% - 66px); }
  .fd-adresse__tete .fd-pastille { margin-left: 62px; }
  .fd-adresse__mail { font-size: 17px; }
}
@container (max-width: 400px) {
  .fd-adresse__mail { font-size: 15.5px; letter-spacing: -.3px; }
}
