/* Direction B « bento en verre » — socle : police, jetons, verre, controles, boutons, pastilles.
   Aucune ressource externe (CSP) : Inter est auto-hebergee dans web/fonts/ (licence SIL OFL). */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/Inter-latin-wght.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  --bg: #0b0c0f; --text: #f2f4f7; --muted: #9aa3ae; --line: rgba(255,255,255,.09);
  --halo-1: #262a33; --halo-2: #171a21;
  /* Couleurs semantiques */
  --action: #1662e8; --call: #ff9f0a; --ok: #30d158; --rose: #ff375f; --blue: #0a84ff;
  --danger: #d9264f; --stop: #ff453a; --link: #7fb0ff;
  /* Accent de marque (best-events = rouge, we-event = or, riviera = bleu) */
  --accent: #e5484d; --gold: #d4a24e;
  --accent-brand: var(--accent);
  --ring: rgba(229,72,77,.4); --glow: rgba(229,72,77,.28);
  --tint-40: rgba(229,72,77,.45); --tint-12: rgba(229,72,77,.14);
  --field: rgba(255,255,255,.06);
  --radius: 14px; --radius-tile: 26px; --radius-pill: 999px;
  --ease-out: cubic-bezier(.16,1,.3,1);
  --target: 44px;
}
body.brand-we-event {
  --accent-brand: var(--gold); --ring: rgba(212,162,78,.45); --glow: rgba(212,162,78,.3);
  --tint-40: rgba(212,162,78,.45); --tint-12: rgba(212,162,78,.14);
}
body.brand-riviera {
  --accent-brand: #4c8dff; --ring: rgba(76,141,255,.45); --glow: rgba(76,141,255,.3);
  --tint-40: rgba(76,141,255,.45); --tint-12: rgba(76,141,255,.14);
}

* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
body {
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 600px at 18% -10%, var(--halo-1), transparent 70%),
    radial-gradient(900px 600px at 100% 110%, var(--halo-2), transparent 70%);
  background-attachment: fixed;
  color: var(--text); height: 100vh; overflow: hidden;
  font-family: Inter, "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.view { height: 100vh; }
.error { color: var(--rose); font-size: 13px; min-height: 18px; }
.muted { color: var(--muted); }
.mt-8 { margin-top: 8px; }
.mt-14 { margin-top: 14px; }

/* Focus clavier : contour franc, visible sur le verre comme sur le noir */
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--link); outline-offset: 2px;
}

/* Verre : meme recette pour toutes les tuiles */
.login-card, .sidebar, .conv-row, .card, .stat, .verdict-card, .table-wrap, .island, .stat-tile,
.tuile {
  background: linear-gradient(160deg, rgba(255,255,255,.075), rgba(255,255,255,.02) 55%);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 24px 48px rgba(0,0,0,.38);
  -webkit-backdrop-filter: blur(22px) saturate(140%); backdrop-filter: blur(22px) saturate(140%);
}

/* Champs */
input, select, textarea {
  background: var(--field); border: 1px solid var(--line); border-radius: var(--radius);
  min-height: var(--target); padding: 0 14px; font-size: 14px;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus { border-color: var(--accent-brand); }
select option { background: #16181d; color: var(--text); }
textarea { padding: 12px 14px; }

/* Boutons */
.btn, .login-card button, .chat button[type=submit] {
  background: var(--action); color: #fff; border: 0; border-radius: var(--radius-pill);
  min-height: var(--target); padding: 0 20px; font-weight: 600; font-size: 14px;
  transition: transform .15s var(--ease-out), filter .15s ease-out;
}
.btn:hover:not(:disabled), .login-card button:hover:not(:disabled),
.chat button[type=submit]:hover:not(:disabled) { filter: brightness(1.12); transform: translateY(-1px); }
.btn:active:not(:disabled), .login-card button:active:not(:disabled) { transform: scale(.98); }
.btn.danger { background: var(--danger); }
.btn.ghost {
  background: rgba(255,255,255,.06); border: 1px solid var(--line); color: var(--text);
}
/* Inactif mais lisible : fond neutre, texte clair sur fond sombre (contraste > 3:1), cadre discret. */
.btn:disabled, .chat button:disabled, #attachBtn:disabled, .login-card button:disabled {
  opacity: 1; background: rgba(255,255,255,.09); color: #b4bcc7; filter: none; transform: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); cursor: not-allowed;
}
.back {
  background: none; border: 0; color: var(--link); font-size: 14px; font-weight: 500;
  min-height: var(--target); padding: 0 6px 0 0; margin-bottom: 4px;
}
.back:hover { color: var(--text); }

/* Pastilles */
.badge {
  padding: 5px 12px 5px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600;
  justify-self: start; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
}
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.badge.satisfait { background: rgba(48,209,88,.15); color: var(--ok); }
.badge.interesse { background: rgba(10,132,255,.17); color: #5eb0ff; }
.badge.hesitant { background: rgba(255,159,10,.16); color: var(--call); }
.badge.froid { background: rgba(154,163,174,.16); color: #b6bec8; }
.badge.status { background: rgba(255,255,255,.07); color: var(--muted); }
.badge.status::before { display: none; }
.badge.error { background: rgba(255,55,95,.16); color: var(--rose); }

/* Animation d'entree : transform + opacity seulement, et rien ne reste cache */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes growX { from { transform: scaleX(.05); } to { transform: none; } }
@keyframes growY { from { transform: scaleY(.05); } to { transform: none; } }
#content.entree > * { animation: rise .25s var(--ease-out); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
