/* =========================================================================
   DUO — feuille de style
   ========================================================================= */

:root {
  --bg: #fbf7f8;
  --bg-alt: #f4edf0;
  --surface: #ffffff;
  --surface-2: #f8f2f4;
  --surface-3: #f0e6ea;
  --ink: #241318;
  --ink-2: #4d3b42;
  --muted: #7b6a71;
  --line: #ece0e4;
  --line-2: #dccbd1;

  --brand: #c2255c;
  --brand-hover: #a81c4e;
  --brand-ink: #ffffff;
  --brand-soft: #fdeaf1;
  --brand-ring: rgba(194, 37, 92, .18);

  --ok: #0c8f66;
  --ok-soft: #e2f5ee;
  --warn: #b26a06;
  --warn-soft: #fdf1de;
  --bad: #c62f3f;
  --bad-soft: #fdecee;
  --cool: #2f5fd0;
  --cool-soft: #e9f0fe;

  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 30px;

  --sh-1: 0 1px 2px rgba(36, 19, 24, .06), 0 4px 12px rgba(36, 19, 24, .05);
  --sh-2: 0 2px 6px rgba(36, 19, 24, .07), 0 16px 36px rgba(36, 19, 24, .09);
  --sh-3: 0 30px 70px rgba(36, 19, 24, .2);

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Bricolage Grotesque', 'Plus Jakarta Sans', var(--font);
  --shell: 1180px;
  --header-h: 68px;
}

[data-theme='dark'] {
  --bg: #140d11;
  --bg-alt: #1b1218;
  --surface: #20161b;
  --surface-2: #2a1d24;
  --surface-3: #35242d;
  --ink: #f8eef1;
  --ink-2: #dcc8cf;
  --muted: #9d8891;
  --line: #33232b;
  --line-2: #452f39;

  --brand: #ff7aa8;
  --brand-hover: #ff9abf;
  --brand-ink: #240a13;
  --brand-soft: #3a1524;
  --brand-ring: rgba(255, 122, 168, .25);

  --ok: #46d6a8;
  --ok-soft: #12332a;
  --warn: #efb45f;
  --warn-soft: #36260f;
  --bad: #ff8090;
  --bad-soft: #3a1418;
  --cool: #7fa2ff;
  --cool-soft: #17233f;

  --sh-1: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .24);
  --sh-2: 0 2px 8px rgba(0, 0, 0, .36), 0 18px 44px rgba(0, 0, 0, .38);
  --sh-3: 0 30px 80px rgba(0, 0, 0, .6);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  color: var(--ink);
  line-height: 1.14;
  letter-spacing: -.022em;
  margin: 0 0 .5em;
  font-weight: 800;
}
h1 { font-size: clamp(2rem, 1.3rem + 2.7vw, 3.3rem); }
h2 { font-size: clamp(1.5rem, 1.15rem + 1.4vw, 2.2rem); }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1rem; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
table { border-collapse: collapse; width: 100%; }

::selection { background: var(--brand); color: var(--brand-ink); }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 60;
  background: var(--brand); color: var(--brand-ink); padding: 10px 16px;
  border-radius: var(--r-sm); transition: top .18s ease;
}
.skip-link:focus { top: 12px; }

.shell { width: min(100% - 40px, var(--shell)); margin-inline: auto; }

/* ------------------------------------------------------------- BUTTONS -- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: .95rem; cursor: pointer; white-space: nowrap;
  transition: transform .12s ease, background .18s ease, border-color .18s ease, color .18s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--brand); color: var(--brand-ink); }
.btn--primary:hover { background: var(--brand-hover); }
.btn--ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn--sm { padding: 7px 14px; font-size: .84rem; }
.btn--block { width: 100%; }

.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer;
  background: transparent; border: 1px solid var(--line); border-radius: 50%; color: var(--ink);
}
.icon-btn:hover { border-color: var(--brand); color: var(--brand); }
.icon-sun { display: none; }
[data-theme='dark'] .icon-sun { display: block; }
[data-theme='dark'] .icon-moon { display: none; }

/* -------------------------------------------------------------- HEADER -- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 20px; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display);
  font-weight: 800; font-size: 1.15rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand__mark { color: var(--brand); display: grid; place-items: center; }
.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: 4px; align-items: center; }
.site-nav a {
  display: block; padding: 8px 12px; border-radius: 999px;
  color: var(--ink-2); font-size: .92rem; font-weight: 500;
}
.site-nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--brand); }
.site-nav a[aria-current='page'] { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 10px; }

/* --------------------------------------------------------------- HERO -- */
.hero { padding: 56px 0 40px; position: relative; overflow: hidden; }
.hero__inner { position: relative; z-index: 1; max-width: 720px; }
.eyebrow {
  display: inline-block; font-size: .76rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--brand); background: var(--brand-soft);
  padding: 5px 12px; border-radius: 999px; margin-bottom: 18px;
}
.hero__lead { font-size: 1.08rem; max-width: 62ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 26px; }
.hero__facts { display: flex; flex-wrap: wrap; gap: 26px; }
.hero__facts strong { display: block; font-family: var(--display); font-size: 1.5rem; color: var(--ink); }
.hero__facts span { font-size: .86rem; color: var(--muted); }
.hero__glow {
  position: absolute; inset: -40% -10% auto auto; width: 520px; height: 520px;
  background: radial-gradient(circle, var(--brand-ring), transparent 65%);
  pointer-events: none; z-index: 0;
}

/* ------------------------------------------------------------ SECTION -- */
.section { padding: 42px 0; }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section-head { max-width: 62ch; margin-bottom: 26px; }
.section-head p { color: var(--muted); }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 22px;
}
.card--pad-lg { padding: 28px; }
.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.stack { display: grid; gap: 14px; }

.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-bottom: 20px;
}
.field { display: grid; gap: 6px; }
.field > span { font-size: .78rem; font-weight: 600; color: var(--muted); text-transform: uppercase;
  letter-spacing: .06em; }
.input, .select, .textarea {
  width: 100%; padding: 10px 13px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring);
}
.textarea { min-height: 90px; resize: vertical; }
.search { flex: 1 1 220px; }

/* -------------------------------------------------------------- IMPORT -- */
.dropzone {
  border: 2px dashed var(--line-2); border-radius: var(--r-lg);
  padding: 34px 22px; text-align: center; background: var(--surface-2);
  transition: border-color .18s ease, background .18s ease;
}
.dropzone.is-over { border-color: var(--brand); background: var(--brand-soft); }
.dropzone h3 { margin-bottom: 6px; }
.dropzone p { color: var(--muted); font-size: .92rem; }
.dropzone input[type='file'] { display: none; }

.colonnes { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.colonne {
  display: flex; align-items: center; gap: 8px; font-size: .86rem;
  padding: 8px 12px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--surface);
}
.colonne[data-ok='1'] { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); color: var(--ink); }
.colonne[data-ok='0'] { border-color: color-mix(in srgb, var(--warn) 45%, var(--line));
  background: var(--warn-soft); color: var(--warn); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
table.apercu { font-size: .88rem; }
table.apercu th, table.apercu td {
  padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.apercu th { background: var(--surface-2); color: var(--muted); font-size: .76rem;
  text-transform: uppercase; letter-spacing: .05em; }
table.apercu tr:last-child td { border-bottom: 0; }

.note {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px;
  border-radius: var(--r); font-size: .9rem; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink-2);
}
.note--ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); color: var(--ok); }
.note--warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); color: var(--warn); }
.note--bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, transparent); color: var(--bad); }

/* -------------------------------------------------------------- PROFIL -- */
.profil {
  display: grid; gap: 14px; padding: 18px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1);
  grid-template-columns: auto 1fr; align-items: start;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.profil:hover { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: var(--line-2); }
.avatar {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--display); font-weight: 800; font-size: 1.1rem; color: var(--brand-ink);
  background: linear-gradient(135deg, var(--brand), var(--brand-hover)); flex: none;
}
.avatar--lg { width: 74px; height: 74px; font-size: 1.5rem; }
.avatar--sm { width: 36px; height: 36px; font-size: .85rem; }
/* Photo de profil : elle remplit le rond, les initiales restent le repli. */
img.avatar { object-fit: cover; background: var(--surface-3); }
.apercu td .avatar { vertical-align: middle; }
.ligne-profil { display: flex; align-items: center; gap: 10px; }
.photo-champ { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.photo-champ .input { flex: 1 1 220px; }
.photo-champ label.btn { cursor: pointer; }
.profil__nom { font-weight: 700; color: var(--ink); font-size: 1.05rem; }
.profil__meta { font-size: .86rem; color: var(--muted); }
.profil__passions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 600;
  padding: 3px 10px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2);
}
.badge--brand { background: var(--brand-soft); color: var(--brand); }
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--cool { background: var(--cool-soft); color: var(--cool); }
.badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--bad { background: var(--bad-soft); color: var(--bad); }

.profil-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }

/* --------------------------------------------------------------- SCORE -- */
.score {
  --v: 0;
  width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--brand) calc(var(--v) * 1%), var(--surface-3) 0);
  position: relative;
}
.score::before {
  content: ''; position: absolute; inset: 5px; border-radius: 50%; background: var(--surface);
}
.score b { position: relative; font-family: var(--display); font-size: 1.02rem; color: var(--ink); }
.score--fort { background: conic-gradient(var(--ok) calc(var(--v) * 1%), var(--surface-3) 0); }
.score--moyen { background: conic-gradient(var(--warn) calc(var(--v) * 1%), var(--surface-3) 0); }
.score--faible { background: conic-gradient(var(--bad) calc(var(--v) * 1%), var(--surface-3) 0); }

.match {
  display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center;
  padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--sh-1);
}
.match__corps { display: grid; gap: 6px; min-width: 0; }
.match__raisons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.match-compact {
  display: grid; grid-template-columns: auto auto 1fr auto; gap: 12px; align-items: center;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface-2); margin-bottom: 8px;
}
.match__deux {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center;
}
.match__deux > span { color: var(--brand); font-weight: 700; }
.match .profil-actions { margin-top: 4px; }

.barres { display: grid; gap: 8px; margin-top: 12px; }
.barre { display: grid; grid-template-columns: 130px 1fr 44px; gap: 10px; align-items: center;
  font-size: .84rem; }
.barre__track { height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.barre__fill { height: 100%; border-radius: 999px; background: var(--brand); }
.barre__val { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- COUPLES -- */
.couple-card {
  display: grid; gap: 12px; padding: 18px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1);
  cursor: pointer; transition: transform .15s ease, box-shadow .15s ease;
}
.couple-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.couple-card.is-active { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.couple-card__top { display: flex; align-items: center; gap: 10px; }
.avatars { display: flex; }
.avatars .avatar + .avatar { margin-left: -14px; border: 2px solid var(--surface); }

.chat-layout { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 20px; align-items: start; }
.chat {
  display: grid; grid-template-rows: auto 1fr auto; height: min(72vh, 640px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--sh-1);
}
.chat__head { display: flex; align-items: center; gap: 12px; padding: 14px 18px;
  border-bottom: 1px solid var(--line); }
.chat__fil { display: grid; gap: 10px; padding: 18px; overflow-y: auto; }
.chat__vide { color: var(--muted); text-align: center; padding: 30px 10px; }
.bulle {
  max-width: 78%; padding: 10px 14px; border-radius: 16px; font-size: .93rem;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2);
}
.bulle + .bulle { margin-top: 8px; }
.bulle--moi { margin-left: auto; background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 30%, transparent); color: var(--ink); }
.bulle--amorce { background: var(--cool-soft); border-color: color-mix(in srgb, var(--cool) 30%, transparent);
  font-style: italic; color: var(--ink); max-width: 100%; }
.bulle__meta { font-size: .72rem; color: var(--muted); margin-top: 4px; }
.chat__form { display: flex; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line);
  background: var(--surface-2); }
.chat__form .input { flex: 1; }

.switch { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px;
  background: var(--surface-3); }
.switch button { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px;
  cursor: pointer; font-size: .84rem; font-weight: 600; color: var(--muted); }
.switch button[aria-pressed='true'] { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }

.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat { padding: 16px 18px; border-radius: var(--r); background: var(--surface);
  border: 1px solid var(--line); }
.stat b { display: block; font-family: var(--display); font-size: 1.8rem; color: var(--ink);
  line-height: 1.1; }
.stat span { font-size: .82rem; color: var(--muted); }

.bar-list { display: grid; gap: 9px; }
.bar-list__row { display: grid; grid-template-columns: minmax(90px, 160px) 1fr 34px; gap: 10px;
  align-items: center; font-size: .88rem; }
.bar-list__track { height: 9px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar-list__fill { height: 100%; background: var(--brand); border-radius: 999px; }
.bar-list__val { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar-list__nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }

.modal { position: fixed; inset: 0; z-index: 50; display: none; place-items: center;
  background: rgba(20, 10, 14, .5); padding: 20px; }
.modal.is-open { display: grid; }
.modal__box { background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--sh-3);
  width: min(560px, 100%); max-height: 86vh; overflow-y: auto; padding: 26px; }

.empty { text-align: center; padding: 44px 20px; color: var(--muted);
  border: 1px dashed var(--line-2); border-radius: var(--r-lg); }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  z-index: 60; padding: 12px 20px; border-radius: 999px; background: var(--ink);
  color: var(--bg); font-size: .9rem; font-weight: 600; box-shadow: var(--sh-2);
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

.site-footer { padding: 34px 0; border-top: 1px solid var(--line); color: var(--muted);
  font-size: .88rem; }
.site-footer .shell { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }

@media (max-width: 860px) {
  .site-nav { display: none; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat { height: 60vh; }
  .hero { padding: 34px 0 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
