/* ══════════════════════════════════════════════════════════════
   Décroche Toujours — Espace client (V2)
   Design premium 2026 · light · mobile-first · Inter
   ══════════════════════════════════════════════════════════════ */
:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --ink: #0e1526;
  --ink-2: #2b3446;
  --muted: #64707f;
  --line: #e6eaef;
  --brand: #0d7a6c;
  --brand-deep: #0a5f55;
  --brand-soft: #e2f2ef;
  --brand-glow: rgba(13, 122, 108, 0.14);
  --urgent: #d92d20;
  --urgent-deep: #b42318;
  --urgent-soft: #fdecea;
  --ok: #12805c;
  --ok-soft: #e3f4ec;
  --warn-soft: #f6f7f9;
  --radius: 18px;
  --radius-s: 12px;
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.05), 0 10px 28px -12px rgba(16, 24, 40, 0.14);
  --shadow-pop: 0 2px 4px rgba(16, 24, 40, 0.06), 0 18px 44px -12px rgba(16, 24, 40, 0.22);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--urgent); font-size: 0.9rem; margin: 10px 0 0; font-weight: 500; }
.success { color: var(--ok); font-size: 0.9rem; margin: 10px 0 0; font-weight: 500; }
a { color: var(--brand); }
h1, h2 { letter-spacing: -0.02em; }
h1 { font-size: 1.55rem; font-weight: 800; margin: 0 0 4px; }
h2 { font-size: 1.02rem; font-weight: 700; margin: 0 0 14px; }

.screen { min-height: 100vh; min-height: 100dvh; }
.container { max-width: 760px; margin: 0 auto; padding: 20px 16px 72px; }

/* ── Cartes ─────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  animation: rise 0.45s var(--ease) both;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ── Logo ───────────────────────────────────────────────────── */
.logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 15px; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff; box-shadow: 0 8px 20px -6px var(--brand-glow), 0 8px 20px -6px rgba(13,122,108,.45);
}
.logo-mark.small { width: 38px; height: 38px; border-radius: 12px; }
.logo-word { font-weight: 800; font-size: 1.12rem; letter-spacing: -0.02em; }
.logo-word.small { font-size: 0.95rem; }

/* ── Login ──────────────────────────────────────────────────── */
#login-screen, #recovery-request-screen, #new-password-screen {
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(560px 340px at 15% 8%, rgba(13,122,108,.10), transparent 70%),
    radial-gradient(640px 420px at 90% 95%, rgba(13,122,108,.08), transparent 70%),
    var(--bg);
}
.login-wrap { width: 100%; max-width: 420px; animation: rise 0.5s var(--ease) both; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-card { padding: 28px 26px; }
.login-card h1 { font-size: 1.45rem; }
.login-card > .muted { margin: 2px 0 6px; font-size: 0.95rem; }
.login-foot { text-align: center; font-size: 0.85rem; margin-top: 18px; line-height: 1.6; }
.forgot-row { text-align: right; margin: -8px 0 2px; }

/* ── Connexion sociale ──────────────────────────────────────── */
.oauth-sep {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0 4px; color: var(--muted); font-size: 0.85rem;
}
.oauth-sep::before, .oauth-sep::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}
.oauth-btns { display: grid; gap: 10px; margin-top: 12px; }
.btn-oauth {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 13px; border: 1px solid var(--line); border-radius: var(--radius-s);
  background: #fff; cursor: pointer; font-family: inherit;
  font-size: 0.95rem; font-weight: 600; color: var(--ink);
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s, transform 0.15s var(--ease);
}
.btn-oauth:hover { border-color: #b9c4d2; box-shadow: 0 4px 14px -6px rgba(20,30,45,.18); background: #fbfcfe; }
.btn-oauth:active { transform: scale(0.98); }
.btn-oauth svg { flex: none; }
.link-inline {
  background: none; border: 0; cursor: pointer; padding: 4px 0;
  color: var(--brand); font-size: 0.87rem; font-weight: 600; font-family: inherit;
}
.link-inline:hover { color: var(--brand-deep); text-decoration: underline; }

.field { display: block; margin: 16px 0; }
.field > span { display: block; font-size: 0.86rem; font-weight: 600; margin-bottom: 7px; color: var(--ink-2); }
.field input {
  display: block; width: 100%; padding: 13px 14px;
  border: 1.5px solid var(--line); border-radius: var(--radius-s);
  font-size: 1rem; font-family: inherit; color: var(--ink);
  background: var(--surface-2); outline: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.field input:focus {
  border-color: var(--brand); background: #fff;
  box-shadow: 0 0 0 4px var(--brand-glow);
}
.field input::placeholder { color: #a7b0bc; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 46px; }
.password-wrap .icon-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }

/* ── Boutons ────────────────────────────────────────────────── */
.btn-primary {
  position: relative; width: 100%; margin-top: 10px; padding: 14px;
  border: 0; border-radius: var(--radius-s); cursor: pointer;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff; font-size: 1rem; font-weight: 700; font-family: inherit;
  letter-spacing: -0.01em;
  box-shadow: 0 10px 22px -8px rgba(13,122,108,.55);
  transition: transform 0.15s var(--ease), box-shadow 0.2s, filter 0.2s;
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.75; cursor: wait; }
.btn-primary.loading .btn-label { visibility: hidden; }
.btn-primary.loading::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 20px; height: 20px; margin: -10px 0 0 -10px;
  border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  background: transparent; border: 1px solid transparent; cursor: pointer;
  color: var(--muted); transition: all 0.16s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.icon-btn.small { width: 30px; height: 30px; border-radius: 9px; }
.icon-btn.copied { color: var(--ok); border-color: var(--ok-soft); background: var(--ok-soft); }

.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 0; cursor: pointer; padding: 8px 4px; margin-bottom: 14px;
  color: var(--muted); font-size: 0.94rem; font-weight: 600; font-family: inherit;
  transition: color 0.16s;
}
.back-btn:hover { color: var(--brand-deep); }

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 16px; background: rgba(255,255,255,.86);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar-brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.topbar-company {
  font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 46vw;
}

/* ── Liste : tête, stats, filtres ───────────────────────────── */
.page-head { margin: 6px 0 16px; }
.page-head .muted { margin: 0; font-size: 0.95rem; }

.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 14px 12px; box-shadow: var(--shadow-card); text-align: center;
  animation: rise 0.45s var(--ease) both;
}
.stat-card:nth-child(2) { animation-delay: 0.06s; }
.stat-card:nth-child(3) { animation-delay: 0.12s; }
.stat-value { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.stat-label { font-size: 0.74rem; color: var(--muted); font-weight: 500; margin-top: 2px; }
.stat-alert .stat-value { color: var(--urgent); }

.chips { display: flex; gap: 8px; margin-bottom: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 0.88rem; font-weight: 600; font-family: inherit; color: var(--muted);
  transition: all 0.18s var(--ease);
}
.chip:hover { border-color: var(--brand); color: var(--brand-deep); }
.chip.active {
  background: var(--ink); border-color: var(--ink); color: #fff;
  box-shadow: 0 6px 16px -6px rgba(14,21,38,.4);
}
.dot-urgent { width: 8px; height: 8px; border-radius: 50%; background: var(--urgent); flex: none; }

/* ── Lignes d'appel ─────────────────────────────────────────── */
.call-row {
  display: flex; align-items: center; gap: 13px; width: 100%;
  text-align: left; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 14px; margin-bottom: 10px; cursor: pointer;
  font-size: 1rem; font-family: inherit; color: var(--ink);
  box-shadow: var(--shadow-card);
  transition: transform 0.16s var(--ease), box-shadow 0.2s, border-color 0.18s;
  animation: rise 0.4s var(--ease) both;
  position: relative; overflow: hidden;
}
.call-row:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); border-color: #cfd6de; }
.call-row:active { transform: translateY(0) scale(0.995); }
.call-row.is-urgent { border-color: #f3c1bc; }
.call-row.is-urgent::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--urgent), var(--urgent-deep));
}
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(135deg, #dbe7e4, #c3d8d3); color: var(--brand-deep);
  font-weight: 800; font-size: 1.1rem;
}
.avatar-urgent { background: linear-gradient(135deg, #fbd9d4, #f5b8b0); color: var(--urgent-deep); }
.call-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.call-title { font-weight: 700; font-size: 0.99rem; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.call-sub {
  color: var(--muted); font-size: 0.86rem; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.call-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.call-date { font-size: 0.8rem; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.call-dur { font-size: 0.76rem; white-space: nowrap; }
.chev { color: #b6bec9; flex: none; transition: transform 0.18s var(--ease); }
.call-row:hover .chev { transform: translateX(3px); color: var(--brand); }

.badge-urgent {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--urgent); color: #fff;
  font-size: 0.66rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  border-radius: 999px; padding: 4px 10px;
  box-shadow: 0 4px 10px -3px rgba(217,45,32,.55);
  animation: badgePulse 2.4s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { box-shadow: 0 4px 10px -3px rgba(217,45,32,.55); }
  50% { box-shadow: 0 4px 16px -2px rgba(217,45,32,.8); }
}

/* ── État vide / erreur ─────────────────────────────────────── */
.empty {
  text-align: center; padding: 56px 24px;
  background: var(--surface); border: 1px dashed #d3d9e1; border-radius: var(--radius);
}
.empty-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 84px; height: 84px; border-radius: 28px; margin-bottom: 16px;
  background: var(--brand-soft); color: var(--brand-deep);
}
.empty h2 { font-size: 1.1rem; margin: 0 0 8px; }
.empty p { margin: 0; font-size: 0.92rem; }
.error-box {
  background: var(--urgent-soft); border: 1px solid #f3c1bc; color: var(--urgent-deep);
  border-radius: var(--radius-s); padding: 16px; font-size: 0.92rem; font-weight: 500;
}

/* ── Skeletons ──────────────────────────────────────────────── */
.skeleton-row, .skeleton-line {
  position: relative; overflow: hidden; background: #e9edf1; border-radius: 10px;
}
.skeleton-row {
  display: flex; align-items: center; gap: 13px; padding: 15px 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 10px;
}
.skeleton-avatar { width: 46px; height: 46px; border-radius: 50%; background: #e9edf1; flex: none; }
.skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.skeleton-lines div { height: 12px; border-radius: 6px; background: #e9edf1; }
.skeleton-lines div:last-child { width: 62%; }
.skeleton-line { height: 14px; margin: 10px 0; }
.skeleton-line.w40 { width: 40%; } .skeleton-line.w60 { width: 60%; } .skeleton-line.w80 { width: 80%; }
.skeleton-row::after, .skeleton-lines div::after, .skeleton-line::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.75), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ── Détail ─────────────────────────────────────────────────── */
.detail-head { margin: 2px 0 16px; }
.detail-head h1 { font-size: 1.3rem; }
.detail-sub { font-size: 0.9rem; margin-top: 4px; }
.urgent-banner {
  display: flex; align-items: center; gap: 10px; margin-top: 12px;
  background: linear-gradient(135deg, var(--urgent), var(--urgent-deep));
  color: #fff; font-weight: 700; font-size: 0.92rem;
  border-radius: var(--radius-s); padding: 12px 16px;
  box-shadow: 0 10px 24px -8px rgba(217,45,32,.55);
  animation: rise 0.45s var(--ease) both;
}
.pulse { width: 10px; height: 10px; border-radius: 50%; background: #fff; flex: none; animation: pulse 1.6s infinite; }
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.55; }
}

/* Fiche lead */
.lead-row {
  display: grid; grid-template-columns: 34px 128px 1fr; align-items: start;
  gap: 4px 8px; padding: 11px 0; border-bottom: 1px solid var(--line);
}
.lead-row:last-of-type { border-bottom: 0; }
.lead-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--brand-soft); color: var(--brand-deep);
}
.lead-label { color: var(--muted); font-size: 0.85rem; padding-top: 5px; }
.lead-value { font-weight: 600; font-size: 0.96rem; padding-top: 3px; overflow-wrap: anywhere; }
.lead-value-inline { display: inline-flex; align-items: center; gap: 6px; }
.tel-link { color: var(--brand-deep); font-weight: 700; text-decoration: none; border-bottom: 1.5px solid var(--brand-soft); }
.tel-link:hover { border-bottom-color: var(--brand); }

.btn-call {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 16px; padding: 14px; border-radius: var(--radius-s);
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff; font-weight: 700; font-size: 1rem; text-decoration: none;
  box-shadow: 0 10px 22px -8px rgba(13,122,108,.55);
  transition: transform 0.15s var(--ease), filter 0.2s;
}
.btn-call:hover { filter: brightness(1.06); }
.btn-call:active { transform: scale(0.98); }

/* Pills sentiment */
.pill {
  display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; border-radius: 999px; padding: 5px 12px; flex: none;
}
.pill-positive { background: var(--ok-soft); color: var(--ok); }
.pill-neutral { background: var(--warn-soft); color: var(--muted); border: 1px solid var(--line); }
.pill-negative { background: var(--urgent-soft); color: var(--urgent-deep); }
.summary-text { margin: 0; font-size: 0.97rem; line-height: 1.65; color: var(--ink-2); }

/* ── Lecteur audio ──────────────────────────────────────────── */
.player {
  display: flex; align-items: center; gap: 12px;
  background: var(--ink); border-radius: var(--radius-s); padding: 12px 14px;
  color: #fff; box-shadow: var(--shadow-card);
}
.player-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  border: 0; color: #fff;
  box-shadow: 0 6px 16px -4px rgba(13,122,108,.6);
  transition: transform 0.15s var(--ease);
}
.player-btn:hover { transform: scale(1.06); }
.player-btn:active { transform: scale(0.96); }
.player-track {
  position: relative; flex: 1; height: 26px; cursor: pointer;
  display: flex; align-items: center; border-radius: 999px; outline: none;
}
.player-track::before {
  content: ""; position: absolute; left: 0; right: 0; height: 6px;
  background: rgba(255,255,255,.18); border-radius: 999px;
}
.player-fill {
  position: relative; height: 6px; width: 0%;
  background: linear-gradient(90deg, #2dd4bf, #14b8a6); border-radius: 999px;
  transition: width 0.12s linear;
}
.player-track:focus-visible { box-shadow: 0 0 0 3px rgba(45,212,191,.5); }
.player-time { font-size: 0.78rem; font-weight: 600; font-variant-numeric: tabular-nums; color: #c8d2dc; white-space: nowrap; }

/* ── Transcription ──────────────────────────────────────────── */
.transcript { display: flex; flex-direction: column; gap: 12px; }
.bubble {
  max-width: 88%; padding: 12px 15px; border-radius: 16px;
  font-size: 0.94rem; line-height: 1.55;
  animation: rise 0.35s var(--ease) both;
}
.bubble-agent {
  align-self: flex-start; background: var(--brand-soft);
  border-bottom-left-radius: 6px; color: #0b3f39;
}
.bubble-caller {
  align-self: flex-end; background: var(--surface-2);
  border: 1px solid var(--line); border-bottom-right-radius: 6px;
}
.bubble-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.bubble-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  font-size: 0.68rem; font-weight: 800; flex: none;
}
.ba-agent { background: var(--brand); color: #fff; }
.ba-caller { background: #d5dbe2; color: var(--ink-2); }
.bubble-role { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.bubble-text { overflow-wrap: anywhere; }

/* ── Notifications push ─────────────────────────────────────── */
.push-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
}
.push-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 14px; flex: none;
  background: var(--brand-soft); color: var(--brand-deep);
}
.push-icon.on { background: var(--ok-soft); color: var(--ok); }
.push-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.push-text strong { font-size: 0.95rem; font-weight: 700; }
.push-text .muted { font-size: 0.82rem; line-height: 1.45; }
.push-text em { font-style: normal; font-weight: 600; color: var(--ink-2); }
.btn-compact { padding: 10px 18px; font-size: 0.9rem; flex: none; }
.btn-ghost {
  flex: none; border: 1px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 12px; padding: 10px 16px; font-size: 0.88rem; font-weight: 600;
  font-family: inherit; cursor: pointer; transition: all 0.18s var(--ease);
}
.btn-ghost:hover { border-color: var(--urgent); color: var(--urgent); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 520px) {
  .container { padding: 16px 12px 64px; }
  h1 { font-size: 1.35rem; }
  .card { padding: 17px; border-radius: 16px; }
  .lead-row { grid-template-columns: 34px 1fr; }
  .lead-label { grid-column: 2; padding-top: 0; font-size: 0.78rem; }
  .lead-value { grid-column: 2; padding-top: 0; }
  .lead-icon { grid-row: span 2; margin-top: 2px; }
  .call-row { padding: 13px 12px; gap: 11px; }
  .avatar { width: 42px; height: 42px; }
  .stats-row { gap: 8px; }
  .stat-value { font-size: 1.3rem; }
  .bubble { max-width: 94%; }
  .topbar-company { max-width: 40vw; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
