/* ===================================================================
   Portail de connexion WhatsApp — Design system
   Identité : encre bleu-nuit + indigo signal + laiton chaud
   =================================================================== */

:root {
  --ink: #14152B;
  --ink-70: rgba(20, 21, 43, 0.7);
  --ink-45: rgba(20, 21, 43, 0.45);
  --mist: #F5F6FA;
  --mist-deep: #ECEEF5;
  --card: #FFFFFF;
  --line: #E4E6EF;
  --signal: #3E4BF0;
  --signal-dark: #2C37B8;
  --signal-soft: #ECEEFC;
  --brass: #C9A227;
  --brass-soft: #F7EFD8;
  --emerald: #14804A;
  --emerald-soft: #E4F5EC;
  --danger: #C4432B;
  --danger-soft: #FBEAE6;

  --radius-lg: 28px;
  --radius-md: 16px;
  --radius-sm: 10px;

  --shadow-soft: 0 30px 70px -35px rgba(20, 21, 43, 0.35);
  --shadow-card: 0 2px 0 rgba(20, 21, 43, 0.04), 0 12px 30px -20px rgba(20, 21, 43, 0.18);

  --font-display: "Fraunces", "Iowan Old Style", serif;
  --font-body: "Satoshi", "Inter", -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }

.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--signal-dark);
  background: var(--signal-soft);
  padding: 6px 12px;
  border-radius: 999px;
}

.eyebrow--dark { color: var(--brass); background: rgba(201, 162, 39, 0.14); }

.lead { font-size: 19px; color: var(--ink-70); max-width: 46ch; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn--primary { background: var(--signal); color: #fff; box-shadow: 0 14px 30px -14px rgba(62, 75, 240, 0.55); }
.btn--primary:hover { background: var(--signal-dark); }

.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink-45); }

.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: #23244a; }

.btn--danger { background: var(--danger-soft); color: var(--danger); }
.btn--danger:hover { background: #f6d9d1; }

.btn--block { width: 100%; }
.btn--sm { padding: 9px 18px; font-size: 13.5px; }

/* ---------- Nav ---------- */

.nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(245, 246, 250, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav__bar { display: flex; align-items: center; justify-content: space-between; height: 76px; }

.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; font-size: 19px; }

.brand__mark { width: 34px; height: 34px; flex-shrink: 0; }

.nav__links { display: flex; align-items: center; gap: 32px; font-size: 14.5px; color: var(--ink-70); }
.nav__links a:hover { color: var(--ink); }

.nav__cta { display: flex; align-items: center; gap: 14px; }

@media (max-width: 780px) {
  .nav__links { display: none; }
}

/* ---------- Hero + signature pairing motif ---------- */

.hero {
  position: relative;
  padding: 96px 0 64px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute; inset: -20% -10% auto -10%; height: 640px;
  background: radial-gradient(closest-side, rgba(62, 75, 240, 0.14), transparent 70%);
  pointer-events: none;
}

.hero__grid { position: relative; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 64px; align-items: center; }

@media (max-width: 940px) {
  .hero__grid { grid-template-columns: 1fr; }
}

.hero__title { font-size: clamp(34px, 4.4vw, 54px); line-height: 1.08; margin: 20px 0 22px; }
.hero__title em { font-style: normal; color: var(--signal); }

.hero__actions { display: flex; align-items: center; gap: 14px; margin-top: 32px; flex-wrap: wrap; }

.pair {
  --node: 78px;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  gap: 42px;
  padding: 56px 24px;
}

.pair__node {
  width: var(--node); height: var(--node); border-radius: 22px;
  background: var(--card); box-shadow: var(--shadow-card);
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 2;
}

.pair__node svg { width: 34px; height: 34px; }
.pair__node--phone svg { color: var(--ink); }
.pair__node--chat svg { color: var(--emerald); }

.pair__line {
  position: absolute; left: 0; right: 0; top: 50%; height: 2px;
  transform: translateY(-50%);
  z-index: 1;
}

.pair__line svg { width: 100%; height: 24px; overflow: visible; }

.pair__dash {
  stroke: var(--signal);
  stroke-width: 2.5;
  stroke-dasharray: 6 8;
  fill: none;
  animation: dashMove 1.6s linear infinite;
}

.pair__pulse {
  fill: var(--emerald);
  opacity: 0;
  animation: pulseIn 3.2s ease-in-out infinite;
}

@keyframes dashMove {
  to { stroke-dashoffset: -28; }
}

@keyframes pulseIn {
  0%, 55% { opacity: 0; transform: scale(0.6); }
  70%, 90% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.6); }
}

@media (prefers-reduced-motion: reduce) {
  .pair__dash, .pair__pulse { animation: none; }
}

/* ---------- Trust strip ---------- */

.trust-strip {
  display: flex; flex-wrap: wrap; gap: 40px;
  padding: 28px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}

.trust-strip__item { display: flex; align-items: baseline; gap: 8px; font-size: 14px; color: var(--ink-70); }
.trust-strip__item strong { font-family: var(--font-display); font-size: 20px; color: var(--ink); }

/* ---------- Sections ---------- */

.section { padding: 88px 0; }
.section--tight { padding: 64px 0; }

.section__head { max-width: 640px; margin: 0 auto 52px; text-align: center; }
.section__title { font-size: clamp(26px, 3vw, 36px); margin-top: 16px; }

/* Steps (justified: real ordered sequence) */

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; counter-reset: step; }

@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

.step { background: var(--card); border-radius: var(--radius-md); padding: 32px; box-shadow: var(--shadow-card); }
.step__index { font-family: var(--font-mono); font-size: 13px; color: var(--signal); }
.step__title { font-family: var(--font-display); font-size: 20px; margin: 14px 0 10px; }
.step__text { color: var(--ink-70); font-size: 15px; }

/* Feature / trust cards */

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 860px) { .feature-grid { grid-template-columns: 1fr; } }

.feature-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 30px; }
.feature-card__icon {
  width: 44px; height: 44px; border-radius: 12px; background: var(--brass-soft);
  display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
}
.feature-card__icon svg { width: 22px; height: 22px; color: var(--brass); }
.feature-card h3 { font-size: 17px; margin-bottom: 8px; }
.feature-card p { color: var(--ink-70); font-size: 14.5px; }

/* CTA band */

.cta-band {
  background: var(--ink); color: #fff; border-radius: var(--radius-lg);
  padding: 64px; display: flex; align-items: center; justify-content: space-between; gap: 32px;
  position: relative; overflow: hidden;
}
.cta-band::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(201,162,39,0.35), transparent 70%);
}
.cta-band h2 { font-size: clamp(24px, 3vw, 32px); max-width: 22ch; position: relative; }
.cta-band .btn--primary { background: var(--brass); box-shadow: none; color: var(--ink); position: relative; }
.cta-band .btn--primary:hover { background: #dab535; }

@media (max-width: 700px) { .cta-band { flex-direction: column; align-items: flex-start; padding: 40px 28px; } }

/* Footer */

.footer { padding: 48px 0; border-top: 1px solid var(--line); }
.footer__row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer__links { display: flex; gap: 24px; font-size: 14px; color: var(--ink-70); }

/* ---------- Auth split layout ---------- */

.auth { min-height: 100vh; display: grid; grid-template-columns: 0.9fr 1.1fr; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } }

.auth__brand {
  background: var(--ink); color: #fff; padding: 56px;
  display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.auth__brand::before {
  content: ""; position: absolute; inset: auto -30% -40% -10%; height: 480px;
  background: radial-gradient(closest-side, rgba(62,75,240,0.35), transparent 70%);
}
.auth__brand .brand { color: #fff; }
.auth__quote { position: relative; font-family: var(--font-display); font-size: 26px; line-height: 1.35; max-width: 30ch; }
.auth__quote span { display: block; margin-top: 18px; font-family: var(--font-body); font-size: 14px; color: rgba(255,255,255,0.6); }

@media (max-width: 900px) { .auth__brand { display: none; } }

.auth__form-side { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth__card { width: 100%; max-width: 400px; }
.auth__card h1 { font-size: 28px; margin-bottom: 8px; }
.auth__card .lead { font-size: 15px; margin-bottom: 32px; }

.auth__switch { margin-top: 26px; font-size: 14px; color: var(--ink-70); text-align: center; }
.auth__switch a { color: var(--signal); font-weight: 600; }

/* ---------- Forms ---------- */

.field { margin-bottom: 20px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 7px; }
.field input {
  width: 100%; padding: 13px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--mist); font-family: var(--font-body); font-size: 15px; color: var(--ink);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.field input:focus { outline: none; border-color: var(--signal); background: #fff; }
.field small { display: block; margin-top: 6px; font-size: 12.5px; color: var(--ink-45); }
.field-error { color: var(--danger); font-size: 12.5px; margin-top: 6px; }

.alert { padding: 13px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 20px; }
.alert--success { background: var(--emerald-soft); color: var(--emerald); }
.alert--error { background: var(--danger-soft); color: var(--danger); }

/* ---------- Dashboard shell ---------- */

.dash { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
@media (max-width: 860px) { .dash { grid-template-columns: 1fr; } }

.dash__sidebar {
  background: var(--ink); color: #fff; padding: 28px 20px;
  display: flex; flex-direction: column; gap: 28px;
}
.dash__sidebar .brand { color: #fff; font-size: 17px; }

.dash__nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.dash__nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px;
  font-size: 14.5px; color: rgba(255,255,255,0.65);
}
.dash__nav-item svg { width: 18px; height: 18px; }
.dash__nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.dash__nav-item--active { background: rgba(62,75,240,0.28); color: #fff; }

.dash__switch {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dash__switch:hover { border-color: var(--brass); background: rgba(201,162,39,0.08); }
.dash__switch strong { display: block; font-size: 13.5px; color: #fff; font-weight: 600; }
.dash__switch small { display: block; margin-top: 2px; font-size: 11.5px; color: rgba(255,255,255,0.5); }
.dash__switch svg { width: 16px; height: 16px; color: var(--brass); flex-shrink: 0; }

.dash__user { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 18px; font-size: 13.5px; color: rgba(255,255,255,0.55); }
.dash__user form button { color: rgba(255,255,255,0.55); font-size: 13px; margin-top: 8px; }
.dash__user form button:hover { color: #fff; }

.dash__main { padding: 40px 44px; }
@media (max-width: 640px) { .dash__main { padding: 28px 20px; } }

.dash__topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; flex-wrap: wrap; gap: 16px; }
.dash__title { font-size: 24px; }

/* Device list */

.device-list { display: flex; flex-direction: column; gap: 14px; }
.device-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 22px 26px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.device-card__name { font-weight: 600; }
.device-card__phone { font-family: var(--font-mono); font-size: 13.5px; color: var(--ink-45); margin-top: 3px; }
.device-card__actions { display: flex; align-items: center; gap: 16px; }
.device-card__actions a { font-size: 14px; color: var(--signal); font-weight: 600; }

.badge {
  font-family: var(--font-mono); font-size: 11.5px; text-transform: lowercase;
  padding: 5px 11px; border-radius: 999px;
}
.badge--ok { background: var(--emerald-soft); color: var(--emerald); }
.badge--off { background: var(--danger-soft); color: var(--danger); }

.empty-state { text-align: center; padding: 64px 20px; color: var(--ink-45); }

/* Connection screen */

.connect-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 48px; text-align: center; max-width: 460px; margin: 0 auto; }
.connect-card h1 { font-size: 22px; margin-bottom: 10px; }
.qr-frame { width: 216px; height: 216px; border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-card); margin: 24px auto; }
.qr-frame img { width: 100%; height: 100%; object-fit: cover; }
.pairing-code { font-family: var(--font-mono); font-size: 30px; letter-spacing: 0.16em; background: var(--mist); border-radius: var(--radius-sm); padding: 16px 20px; margin: 24px 0; }
.connect-note { background: var(--brass-soft); color: #6b5613; border-radius: var(--radius-sm); padding: 14px 18px; font-size: 13.5px; text-align: left; }
