/*
 * WardLens — feuille de marque (identité de la landing "Visual Air-Gap
 * Document Capture"). Palette bleu-nuit + accents cyan/indigo, cartes
 * vitrées, bordures subtiles. Appliquée à toute l'app (dashboard,
 * capture, console, auth).
 */
:root {
  --bg: #06111f;
  --bg-soft: #0a1626;
  --panel: rgba(12, 29, 49, 0.72);
  --panel-solid: #0a1727;
  --border: rgba(122, 199, 255, 0.16);
  --border-strong: rgba(122, 199, 255, 0.28);

  --text: #f4f8fc;
  --muted: #9db0c3;
  --faint: #6c8098;

  --blue: #59b8ff;
  --blue-2: #2f8fff;
  --cyan: #78e7ff;
  --indigo: #6366f1;
  --green: #58e6b0;
  --amber: #ffcb6b;
  --red: #ff6b81;

  --shadow: 0 30px 80px rgba(0, 0, 0, 0.45), 0 0 60px rgba(49, 150, 255, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 15%, rgba(57, 140, 255, 0.15), transparent 30%),
    radial-gradient(circle at 80% 8%, rgba(83, 232, 255, 0.08), transparent 24%),
    linear-gradient(180deg, #06111f 0%, #071321 50%, #04101c 100%);
  background-attachment: fixed;
  /* Fond de secours sous les dégradés « fixed » : sans lui, une page plus
     haute que l'écran laissait une bande blanche en bas (capture pleine
     page, rebond de défilement). */
  background-color: var(--bg);
}

/* Grille subtile en fond (comme la landing) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.016) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.016) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}
body > * { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }
/* Lien dans un texte courant (pages légales) : visible comme un lien. */
.wl-text-link { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.wl-text-link:hover { color: var(--cyan); }

/* ── Header ────────────────────────────────────────────────────────── */
.wl-header {
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
.wl-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wl-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.wl-brand .mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(91, 189, 255, 0.22), rgba(53, 111, 255, 0.28));
  border: 1px solid var(--border-strong);
  box-shadow: inset 0 0 18px rgba(93, 190, 255, 0.14), 0 0 20px rgba(69, 156, 255, 0.14);
}
.wl-brand .mark::after {
  content: "";
  width: 11px;
  height: 11px;
  border: 2px solid var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(120, 231, 255, 0.7);
}
.wl-brand .b1 { color: var(--text); }
.wl-brand .b2 { color: var(--blue); }
.wl-nav-link {
  color: var(--muted);
  font-size: 14px;
  transition: color 0.15s;
}
.wl-nav-link:hover { color: var(--text); }

/* Badge de crédits (header, toujours visible pour un compte connecté) */
.wl-credit-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 600; line-height: 1;
  color: var(--cyan);
  background: rgba(120, 231, 255, 0.10);
  border: 1px solid rgba(120, 231, 255, 0.25);
  transition: background 0.15s, border-color 0.15s;
}
a.wl-credit-badge:hover { background: rgba(120, 231, 255, 0.18); border-color: var(--cyan); }
.wl-credit-badge b { color: var(--text); font-weight: 700; }
.wl-credit-badge[data-credits="0"] { color: #ff8a8a; background: rgba(255, 138, 138, 0.10); border-color: rgba(255, 138, 138, 0.3); }
.wl-credit-badge[data-credits="0"] b { color: #ff8a8a; }

/* ── Layout ────────────────────────────────────────────────────────── */
.wl-main { max-width: 1100px; margin: 0 auto; padding: 40px 24px 80px; }
.wl-main-narrow { max-width: 460px; }

.wl-eyebrow {
  color: var(--blue);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  margin: 0 0 12px;
}
h1.wl-title { font-size: clamp(28px, 4vw, 40px); line-height: 1.1; letter-spacing: -0.03em; margin: 0 0 10px; }
h2.wl-h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--faint); font-weight: 700; margin: 0 0 14px; }
.wl-lede { color: var(--muted); font-size: 15px; line-height: 1.6; margin: 0 0 24px; }
.gradient-text {
  color: transparent;
  background: linear-gradient(90deg, #ffffff, #97d9ff 55%, #7ff0ff);
  background-clip: text;
  -webkit-background-clip: text;
}

/* ── Cartes vitrées ────────────────────────────────────────────────── */
.wl-card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.wl-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(14px);
}

/* KPI cards */
.wl-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 28px; }
.wl-kpi { background: linear-gradient(160deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015)); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.wl-kpi .label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); }
.wl-kpi .value { font-size: 30px; font-weight: 800; margin-top: 4px; }

/* ── Boutons ───────────────────────────────────────────────────────── */
.wl-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: 0.15s ease;
}
.wl-btn-primary {
  color: #04111b;
  background: linear-gradient(135deg, #78e7ff, #59b8ff);
  box-shadow: 0 10px 28px rgba(44, 157, 255, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.wl-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 16px 36px rgba(44, 157, 255, 0.32), inset 0 1px 0 rgba(255,255,255,0.6); }
.wl-btn-ghost { color: var(--text); background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.12); }
.wl-btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }
/* Contour seul (Force capture, 06/10) : un geste de secours, il ne doit
   pas concurrencer visuellement Stop ni Start. */
.wl-btn-outline { color: var(--cyan); background: transparent; border-color: var(--cyan); }
.wl-btn-outline:hover { background: rgba(120, 231, 255, 0.08); }
.wl-btn-danger { color: #fff; background: linear-gradient(135deg, #ff6b81, #e0485f); }
.wl-btn-danger:hover { transform: translateY(-1px); }
.wl-btn-sm { padding: 6px 12px; font-size: 12px; }
.wl-btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ── Formulaires ───────────────────────────────────────────────────── */
.wl-field { margin-bottom: 16px; }
.wl-field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.wl-input, .wl-select {
  width: 100%;
  background: rgba(4, 16, 28, 0.6);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.wl-input:focus, .wl-select:focus { border-color: var(--blue); }

/* ── Tableaux ──────────────────────────────────────────────────────── */
.wl-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.wl-table th { text-align: left; color: var(--faint); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.wl-table td { padding: 11px 10px; border-bottom: 1px solid rgba(122, 199, 255, 0.07); }
.wl-table tr:hover td { background: rgba(255, 255, 255, 0.015); }

/* ── Chips / badges ────────────────────────────────────────────────── */
.wl-chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.wl-chip-blue { background: rgba(89, 184, 255, 0.12); color: var(--blue); }
.wl-chip-cyan { background: rgba(120, 231, 255, 0.12); color: var(--cyan); }
.wl-chip-green { background: rgba(88, 230, 176, 0.14); color: var(--green); }
.wl-chip-muted { background: rgba(255, 255, 255, 0.05); color: var(--muted); }
/* États d'échec — console PDF generation (16/09). */
.wl-chip-amber { background: rgba(255, 203, 107, 0.14); color: var(--amber); }
.wl-chip-red { background: rgba(255, 107, 129, 0.14); color: var(--red); }

/* ── Messages ──────────────────────────────────────────────────────── */
.wl-msg { border-radius: 10px; padding: 11px 14px; font-size: 14px; margin-bottom: 16px; }
.wl-msg-ok { background: rgba(88, 230, 176, 0.1); color: var(--green); border: 1px solid rgba(88, 230, 176, 0.25); }
.wl-msg-err { background: rgba(255, 107, 129, 0.1); color: var(--red); border: 1px solid rgba(255, 107, 129, 0.25); }

/* ── Footer ────────────────────────────────────────────────────────── */
.wl-footer { border-top: 1px solid var(--border); margin-top: 40px; }
.wl-footer-inner { max-width: 1100px; margin: 0 auto; padding: 20px 24px; color: var(--faint); font-size: 12px; }

.text-muted { color: var(--muted); }
.text-faint { color: var(--faint); }
.text-green { color: var(--green); }
.text-cyan { color: var(--cyan); }
