/* Back-office Prospects — charte Hoplia : fond #0b002d, cartes en verre, dégradé cyan → violet réservé à l'essentiel,
   accent #ff3e6c pour les actions fortes. Titres Cabin SemiBold, texte Chillax. */

:root {
  --fond: #0b002d;
  --navy: #0a0a6e;
  --cyan: #14c8ff;
  --violet: #c814ff;
  --violet-mid: #a064ff;
  --rose-clair: #dcb4ff;
  --accent: #ff3e6c;
  --degrade: linear-gradient(120deg, #14c8ff, #c814ff);

  --encre: #f3efff;            /* texte principal */
  --gris: #b3a8d6;             /* texte secondaire : contraste ≥ 7:1 sur le fond */
  --verre: rgba(255, 255, 255, .055);
  --verre-fort: rgba(255, 255, 255, .09);
  --ligne: rgba(220, 180, 255, .16);
  --doux: rgba(160, 100, 255, .12);
  --ok: #4ee0a6;
  --alerte: #ffb36b;
  --danger: #ff6b8a;

  --titre: "Cabin", system-ui, sans-serif;
  --texte: "Chillax", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; background: var(--fond); }
body {
  font: 400 16px/1.55 var(--texte); color: var(--encre); min-height: 100vh; padding-bottom: env(safe-area-inset-bottom);
  background:
    radial-gradient(60rem 40rem at 105% -10%, rgba(200, 20, 255, .16), transparent 60%),
    radial-gradient(50rem 36rem at -10% 110%, rgba(20, 200, 255, .12), transparent 60%),
    var(--fond);
  background-attachment: fixed;
}
/* grain subtil */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
main, .barre { position: relative; z-index: 1; }

a { color: var(--cyan); text-underline-offset: 3px; }
a:hover { color: #6fdcff; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea {
  font-size: 16px; width: 100%; padding: .6rem .8rem; border: 1px solid var(--ligne); border-radius: 10px;
  background: rgba(11, 0, 45, .55); color: var(--encre); transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: rgba(179, 168, 214, .6); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--violet-mid); box-shadow: 0 0 0 3px rgba(160, 100, 255, .25); }
input[type="file"] { padding: .45rem .6rem; }
input[type="file"]::file-selector-button { font: 500 .85rem var(--texte); color: var(--encre); background: var(--verre-fort); border: 1px solid var(--ligne); border-radius: 8px; padding: .3rem .7rem; margin-right: .6rem; cursor: pointer; }
input[type="checkbox"] { accent-color: var(--violet-mid); }
textarea { resize: vertical; min-height: 6rem; line-height: 1.55; }
label { display: block; font-size: .85rem; color: var(--gris); margin: .8rem 0 .3rem; }
h1, h2, h3 { font-family: var(--titre); font-weight: 600; letter-spacing: -.005em; }
h1 { font-size: 1.75rem; line-height: 1.15; }
h2 { font-size: 1.08rem; margin-bottom: .8rem; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* Barre du haut */
.barre {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .85rem max(1.1rem, env(safe-area-inset-left));
  background: rgba(11, 0, 45, .72); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--ligne);
}
.marque { font: 600 1.05rem var(--titre); text-decoration: none; color: var(--encre); display: flex; align-items: baseline; gap: .45rem; }
.marque:hover { color: var(--encre); }
.marque-nom { background: var(--degrade); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 1.15rem; }
.marque-sep { color: var(--gris); }
.barre nav { display: flex; gap: .3rem; font-size: .95rem; }
.barre nav a { color: var(--gris); text-decoration: none; font-weight: 500; padding: .35rem .75rem; border-radius: 99px; transition: color .15s, background .15s; }
.barre nav a:hover { color: var(--encre); }
.barre nav a.actif { color: var(--encre); background: var(--verre-fort); }

main { max-width: 1040px; margin: 0 auto; padding: 1.6rem 1.1rem 3.5rem; }
.vide { color: var(--gris); text-align: center; padding: 3rem 1rem; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .6rem 1.05rem; border-radius: 99px;
  border: 1px solid var(--ligne); background: var(--verre); color: var(--encre); font: 500 .92rem var(--texte);
  text-decoration: none; cursor: pointer; white-space: nowrap; transition: transform .15s, background .15s, border-color .15s, box-shadow .2s;
}
.btn:hover { background: var(--verre-fort); border-color: rgba(220, 180, 255, .35); color: var(--encre); }
.btn:active { transform: translateY(1px); }
.btn.plein { background: var(--degrade); border-color: transparent; color: #fff; font-weight: 600; box-shadow: 0 6px 22px -8px rgba(200, 20, 255, .7); }
.btn.plein:hover { box-shadow: 0 8px 28px -8px rgba(200, 20, 255, .9); filter: brightness(1.06); }
/* action importante mais secondaire : le dégradé reste réservé à l'action principale de l'écran */
.btn.fort { background: rgba(160, 100, 255, .26); border-color: rgba(160, 100, 255, .55); color: #fff; font-weight: 600; }
.btn.fort:hover { background: rgba(160, 100, 255, .38); }
.btn.ok { color: #fff; background: var(--accent); border-color: transparent; font-weight: 600; box-shadow: 0 6px 20px -8px rgba(255, 62, 108, .8); }
.btn.ok:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); border-color: rgba(255, 107, 138, .4); background: transparent; }
.btn.danger:hover { background: rgba(255, 107, 138, .1); }
.btn.petit { padding: .3rem .7rem; font-size: .82rem; }
.btn:disabled { opacity: .45; cursor: default; box-shadow: none; filter: none; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* Cartes en verre */
.carte {
  background: var(--verre); border: 1px solid var(--ligne); border-radius: 18px; padding: 1.25rem 1.35rem; margin-bottom: 1rem;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 10px 30px -18px rgba(0, 0, 0, .6);
}

/* Tableau de bord */
.chiffres { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin: 1.2rem 0 1.4rem; }
.chiffre { background: var(--verre); border: 1px solid var(--ligne); border-radius: 16px; padding: .95rem 1.1rem; backdrop-filter: blur(10px); }
.chiffre b {
  display: block; font: 600 2rem/1.05 var(--titre);
  background: var(--degrade); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.chiffre span { font-size: .85rem; color: var(--gris); }
.filtres { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.filtre { border: 1px solid var(--ligne); background: var(--verre); color: var(--gris); border-radius: 99px; padding: .32rem .85rem; font-size: .86rem; cursor: pointer; transition: all .15s; }
.filtre:hover { color: var(--encre); }
.filtre.actif { background: var(--encre); color: var(--fond); border-color: var(--encre); font-weight: 500; }
.liste { display: grid; gap: .65rem; }
.ligne-site {
  display: grid; grid-template-columns: 1fr auto; gap: .35rem 1rem; align-items: center; background: var(--verre); border: 1px solid var(--ligne);
  border-radius: 16px; padding: 1rem 1.2rem; text-decoration: none; color: inherit; transition: border-color .15s, background .15s, transform .15s;
}
.ligne-site:hover { border-color: rgba(160, 100, 255, .55); background: var(--verre-fort); color: inherit; transform: translateY(-1px); }
.ligne-site .nom { font: 600 1.05rem var(--titre); }
.ligne-site .meta { font-size: .86rem; color: var(--gris); grid-column: 1 / -1; display: flex; gap: .4rem 1.1rem; flex-wrap: wrap; }

/* Statuts */
.pastille { display: inline-block; font-size: .78rem; font-weight: 500; padding: .2rem .7rem; border-radius: 99px; white-space: nowrap; border: 1px solid transparent; }
.s-a_contacter { background: rgba(20, 200, 255, .14); color: #7fdcff; border-color: rgba(20, 200, 255, .3); }
.s-contacte { background: rgba(255, 179, 107, .14); color: #ffc58f; border-color: rgba(255, 179, 107, .3); }
.s-relance { background: rgba(255, 62, 108, .14); color: #ff8fa9; border-color: rgba(255, 62, 108, .32); }
.s-en_discussion { background: rgba(160, 100, 255, .18); color: var(--rose-clair); border-color: rgba(160, 100, 255, .38); }
.s-signe { background: rgba(78, 224, 166, .14); color: #7eecbf; border-color: rgba(78, 224, 166, .32); }
.s-refuse, .s-abandonne { background: rgba(255, 255, 255, .05); color: var(--gris); border-color: var(--ligne); }
.vu { color: var(--ok); font-weight: 500; }
.relance { color: var(--accent); font-weight: 500; }

/* Fiche */
.entete { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; margin-bottom: 1.1rem; }
.entete p { color: var(--gris); margin-top: .2rem; }
.retour { display: inline-block; margin-bottom: .7rem; font-size: .9rem; text-decoration: none; color: var(--gris); }
.retour:hover { color: var(--encre); }
.statuts { display: flex; gap: .4rem; flex-wrap: wrap; }
.statuts button { border: 1px solid var(--ligne); border-radius: 99px; padding: .32rem .8rem; font-size: .85rem; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.statuts button:not(.actif) { background: transparent; color: var(--gris); border-color: var(--ligne); }
.statuts button:not(.actif):hover { color: var(--encre); background: var(--verre); }
.statuts button.actif { font-weight: 600; box-shadow: 0 0 0 2px var(--fond), 0 0 0 3px currentColor; }
.grille { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1rem; align-items: start; }
.grille > div { min-width: 0; }
.btn { max-width: 100%; }
.corps-mail { white-space: pre-wrap; background: rgba(11, 0, 45, .5); border: 1px solid var(--ligne); border-radius: 12px; padding: 1rem 1.1rem; font-size: .94rem; max-height: 26rem; overflow: auto; }
.champs2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .9rem; }
.evenements { list-style: none; font-size: .92rem; }
.evenements li { padding: .5rem 0; border-bottom: 1px solid var(--ligne); }
.evenements li:last-child { border-bottom: 0; }
.evenements time, .petit-gris { color: var(--gris); font-size: .82rem; }
.visites { list-style: none; font-size: .9rem; }
.visites li { padding: .5rem 0; border-bottom: 1px solid var(--ligne); display: flex; justify-content: space-between; gap: .8rem; }
.visites li:last-child { border-bottom: 0; }
.visites .ua { color: var(--gris); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch; display: inline-block; }
.q-visiteur { color: var(--ok); font-weight: 600; } .q-toi { color: var(--gris); } .q-robot, .q-probable { color: var(--gris); font-style: italic; }
.fichiers { list-style: none; font-size: .9rem; max-height: 18rem; overflow: auto; }
.fichiers li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .35rem 0; border-bottom: 1px solid var(--ligne); }
.fichiers a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note { font-size: .9rem; color: var(--rose-clair); background: var(--doux); border: 1px solid rgba(160, 100, 255, .25); border-radius: 12px; padding: .7rem .9rem; margin: .7rem 0; white-space: pre-wrap; }
.apercu { aspect-ratio: 16/10; border: 1px solid var(--ligne); border-radius: 12px; overflow: hidden; position: relative; background: #fff; margin-bottom: .9rem; }
.apercu iframe { position: absolute; top: 0; left: 0; width: 1280px; height: 800px; border: 0; transform-origin: 0 0; pointer-events: none; }
code, .code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .84rem; background: rgba(11, 0, 45, .6); border: 1px solid var(--ligne); color: var(--rose-clair); padding: .1rem .4rem; border-radius: 6px; word-break: break-all; }
pre.code { display: block; padding: .8rem 1rem; white-space: pre-wrap; margin: .6rem 0; }

/* Connexion */
.connexion { max-width: 400px; margin: 4rem auto; padding: 1.8rem; }
.connexion h1 { margin-bottom: .4rem; }
.connexion h1::after { content: ""; display: block; width: 3rem; height: 3px; border-radius: 3px; background: var(--degrade); margin-top: .8rem; }
.erreur { color: var(--danger); font-size: .9rem; margin-top: .7rem; }

.toast {
  position: fixed; left: 50%; bottom: calc(1.3rem + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20;
  background: rgba(20, 8, 60, .92); color: var(--encre); border: 1px solid rgba(160, 100, 255, .45); backdrop-filter: blur(10px);
  padding: .65rem 1.1rem; border-radius: 99px; font-size: .92rem; width: max-content; max-width: calc(100% - 2rem);
  box-shadow: 0 10px 30px -10px rgba(200, 20, 255, .5);
}
dialog {
  margin: auto; border: 1px solid var(--ligne); border-radius: 20px; padding: 1.5rem; color: var(--encre);
  background: rgba(16, 4, 56, .96); width: min(540px, calc(100% - 2rem)); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8);
}
dialog::backdrop { background: rgba(5, 0, 20, .6); backdrop-filter: blur(4px); }

@media (max-width: 430px) { .marque-sep, .marque-app { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (max-width: 760px) {
  .chiffres { grid-template-columns: repeat(2, 1fr); }
  .grille, .champs2 { grid-template-columns: 1fr; }
  .barre nav a { padding: .3rem .5rem; }
  .barre nav { gap: .1rem; }
  h1 { font-size: 1.5rem; }
}

/* Mail : aperçu fidèle à ce que recevra le client (fond clair, comme dans une messagerie) */
.mail-html { background: #fff; color: #222; border-color: transparent; white-space: normal; }
.mail-html p { margin: 0 0 .8em; }
.mail-html a { color: #1a5fd0; }
.mail-html img { max-width: 100%; height: auto; }

/* Image avant/après : vignette cliquable et visionneuse */
.vignette { all: unset; display: block; position: relative; cursor: zoom-in; margin: .8rem 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--ligne); }
.vignette img { display: block; width: 100%; transition: transform .25s; }
.vignette span { position: absolute; right: .6rem; bottom: .6rem; font-size: .8rem; padding: .25rem .65rem; border-radius: 99px; background: rgba(11, 0, 45, .75); color: var(--encre); opacity: 0; transition: opacity .2s; }
.vignette:hover img { transform: scale(1.015); }
.vignette:hover span, .vignette:focus-visible span { opacity: 1; }
dialog.visionneuse { width: min(1400px, calc(100% - 2rem)); padding: 1rem; background: rgba(11, 0, 45, .96); }
dialog.visionneuse img { display: block; width: 100%; height: auto; max-height: calc(100vh - 9rem); object-fit: contain; border-radius: 10px; cursor: zoom-out; }
dialog.visionneuse .actions { justify-content: flex-end; margin-top: .8rem; }
