/* Fusion Salon — style du site fusionpiscine.fr (comme la page croisière) */

@font-face {
  font-family: "sf-pro-regular";
  src: url("https://fusionpiscine.fr/wp-content/uploads/useanyfont/5680SF-Pro-Regular.woff2") format("woff2"),
       url("https://fusionpiscine.fr/wp-content/uploads/useanyfont/5680SF-Pro-Regular.woff") format("woff");
  font-display: swap;
}

:root {
  --bleu: #3361A6;
  --bleu-fonce: #1C5091;
  --bleu-clair: #eaf0f8;
  --rouge: #CC0101;
  --rouge-clair: #fdf2f2;
  --vert: #1e8449;
  --orange: #b9770e;
  --texte: #555555;
  --texte-fort: #2b2b2b;
  --gris: #8a8a8a;
  --bord: #dcdee2;
  --fond: #f0f0f1;
  --blanc: #ffffff;
  --survol: #f6f7f8;
  --star: #F5B700;
}

/* Thème sombre : classe .dark sur <html> (réglage Apparence du compte) */
html.dark {
  --bleu-clair: rgba(51, 97, 166, .22);
  --rouge-clair: rgba(204, 1, 1, .15);
  --texte: #c4c4c4;
  --texte-fort: #f0f0f0;
  --gris: #9a9a9a;
  --bord: #3a3a3d;
  --fond: #121212;
  --blanc: #1e1e20;
  --survol: #26262a;
  color-scheme: dark;
}
html.dark .logo { filter: brightness(0) invert(1); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: "sf-pro-regular", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--bleu); text-decoration: none; }
html.dark a { color: #7fa6e0; }
.ic { width: 20px; height: 20px; flex: none; }
.muted { color: var(--gris); }
.req { color: var(--rouge); }
.opt { font-size: 12px; font-weight: 400; color: var(--gris); text-transform: none; letter-spacing: 0; }

/* ---------- Bandeau et onglets ---------- */

.banner { background: var(--bleu); color: #fff; text-align: center; padding: calc(11px + env(safe-area-inset-top, 0px)) 16px 11px; }
.banner h1 { margin: 0; font-size: 26px; font-weight: 400; line-height: 1.05; text-transform: uppercase; }

.nav { display: flex; justify-content: center; background: var(--blanc); border-bottom: 1px solid var(--bord); position: sticky; top: 0; z-index: 1000; }
.nav a {
  flex: 0 1 200px; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 10px 10px; border-bottom: 3px solid transparent;
  color: var(--gris); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .5px;
}
.nav a.on { color: var(--bleu); border-bottom-color: var(--bleu); }
html.dark .nav a.on { color: #7fa6e0; border-bottom-color: #7fa6e0; }
.nav a:hover { color: var(--bleu); }

.flash {
  max-width: 900px; margin: 16px auto 0; width: calc(100% - 32px);
  display: flex; align-items: center; gap: 8px;
  border-left: 3px solid var(--vert); background: var(--blanc); color: var(--vert);
  padding: 10px 14px; font-weight: 700; font-size: 14px;
}

.toolbar { max-width: 900px; margin: 18px auto 0; padding: 0 16px; display: flex; align-items: center; gap: 12px; }
.toolbar .back { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 14px; }
.toolbar-right { margin-left: auto; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Champs ---------- */

input, select, textarea {
  font: inherit; color: var(--texte-fort); background: var(--blanc);
  border: 1px solid var(--bord); border-radius: 3px; width: 100%;
}
input, select { height: 44px; padding: 0 12px; }
textarea { min-height: 90px; padding: 10px 12px; resize: vertical; }
input[type=month] { -webkit-appearance: none; appearance: none; text-align: left; line-height: 42px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--bleu); box-shadow: 0 0 0 3px rgba(51, 97, 166, .15); }
.filters select { height: 36px; width: auto; min-width: 190px; font-size: 14px; }

.lbl { display: block; font-size: 12.5px; font-weight: 700; color: var(--texte-fort); margin-bottom: 4px; }
.champ { display: flex; flex-direction: column; }
.champ.large { grid-column: 1 / -1; }
.grille { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.q { margin: 16px 0 6px; font-size: 12.5px; font-weight: 700; color: var(--texte-fort); }
.q:first-child { margin-top: 0; }
.q label { font: inherit; color: inherit; }
#reseau_nom_champ { margin-top: 10px; }

/* ---------- Boutons ---------- */

.btn, .btn-small, .btn-line {
  font: inherit; cursor: pointer; border-radius: 3px; font-weight: 700; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn {
  background: var(--bleu); color: #fff; border: 1px solid var(--bleu);
  height: 46px; padding: 0 30px; font-size: 16px; text-transform: uppercase; letter-spacing: .5px;
}
.btn:hover { background: var(--bleu-fonce); border-color: var(--bleu-fonce); }
.btn-small { background: var(--bleu); color: #fff; border: 1px solid var(--bleu); height: 34px; padding: 0 14px; font-size: 14px; }
.btn-line { background: var(--blanc); color: var(--bleu); border: 1px solid var(--bleu); height: 40px; padding: 0 16px; }
.btn-line:hover { background: var(--bleu-clair); }
.actions-bas { display: flex; justify-content: flex-end; margin-top: 24px; }

/* Gros boutons de choix (profil, tranches, oui/non) */
.types, .chips { position: relative; display: grid; gap: 8px; }
.types { grid-template-columns: 1fr 1fr; }
.chips { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.chips.two { grid-template-columns: 1fr 1fr; }
.chips.n5 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.types input, .chips input { position: absolute; opacity: 0; pointer-events: none; }
.types label, .chips label {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 44px; padding: 6px 8px; border: 1px solid var(--bord); border-radius: 3px;
  background: var(--blanc); color: var(--texte-fort); font-weight: 700; font-size: 14px; line-height: 1.2;
  cursor: pointer; user-select: none; transition: background .15s, border-color .15s;
}
.types label { min-height: 50px; text-wrap: balance; }
.chips label { white-space: nowrap; }
.chips.wrap label { white-space: normal; text-wrap: balance; }
.chips.n5 label { grid-column: span 2; }
.chips.n5 label:nth-of-type(n+4) { grid-column: span 3; }
.types .full { grid-column: 1 / -1; }
.types label:hover, .chips label:hover { border-color: var(--bleu); }
.types input:checked + label, .chips input:checked + label { background: var(--bleu); border-color: var(--bleu); color: #fff; }
.types input:focus-visible + label, .chips input:focus-visible + label { box-shadow: 0 0 0 3px rgba(51, 97, 166, .25); }

.photo {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 18px; border: 1px dashed var(--bleu); border-radius: 3px; background: var(--bleu-clair);
  color: var(--bleu-fonce); font-weight: 700; cursor: pointer;
}
html.dark .photo { color: #7fa6e0; }
.photo span { display: inline-flex; align-items: center; gap: 8px; }
.photo input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.photo img { max-width: 100%; max-height: 220px; }

/* ---------- Pages publiques ---------- */

.narrow { max-width: 900px; margin: 0 auto; padding: 24px 16px 64px; }
.narrow.small { max-width: 520px; }
.logo { display: block; height: 64px; margin: 0 auto 20px; }
.card { background: var(--blanc); border: 1px solid var(--bord); padding: 26px; }
.trap { position: absolute !important; left: -9999px; }

/* Sections à bandeau bleu */
.bloc { border: 1px solid var(--bord); margin-top: 22px; background: var(--blanc); }
.card > .bloc:first-of-type, .errors + .bloc { margin-top: 0; }
.errors + .bloc { margin-top: 18px; }
.bloc > h2, .group-title, .stat h2 {
  margin: 0; background: var(--bleu); color: #fff; font-size: 14px; font-weight: 400;
  text-transform: uppercase; letter-spacing: .5px; padding: 9px 16px;
  display: flex; align-items: baseline; gap: 8px;
}
.bloc > h2 .opt, .group-title .opt { color: rgba(255, 255, 255, .75); }
.bloc > h2 .req { color: #fff; }
.bloc-corps { padding: 16px; }

.errors { background: var(--rouge-clair); border: 1px solid #edbcbc; color: var(--rouge); padding: 10px 14px; margin-bottom: 18px; font-size: 14px; border-radius: 3px; }
.errors p { margin: 2px 0; }

.done { text-align: center; padding: 40px 20px; }
.done h2 { color: var(--vert); margin: 0 0 10px; font-size: 20px; font-weight: 700; }
.done .btn { margin-top: 12px; }

/* ---------- Appli de l'équipe ---------- */

.screen { max-width: 900px; margin: 0 auto; padding: 18px 16px 48px; }
.screen.wide { max-width: 1400px; }
.empty { text-align: center; color: var(--gris); padding: 40px 0; background: var(--blanc); border: 1px solid var(--bord); }

.tile {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--bleu); color: #fff !important; border-radius: 3px;
  font-weight: 700; text-transform: uppercase; letter-spacing: .5px; font-size: 14px;
}
.tile:hover { background: var(--bleu-fonce); }
.tile-ic { display: flex; }
.tile-txt { flex: 1; }

.stats { display: grid; gap: 18px; margin-top: 18px; }
.stat { background: var(--blanc); border: 1px solid var(--bord); padding: 0; }
.stat > .muted { padding: 12px 16px; margin: 0; }
.stat-list { max-height: 300px; overflow-y: auto; padding: 4px 16px; }
.stat-row { position: relative; display: flex; align-items: center; min-height: 40px; color: var(--texte-fort); border-top: 1px solid var(--bord); }
.stat-row:first-child { border-top: 0; }
.stat-bar { position: absolute; left: 0; top: 7px; bottom: 7px; background: var(--bleu-clair); border-radius: 2px; }
.stat-label { position: relative; flex: 1; padding-left: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-num { position: relative; min-width: 36px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; padding-right: 4px; }
.stat-total { margin: 0 16px; border-top: 1px solid var(--bord); color: var(--bleu); font-weight: 700; }

/* Listes en sections */
.group-title { margin-top: 22px; }
.group { display: block; background: var(--blanc); border: 1px solid var(--bord); margin: 0; padding: 0; }
.group-title + .group, .group-title + form.group { border-top: 0; }
.group + .group { margin-top: 18px; }
.group-row {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 46px; padding: 10px 16px; border: 0; border-top: 1px solid var(--bord);
  background: none; text-align: left; font: inherit; color: var(--texte-fort);
}
.group > .group-row:first-child, .group > input + .group-row, .group > input + input + .group-row { border-top: 0; }
button.group-row { cursor: pointer; }
button.group-row:hover { background: var(--survol); }
.group-row.action { color: var(--bleu); font-weight: 700; }
.group-row.danger { color: var(--rouge); justify-content: center; font-weight: 700; }

/* Candidatures : téléphone / tablette */
.item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: var(--texte-fort) !important; border-top: 1px solid var(--bord); }
.item:first-child { border-top: 0; }
.item:hover { background: var(--survol); }
.item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.item-title { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-sub { display: block; font-size: 13.5px; color: var(--gris); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.item-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; color: var(--gris); }
.item-date { font-size: 13px; font-variant-numeric: tabular-nums; }

.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 14px;
}
.avatar.sm { width: 26px; height: 26px; font-size: 10px; }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; }
.avatar.xl { width: 84px; height: 84px; font-size: 30px; }

.pill { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 3px; text-transform: uppercase; letter-spacing: .3px; white-space: nowrap; }
.pill.new { background: var(--bleu-clair); color: var(--bleu-fonce); }
.pill.study { background: #fdf3e1; color: var(--orange); }
.pill.ok { background: #e6f4ec; color: var(--vert); }
.pill.ko { background: var(--rouge-clair); color: var(--rouge); }
html.dark .pill.new { color: #7fa6e0; }
html.dark .pill.study { background: rgba(185, 119, 14, .2); color: #f0b45a; }
html.dark .pill.ok { background: rgba(30, 132, 73, .2); color: #58d68d; }

.star { width: 14px; height: 14px; fill: var(--bord); }
.star.on { fill: var(--star); }
.stars-mini { display: inline-flex; gap: 1px; }

/* Candidatures : PC */
.table-pc { display: none; }
.table-pc table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table-pc th {
  background: var(--bleu); color: #fff; text-align: left; font-weight: 400; font-size: 12.5px;
  text-transform: uppercase; letter-spacing: .5px; padding: 10px 12px; white-space: nowrap;
}
.table-pc td { padding: 10px 12px; border-top: 1px solid var(--bord); white-space: nowrap; vertical-align: middle; color: var(--texte-fort); }
.table-pc tbody tr { cursor: pointer; }
.table-pc tbody tr:hover { background: var(--survol); }
.table-pc .c-date { font-variant-numeric: tabular-nums; }
.table-pc td.c-date { color: var(--gris); }
.table-pc .c-stars { text-align: right; }
.table-pc .strong { color: var(--texte-fort); font-weight: 700; }
.cell-av { display: inline-flex; align-items: center; gap: 8px; }

/* Fiche */
.contact-head { display: flex; align-items: center; gap: 16px; background: var(--blanc); border: 1px solid var(--bord); padding: 18px 16px; }
.contact-head h1 { font-size: 22px; font-weight: 700; color: var(--texte-fort); margin: 0 0 2px; }
.contact-head p { margin: 0; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.quick a {
  display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px;
  background: var(--blanc); border: 1px solid var(--bleu); border-radius: 3px;
  font-weight: 700; text-transform: uppercase; letter-spacing: .5px; font-size: 13px;
}
.quick a:hover { background: var(--bleu-clair); }

.segmented { display: flex; width: 100%; border: 1px solid var(--bleu); border-radius: 3px; overflow: hidden; }
.segmented button {
  flex: 1; height: 38px; border: 0; border-left: 1px solid var(--bleu); background: var(--blanc);
  font: inherit; font-size: 13px; font-weight: 700; color: var(--bleu); cursor: pointer; padding: 0 4px;
}
.segmented button:first-child { border-left: 0; }
.segmented button.on { background: var(--bleu); color: #fff; }
html.dark .segmented button:not(.on) { color: #7fa6e0; }

.stars-row { justify-content: space-between; }
.stars-pick { display: inline-flex; }
.stars-pick button { border: 0; background: none; padding: 2px 3px; cursor: pointer; }
.stars-pick .star { width: 26px; height: 26px; }

.info { align-items: flex-start; }
.info-label { flex: 0 0 170px; font-size: 12.5px; font-weight: 700; color: var(--texte-fort); padding-top: 2px; }
.info-value { flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--texte); }

.badge-photo { display: block; padding: 12px; }
.badge-photo img { display: block; width: 100%; max-height: 420px; object-fit: contain; }

.note-add { align-items: flex-end; }
.note-add textarea { min-height: 44px; }
.note { flex-direction: column; align-items: flex-start; gap: 2px; }
.note p { margin: 0; color: var(--texte-fort); }
.note .muted { font-size: 12.5px; }
.danger-zone { margin-top: 26px; }

/* Adhérents les plus proches */
.carte { height: 260px; border-bottom: 1px solid var(--bord); z-index: 0; }
.proches .carte + .group-row { border-top: 0; }
.proche .num {
  flex: none; width: 24px; height: 24px; border-radius: 3px; background: var(--bleu); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}
.trajet { display: flex; flex-direction: column; align-items: flex-end; flex: none; text-align: right; font-variant-numeric: tabular-nums; }
.trajet-km { font-weight: 700; color: var(--texte-fort); }
.trajet-temps { font-size: 13px; color: var(--gris); }
.pin {
  display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 3px;
  color: #fff; font: 700 12px/1 -apple-system, "Segoe UI", sans-serif; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}
.pin.mag { background: var(--bleu); }
.pin.cand { background: var(--rouge); border-radius: 50%; font-size: 13px; }

/* Compte */
.me .item-title { font-size: 17px; }
.group-row input { height: 40px; }
.icon-btn { border: 0; background: none; padding: 6px; color: var(--gris); cursor: pointer; }
.icon-btn.danger { color: var(--rouge); }
.toggle-row { justify-content: space-between; cursor: pointer; font-weight: 700; font-size: 14px; }
.toggle {
  -webkit-appearance: none; appearance: none; width: 46px !important; height: 26px !important; padding: 0;
  border-radius: 13px; border: 1px solid var(--bord); background: var(--fond); position: relative; cursor: pointer; flex: none;
}
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.toggle:checked { background: var(--bleu); border-color: var(--bleu); }
.toggle:checked::after { transform: translateX(20px); }
.logout { margin-top: 26px; }

/* ---------- Tablette et plus ---------- */

@media (min-width: 768px) {
  .logo { height: 100px; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
  .cols { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 22px; align-items: start; }
  .quick { max-width: 420px; }
}

/* ---------- PC : tableau ---------- */

@media (min-width: 1024px) {
  .list-touch { display: none; }
  .table-pc { display: block; overflow-x: auto; border: 1px solid var(--bord); background: var(--blanc); }
  .toolbar:has(+ .screen.wide) { max-width: 1400px; }
}

/* ---------- Téléphone ---------- */

@media (max-width: 640px) {
  .banner h1 { font-size: 19px; }
  .grille { grid-template-columns: 1fr; }
  .card { padding: 16px 12px; }
  .narrow { padding: 16px 12px 48px; }
  .nav a { font-size: 12px; gap: 6px; }
  .contact-head { flex-direction: column; text-align: center; }
  .info-label { flex-basis: 120px; }
  .actions-bas .btn { width: 100%; }
}
