/* ═══════════════════════════════════════════════════════════════════════════
   ORAPPLY — Design Tokens v2
   Visual refresh: coloured app shell, tinted canvas, vivid status system
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* ─────────────────────────────────────────────────────────────────────────
     Colors — Deep ink/navy base with warm terracotta accent
     ───────────────────────────────────────────────────────────────────────── */

  /* Primary palette — ink/navy */
  --ink-900: oklch(22% 0.06 250);      /* #152238 — deepest ink */
  --ink-800: oklch(28% 0.055 250);     /* #1f3a5f — primary brand */
  --ink-700: oklch(35% 0.05 250);      /* #2a4a70 */
  --ink-600: oklch(42% 0.045 250);     /* #3a5a80 */
  --ink-500: oklch(52% 0.04 250);      /* #5577a0 */
  --ink-400: oklch(62% 0.035 250);     /* #7595b8 */
  --ink-300: oklch(72% 0.03 250);      /* #95b2d0 */
  --ink-200: oklch(82% 0.02 250);      /* #bdd0e5 */
  --ink-100: oklch(90% 0.015 250);     /* #dce7f2 */
  --ink-50: oklch(95% 0.008 250);      /* #eef3f8 */

  /* Accent — warm terracotta/coral */
  --accent-700: oklch(48% 0.16 35);    /* #b04528 */
  --accent-600: oklch(55% 0.17 35);    /* #cc5232 */
  --accent-500: oklch(62% 0.16 35);    /* #de6a4a — primary accent */
  --accent-400: oklch(70% 0.13 35);    /* #e88a6e */
  --accent-300: oklch(78% 0.09 35);    /* #f0ac96 */
  --accent-200: oklch(86% 0.06 35);    /* #f7cec0 */
  --accent-100: oklch(93% 0.03 35);    /* #fceae4 */

  /* Neutrals — cool blue-tinted (matching sidebar hue family) */
  --gray-900: oklch(20% 0.012 250);    /* #191e26 — cool ink */
  --gray-800: oklch(30% 0.012 250);    /* #2d3542 */
  --gray-700: oklch(40% 0.01 250);     /* #454e5c */
  --gray-600: oklch(50% 0.008 250);    /* #5e6878 */
  --gray-500: oklch(60% 0.006 250);    /* #788394 */
  --gray-400: oklch(70% 0.005 250);    /* #94a0af */
  --gray-300: oklch(80% 0.004 250);    /* #b4bdca */
  --gray-200: oklch(87% 0.003 250);    /* #d0d7e1 */
  --gray-100: oklch(93% 0.003 250);    /* #e6ebf2 */
  --gray-50: oklch(96% 0.004 250);     /* #f0f4f9 */

  /* ─────────────────────────────────────────────────────────────────────────
     Surfaces — "Bleu brume" blue-tinted canvas (same hue family as navy sidebar)
     ───────────────────────────────────────────────────────────────────────── */

  /* Canvas — cool blue mist (cards read as paper on blue-tinted desk) */
  --canvas: #e3ecf7;                   /* Bleu brume — clearly blue-tinted */
  --canvas-subtle: #d6e2f1;            /* Slightly deeper blue mist */

  /* Surfaces — white cards on blue canvas */
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-sunken: #eef4fb;           /* Very light blue for inset areas */

  /* Legacy bg (for compatibility) */
  --bg: var(--canvas);

  /* ─────────────────────────────────────────────────────────────────────────
     App Shell — coloured sidebar and navigation
     ───────────────────────────────────────────────────────────────────────── */

  /* Sidebar colours */
  --sidebar-bg: var(--ink-800);
  --sidebar-text: oklch(85% 0.02 250);
  --sidebar-text-muted: oklch(65% 0.025 250);
  --sidebar-hover: oklch(32% 0.055 250);
  --sidebar-active-bg: var(--accent-500);
  --sidebar-active-text: #ffffff;
  --sidebar-border: oklch(35% 0.05 250);

  /* Bottom nav (mobile) */
  --bottom-nav-bg: var(--ink-800);
  --bottom-nav-text: oklch(70% 0.025 250);
  --bottom-nav-active: var(--accent-400);

  /* App header */
  --header-bg: var(--surface);
  --header-border: var(--gray-200);

  /* Page hero bands */
  --hero-gradient-start: oklch(28% 0.055 250);
  --hero-gradient-end: oklch(35% 0.05 250);

  /* ─────────────────────────────────────────────────────────────────────────
     Status Colors — vivid, accessible, consistent across UI
     8 application statuses with distinct hues
     ───────────────────────────────────────────────────────────────────────── */

  /* Brouillon — cool neutral (blue-tinted) */
  --status-brouillon-bg: oklch(90% 0.005 250);
  --status-brouillon-text: oklch(45% 0.01 250);
  --status-brouillon-dot: oklch(55% 0.01 250);

  /* À relire — warm amber */
  --status-arelire-bg: oklch(92% 0.08 80);
  --status-arelire-text: oklch(45% 0.12 75);
  --status-arelire-dot: oklch(65% 0.14 75);

  /* Prête — calm blue */
  --status-prete-bg: oklch(92% 0.06 240);
  --status-prete-text: oklch(42% 0.1 240);
  --status-prete-dot: oklch(55% 0.12 240);

  /* Envoyée — rich indigo */
  --status-envoyee-bg: oklch(90% 0.08 280);
  --status-envoyee-text: oklch(40% 0.14 280);
  --status-envoyee-dot: oklch(55% 0.16 280);

  /* Répondu — cool teal */
  --status-repondu-bg: oklch(92% 0.06 180);
  --status-repondu-text: oklch(38% 0.1 180);
  --status-repondu-dot: oklch(52% 0.12 180);

  /* Entretien — vibrant green */
  --status-entretien-bg: oklch(92% 0.08 145);
  --status-entretien-text: oklch(38% 0.12 145);
  --status-entretien-dot: oklch(55% 0.14 145);

  /* Refusée — soft rose */
  --status-refusee-bg: oklch(92% 0.06 10);
  --status-refusee-text: oklch(45% 0.12 10);
  --status-refusee-dot: oklch(60% 0.14 10);

  /* Erreur — alert red */
  --status-erreur-bg: oklch(92% 0.08 25);
  --status-erreur-text: oklch(42% 0.16 25);
  --status-erreur-dot: oklch(55% 0.18 25);

  /* ─────────────────────────────────────────────────────────────────────────
     Semantic colors
     ───────────────────────────────────────────────────────────────────────── */

  --success-600: oklch(50% 0.15 145);
  --success-500: oklch(58% 0.14 145);
  --success-100: oklch(94% 0.05 145);

  --warning-600: oklch(55% 0.14 75);
  --warning-500: oklch(65% 0.14 75);
  --warning-100: oklch(94% 0.06 75);

  --error-600: oklch(48% 0.18 25);
  --error-500: oklch(55% 0.17 25);
  --error-100: oklch(94% 0.04 25);

  --info-600: oklch(48% 0.12 240);
  --info-500: oklch(55% 0.11 240);
  --info-100: oklch(94% 0.04 240);

  /* ─────────────────────────────────────────────────────────────────────────
     Typography
     ───────────────────────────────────────────────────────────────────────── */

  --font-display: 'DM Serif Display', 'Georgia', 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;

  --leading-none: 1;
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;

  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  --tracking-tight: -0.025em;
  --tracking-normal: 0;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.05em;

  /* ─────────────────────────────────────────────────────────────────────────
     Spacing
     ───────────────────────────────────────────────────────────────────────── */

  --space-0: 0;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* ─────────────────────────────────────────────────────────────────────────
     Border radius
     ───────────────────────────────────────────────────────────────────────── */

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-2xl: 28px;
  --radius-full: 9999px;

  /* ─────────────────────────────────────────────────────────────────────────
     Shadows — tinted to match the cool blue canvas
     ───────────────────────────────────────────────────────────────────────── */

  --shadow-sm: 0 1px 2px oklch(25% 0.03 250 / 0.06);
  --shadow-md: 0 2px 8px oklch(25% 0.03 250 / 0.1), 0 1px 3px oklch(25% 0.03 250 / 0.06);
  --shadow-lg: 0 4px 16px oklch(25% 0.03 250 / 0.12), 0 2px 6px oklch(25% 0.03 250 / 0.06);
  --shadow-xl: 0 8px 32px oklch(25% 0.03 250 / 0.14), 0 4px 12px oklch(25% 0.03 250 / 0.08);

  /* ─────────────────────────────────────────────────────────────────────────
     Borders — cool blue-tinted
     ───────────────────────────────────────────────────────────────────────── */

  --border-light: 1px solid oklch(88% 0.008 250);
  --border-default: 1px solid oklch(82% 0.01 250);
  --border-strong: 1px solid oklch(70% 0.012 250);
  --border-accent: 2px solid var(--accent-500);

  /* ─────────────────────────────────────────────────────────────────────────
     Transitions
     ───────────────────────────────────────────────────────────────────────── */

  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;

  /* ─────────────────────────────────────────────────────────────────────────
     Z-index scale
     ───────────────────────────────────────────────────────────────────────── */

  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal-backdrop: 300;
  --z-modal: 400;
  --z-toast: 500;

  /* ─────────────────────────────────────────────────────────────────────────
     Layout
     ───────────────────────────────────────────────────────────────────────── */

  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1440px;

  --sidebar-width: 260px;
  --header-height: 64px;
  --bottom-nav-height: 72px;

  --touch-target-min: 44px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Base Styles
   ═══════════════════════════════════════════════════════════════════════════ */

/* Polices servies par le site lui-même (licence OFL) : aucun appel à un serveur tiers. */
@font-face {
  font-family: 'DM Serif Display';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/candidator_portal/static/src/fonts/dm-serif-display-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Serif Display';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/candidator_portal/static/src/fonts/dm-serif-display.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/candidator_portal/static/src/fonts/inter.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/candidator_portal/static/src/fonts/jetbrains-mono.woff2') format('woff2');
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--gray-800);
  background-color: var(--canvas);
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--font-normal);
  color: var(--ink-800);
  line-height: var(--leading-tight);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
  margin: 0 0 var(--space-4);
}

a {
  color: var(--ink-700);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-500);
}

a:focus-visible {
  outline: 2px solid var(--accent-500);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Utility Classes
   ═══════════════════════════════════════════════════════════════════════════ */

.container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container--narrow {
  max-width: var(--container-md);
}

.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;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Button Styles
   ═══════════════════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--touch-target-min);
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  line-height: var(--leading-none);
  text-decoration: none;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn:focus-visible {
  outline: 2px solid var(--accent-500);
  outline-offset: 2px;
}

.btn--primary {
  background-color: var(--ink-800);
  color: white;
}

.btn--primary:hover {
  background-color: var(--ink-700);
  color: white;
}

.btn--accent {
  background-color: var(--accent-500);
  color: white;
}

.btn--accent:hover {
  background-color: var(--accent-600);
  color: white;
}

.btn--secondary {
  background-color: var(--surface);
  color: var(--ink-800);
  border: var(--border-default);
}

.btn--secondary:hover {
  background-color: var(--ink-50);
  border-color: var(--ink-400);
}

.btn--ghost {
  background-color: transparent;
  color: var(--ink-700);
}

.btn--ghost:hover {
  background-color: var(--ink-50);
}

.btn--sm {
  min-height: 36px;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}

.btn--lg {
  min-height: 52px;
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
}

.btn--icon {
  width: var(--touch-target-min);
  padding: 0;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--danger {
  background: var(--error-500);
  color: white;
}

.btn--danger:hover {
  background: var(--error-600);
  color: white;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Form Elements
   ═══════════════════════════════════════════════════════════════════════════ */

.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--gray-700);
}

.form-input {
  display: block;
  width: 100%;
  min-height: var(--touch-target-min);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  color: var(--gray-800);
  background-color: var(--surface);
  border: var(--border-default);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:hover {
  border-color: var(--gray-400);
}

.form-input:focus {
  outline: none;
  border-color: var(--ink-600);
  box-shadow: 0 0 0 3px oklch(28% 0.055 250 / 0.15);
}

.form-input::placeholder {
  color: var(--gray-400);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235577a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  padding-right: var(--space-10);
}

.form-hint {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--gray-500);
}

.form-error {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--error-600);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Card Styles
   ═══════════════════════════════════════════════════════════════════════════ */

.card {
  background-color: var(--surface);
  border: var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.card--hover {
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.card--hover:hover {
  border-color: var(--gray-300);
  box-shadow: var(--shadow-md);
}

.card--selected {
  border-color: var(--ink-600);
  box-shadow: 0 0 0 3px oklch(28% 0.055 250 / 0.15);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Badge Styles — Application statuses (vivid, consistent)
   ═══════════════════════════════════════════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  line-height: var(--leading-normal);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge--brouillon {
  background-color: var(--status-brouillon-bg);
  color: var(--status-brouillon-text);
}

.badge--a-relire {
  background-color: var(--status-arelire-bg);
  color: var(--status-arelire-text);
}

.badge--prete {
  background-color: var(--status-prete-bg);
  color: var(--status-prete-text);
}

.badge--envoyee {
  background-color: var(--status-envoyee-bg);
  color: var(--status-envoyee-text);
}

.badge--repondu {
  background-color: var(--status-repondu-bg);
  color: var(--status-repondu-text);
}

.badge--entretien {
  background-color: var(--status-entretien-bg);
  color: var(--status-entretien-text);
}

.badge--refusee {
  background-color: var(--status-refusee-bg);
  color: var(--status-refusee-text);
}

.badge--erreur {
  background-color: var(--status-erreur-bg);
  color: var(--status-erreur-text);
}

/* Warning badge (doublon, etc) */
.badge--warning {
  background-color: var(--warning-100);
  color: var(--warning-600);
}

/* Status dots (for activity feed, kanban headers) */
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.status-dot--brouillon { background: var(--status-brouillon-dot); }
.status-dot--a-relire { background: var(--status-arelire-dot); }
.status-dot--prete { background: var(--status-prete-dot); }
.status-dot--envoyee { background: var(--status-envoyee-dot); }
.status-dot--repondu { background: var(--status-repondu-dot); }
.status-dot--entretien { background: var(--status-entretien-dot); }
.status-dot--refusee { background: var(--status-refusee-dot); }
.status-dot--erreur { background: var(--status-erreur-dot); }

/* ═══════════════════════════════════════════════════════════════════════════
   App Shell — Coloured Sidebar (Desktop) & Bottom Nav (Mobile)
   ═══════════════════════════════════════════════════════════════════════════ */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Coloured sidebar */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--ink-800) 0%, var(--ink-900) 100%);
  display: flex;
  flex-direction: column;
  z-index: var(--z-sticky);
}

.sidebar__logo {
  padding: var(--space-6);
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar__logo .logo {
  color: white;
}

.sidebar__logo .logo__icon {
  background: var(--accent-500);
}

.sidebar__nav {
  flex: 1;
  padding: var(--space-4);
  overflow-y: auto;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: var(--sidebar-text);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  transition: all var(--transition-fast);
  margin-bottom: var(--space-1);
}

.sidebar__link:hover {
  background-color: var(--sidebar-hover);
  color: white;
}

.sidebar__link--active {
  background-color: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
}

.sidebar__link--active:hover {
  background-color: var(--accent-600);
}

.sidebar__link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.85;
}

.sidebar__link--active svg {
  opacity: 1;
}

.sidebar__section-title {
  padding: var(--space-4) var(--space-4) var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--sidebar-text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

.sidebar__footer {
  padding: var(--space-4);
  border-top: 1px solid var(--sidebar-border);
}

.sidebar__footer .sidebar__link {
  color: var(--sidebar-text-muted);
}

.sidebar__footer .sidebar__link:hover {
  color: white;
}

/* Main content area */
.app-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
  background: var(--canvas);
}

/* App header with subtle separation */
.app-header {
  position: sticky;
  top: 0;
  height: var(--header-height);
  background-color: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  z-index: var(--z-sticky);
}

.app-content {
  padding: var(--space-6);
}

/* Coloured bottom nav (mobile) */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: linear-gradient(180deg, var(--ink-800) 0%, var(--ink-900) 100%);
  z-index: var(--z-sticky);
}

.bottom-nav__list {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 100%;
  margin: 0;
  padding: 0 env(safe-area-inset-right) 0 env(safe-area-inset-left);
  padding-bottom: env(safe-area-inset-bottom);
  list-style: none;
}

.bottom-nav__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2);
  color: var(--bottom-nav-text);
  font-size: var(--text-xs);
  text-decoration: none;
  min-width: var(--touch-target-min);
  min-height: var(--touch-target-min);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.bottom-nav__link:hover {
  color: white;
}

.bottom-nav__link--active {
  color: var(--bottom-nav-active);
}

.bottom-nav__link svg {
  width: 24px;
  height: 24px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Page Hero Bands — coloured headers for dashboard and list pages
   ═══════════════════════════════════════════════════════════════════════════ */

.page-hero {
  background: linear-gradient(135deg, var(--hero-gradient-start) 0%, var(--hero-gradient-end) 100%);
  color: white;
  padding: var(--space-6);
  margin: calc(-1 * var(--space-6));
  margin-bottom: var(--space-6);
}

.page-hero .page-title {
  color: white;
}

.page-hero .page-subtitle {
  color: oklch(85% 0.02 250);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }

  .sidebar {
    display: none;
  }

  .bottom-nav {
    display: block;
  }

  .app-main {
    margin-left: 0;
    padding-bottom: var(--bottom-nav-height);
  }

  .app-content {
    padding: var(--space-4);
  }

  .container {
    padding: 0 var(--space-4);
  }

  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }

  .page-hero {
    margin: calc(-1 * var(--space-4));
    margin-bottom: var(--space-4);
    padding: var(--space-4);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Paper / Letter Motif — A4 preview styling
   ═══════════════════════════════════════════════════════════════════════════ */

.paper {
  background: white;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-sm);
  position: relative;
}

.paper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 1px solid var(--gray-200);
  border-radius: inherit;
  pointer-events: none;
}

.paper--a4 {
  aspect-ratio: 210 / 297;
  width: 100%;
  max-width: 400px;
}

.paper--a4-sm {
  aspect-ratio: 210 / 297;
  width: 120px;
}

/* Letter template thumbnails */
.letter-thumb {
  aspect-ratio: 210 / 297;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  transition: all var(--transition-fast);
}

.letter-thumb:hover {
  border-color: var(--ink-400);
  box-shadow: var(--shadow-md);
}

.letter-thumb--selected {
  border-color: var(--ink-600);
  box-shadow: 0 0 0 3px oklch(28% 0.055 250 / 0.15);
}

/* ═══════════════════════════════════════════════════════════════════════════
   KPI Tiles — visual character with fills and icons
   ═══════════════════════════════════════════════════════════════════════════ */

.kpi-tile {
  background: var(--surface);
  border: var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  position: relative;
  overflow: hidden;
}

.kpi-tile--filled {
  background: linear-gradient(135deg, var(--ink-800) 0%, var(--ink-700) 100%);
  border: none;
  color: white;
}

.kpi-tile--filled .kpi-tile__label,
.kpi-tile--filled .kpi-tile__value {
  color: white;
}

.kpi-tile--filled .kpi-tile__change {
  color: oklch(85% 0.08 145);
}

.kpi-tile--tinted {
  background: linear-gradient(135deg, var(--ink-50) 0%, var(--surface) 100%);
}

.kpi-tile__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-3);
}

.kpi-tile__icon svg {
  width: 20px;
  height: 20px;
}

.kpi-tile__icon--indigo {
  background: var(--status-envoyee-bg);
  color: var(--status-envoyee-text);
}

.kpi-tile__icon--teal {
  background: var(--status-repondu-bg);
  color: var(--status-repondu-text);
}

.kpi-tile__icon--green {
  background: var(--status-entretien-bg);
  color: var(--status-entretien-text);
}

.kpi-tile__icon--amber {
  background: var(--status-arelire-bg);
  color: var(--status-arelire-text);
}

.kpi-tile__label {
  font-size: var(--text-sm);
  color: var(--gray-500);
  margin-bottom: var(--space-2);
}

.kpi-tile__value {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  color: var(--ink-800);
  line-height: 1;
}

.kpi-tile__sparkline {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  opacity: 0.15;
}

.kpi-tile__change {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
}

.kpi-tile__change--up {
  color: var(--success-600);
}

.kpi-tile__change--down {
  color: var(--error-600);
}

.kpi-tile__change svg {
  width: 14px;
  height: 14px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Quota Meter — visually rich progress bar
   ═══════════════════════════════════════════════════════════════════════════ */

.quota-meter {
  background: var(--surface);
  border: var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.quota-meter__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}

.quota-meter__label {
  font-weight: var(--font-semibold);
  color: var(--ink-800);
}

.quota-meter__count {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--gray-600);
}

.quota-meter__bar {
  height: 10px;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.quota-meter__fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--transition-base);
  background: linear-gradient(90deg, var(--ink-600) 0%, var(--ink-800) 100%);
}

.quota-meter__fill--warning {
  background: linear-gradient(90deg, var(--warning-500) 0%, var(--warning-600) 100%);
}

.quota-meter__fill--danger {
  background: linear-gradient(90deg, var(--error-500) 0%, var(--error-600) 100%);
}

.quota-meter__hint {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--gray-500);
}

.quota-meter__hint a {
  color: var(--accent-500);
  font-weight: var(--font-medium);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Filter Chips — coloured variants for status filters
   ═══════════════════════════════════════════════════════════════════════════ */

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--surface);
  border: var(--border-default);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--gray-600);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.filter-chip:hover {
  border-color: var(--gray-400);
  background: var(--gray-50);
}

.filter-chip--active {
  background: var(--ink-800);
  border-color: var(--ink-800);
  color: white;
}

.filter-chip--active:hover {
  background: var(--ink-700);
  border-color: var(--ink-700);
}

.filter-chip__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
}

.filter-chip__count {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  background: oklch(0% 0 0 / 0.1);
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

.filter-chip--active .filter-chip__count {
  background: oklch(100% 0 0 / 0.2);
}

/* ═══════════════════════════════════════════════════════════════════════════
   View Switcher (Liste / Kanban)
   ═══════════════════════════════════════════════════════════════════════════ */

.view-switcher {
  display: inline-flex;
  background: var(--gray-100);
  border-radius: var(--radius-md);
  padding: 3px;
}

.view-switcher__btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--gray-600);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.view-switcher__btn:hover {
  color: var(--ink-800);
}

.view-switcher__btn--active {
  background: var(--surface);
  color: var(--ink-800);
  box-shadow: var(--shadow-sm);
}

.view-switcher__btn svg {
  width: 16px;
  height: 16px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Kanban Board
   ═══════════════════════════════════════════════════════════════════════════ */

.kanban {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  padding-bottom: var(--space-4);
  min-height: 400px;
}

.kanban-column {
  flex: 0 0 280px;
  min-width: 280px;
  background: var(--surface-sunken);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 280px);
}

.kanban-column__header {
  padding: var(--space-4);
  border-bottom: var(--border-light);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.kanban-column__dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
}

.kanban-column__title {
  font-weight: var(--font-semibold);
  color: var(--ink-800);
  flex: 1;
}

.kanban-column__count {
  font-size: var(--text-sm);
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.kanban-column__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.kanban-card {
  background: var(--surface);
  border: var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.kanban-card:hover {
  border-color: var(--ink-400);
  box-shadow: var(--shadow-md);
}

.kanban-card__company {
  font-weight: var(--font-semibold);
  color: var(--ink-800);
  margin-bottom: var(--space-1);
}

.kanban-card__meta {
  font-size: var(--text-sm);
  color: var(--gray-500);
  margin-bottom: var(--space-2);
}

.kanban-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--gray-400);
}

.kanban-card__warning {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--warning-600);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
}

.kanban-card__warning svg {
  width: 14px;
  height: 14px;
}

/* Mobile kanban: single column with tabs */
@media (max-width: 768px) {
  .kanban {
    flex-direction: column;
    min-height: auto;
  }

  .kanban-column {
    flex: none;
    min-width: auto;
    max-height: none;
  }

  .kanban--mobile-tabs .kanban-column {
    display: none;
  }

  .kanban--mobile-tabs .kanban-column--active {
    display: flex;
  }

  .kanban-tabs {
    display: flex;
    gap: var(--space-2);
    overflow-x: auto;
    padding-bottom: var(--space-3);
    margin-bottom: var(--space-3);
  }

  .kanban-tab {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--surface);
    border: var(--border-default);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--gray-600);
    cursor: pointer;
  }

  .kanban-tab--active {
    background: var(--ink-800);
    border-color: var(--ink-800);
    color: white;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Send Queue Card
   ═══════════════════════════════════════════════════════════════════════════ */

.send-queue {
  background: linear-gradient(135deg, var(--ink-50) 0%, var(--surface) 100%);
  border: var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.send-queue__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.send-queue__icon {
  width: 44px;
  height: 44px;
  background: var(--ink-800);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.send-queue__icon svg {
  width: 22px;
  height: 22px;
}

.send-queue__title {
  font-weight: var(--font-semibold);
  color: var(--ink-800);
}

.send-queue__subtitle {
  font-size: var(--text-sm);
  color: var(--gray-500);
}

.send-queue__stats {
  display: flex;
  gap: var(--space-6);
}

.send-queue__stat {
  text-align: center;
}

.send-queue__stat-value {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  color: var(--ink-800);
}

.send-queue__stat-label {
  font-size: var(--text-xs);
  color: var(--gray-500);
}

.send-queue--alert {
  background: linear-gradient(135deg, var(--warning-100) 0%, var(--surface) 100%);
  border-color: var(--warning-500);
}

.send-queue--alert .send-queue__icon {
  background: var(--warning-500);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Timeline
   ═══════════════════════════════════════════════════════════════════════════ */

.timeline {
  position: relative;
  padding-left: var(--space-8);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--gray-200);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--space-5);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item__dot {
  position: absolute;
  left: calc(-1 * var(--space-8) + 4px);
  top: 2px;
  width: 16px;
  height: 16px;
  background: var(--surface);
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-full);
}

.timeline-item--done .timeline-item__dot {
  background: var(--success-500);
  border-color: var(--success-500);
}

.timeline-item--active .timeline-item__dot {
  background: var(--accent-500);
  border-color: var(--accent-500);
  box-shadow: 0 0 0 4px var(--accent-100);
}

.timeline-item__content {
  font-size: var(--text-sm);
}

.timeline-item__title {
  font-weight: var(--font-medium);
  color: var(--ink-800);
}

.timeline-item__time {
  color: var(--gray-500);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Checklist
   ═══════════════════════════════════════════════════════════════════════════ */

.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: var(--border-light);
}

.checklist-item:last-child {
  border-bottom: none;
}

.checklist-item__icon {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.checklist-item__icon svg {
  width: 12px;
  height: 12px;
}

.checklist-item--pass .checklist-item__icon {
  background: var(--success-100);
  color: var(--success-600);
}

.checklist-item--fail .checklist-item__icon {
  background: var(--error-100);
  color: var(--error-600);
}

.checklist-item--warn .checklist-item__icon {
  background: var(--warning-100);
  color: var(--warning-600);
}

.checklist-item__text {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--gray-700);
}

.checklist-item--pass .checklist-item__text {
  color: var(--gray-500);
}

.checklist-item--fail .checklist-item__text {
  color: var(--error-600);
  font-weight: var(--font-medium);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Tabs
   ═══════════════════════════════════════════════════════════════════════════ */

.tabs {
  display: flex;
  gap: 0;
  border-bottom: var(--border-light);
  overflow-x: auto;
}

.tab {
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--gray-500);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.tab:hover {
  color: var(--ink-800);
}

.tab--active {
  color: var(--ink-800);
  border-bottom-color: var(--ink-800);
}

.tab-panel {
  display: none;
  padding: var(--space-5) 0;
}

.tab-panel--active {
  display: block;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Placeholder Chips (for template fields)
   ═══════════════════════════════════════════════════════════════════════════ */

.placeholder-chip {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  background: var(--ink-50);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-700);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.placeholder-chip:hover {
  background: var(--ink-100);
  border-color: var(--ink-400);
}

.placeholder-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Import Wizard Steps
   ═══════════════════════════════════════════════════════════════════════════ */

.wizard-steps {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.wizard-step__number {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--gray-100);
  color: var(--gray-500);
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.wizard-step--active .wizard-step__number {
  background: var(--ink-800);
  color: white;
}

.wizard-step--done .wizard-step__number {
  background: var(--success-500);
  color: white;
}

.wizard-step__label {
  font-size: var(--text-sm);
  color: var(--gray-500);
}

.wizard-step--active .wizard-step__label {
  color: var(--ink-800);
  font-weight: var(--font-medium);
}

.wizard-step__separator {
  width: 40px;
  height: 2px;
  background: var(--gray-200);
}

.wizard-step--done + .wizard-step__separator {
  background: var(--success-500);
}

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding: var(--space-12);
  text-align: center;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.drop-zone:hover {
  border-color: var(--ink-400);
  background: var(--ink-50);
}

.drop-zone--active {
  border-color: var(--ink-600);
  background: var(--ink-50);
}

.drop-zone__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-4);
  color: var(--gray-400);
}

.drop-zone__title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--ink-800);
  margin-bottom: var(--space-2);
}

.drop-zone__desc {
  color: var(--gray-500);
  margin-bottom: var(--space-4);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Campaign Card
   ═══════════════════════════════════════════════════════════════════════════ */

.campaign-card {
  background: var(--surface);
  border: var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-4);
  align-items: center;
  transition: all var(--transition-fast);
}

.campaign-card:hover {
  border-color: var(--ink-400);
  box-shadow: var(--shadow-md);
}

.campaign-card__thumb {
  width: 60px;
  aspect-ratio: 210 / 297;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.campaign-card__info {
  min-width: 0;
}

.campaign-card__name {
  font-weight: var(--font-semibold);
  color: var(--ink-800);
  margin-bottom: var(--space-1);
}

.campaign-card__meta {
  font-size: var(--text-sm);
  color: var(--gray-500);
}

.campaign-card__stats {
  display: flex;
  gap: var(--space-6);
  font-size: var(--text-sm);
}

.campaign-card__stat {
  text-align: center;
}

.campaign-card__stat-value {
  font-family: var(--font-mono);
  font-weight: var(--font-semibold);
  color: var(--ink-800);
}

.campaign-card__stat-label {
  font-size: var(--text-xs);
  color: var(--gray-500);
}

.campaign-card__actions {
  display: flex;
  gap: var(--space-2);
}

@media (max-width: 768px) {
  .campaign-card {
    grid-template-columns: 1fr;
  }

  .campaign-card__thumb {
    display: none;
  }

  .campaign-card__stats {
    justify-content: flex-start;
  }

  .campaign-card__actions {
    justify-content: stretch;
  }

  .campaign-card__actions .btn {
    flex: 1;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Campaign Selector (in app header)
   ═══════════════════════════════════════════════════════════════════════════ */

.campaign-selector {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--surface-sunken);
  border: var(--border-light);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--ink-800);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.campaign-selector:hover {
  border-color: var(--ink-400);
}

.campaign-selector__icon {
  width: 16px;
  height: 16px;
  color: var(--gray-500);
}

.campaign-selector__name {
  font-weight: var(--font-medium);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.campaign-selector__chevron {
  width: 14px;
  height: 14px;
  color: var(--gray-400);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Modal / Dialog
   ═══════════════════════════════════════════════════════════════════════════ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: oklch(20% 0.02 250 / 0.5);
  z-index: var(--z-modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  z-index: var(--z-modal);
}

.modal__header {
  padding: var(--space-6);
  border-bottom: var(--border-light);
}

.modal__title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--ink-800);
}

.modal__body {
  padding: var(--space-6);
}

.modal__footer {
  padding: var(--space-4) var(--space-6);
  border-top: var(--border-light);
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
}

.modal--danger .modal__header {
  background: var(--error-100);
}

.modal--danger .modal__title {
  color: var(--error-600);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Alert Banners
   ═══════════════════════════════════════════════════════════════════════════ */

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid;
}

.alert__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.alert__content {
  flex: 1;
}

.alert__title {
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-1);
}

.alert__text {
  font-size: var(--text-sm);
}

.alert--warning {
  background: var(--warning-100);
  border-color: var(--warning-500);
}

.alert--warning .alert__icon,
.alert--warning .alert__title {
  color: var(--warning-600);
}

.alert--error {
  background: var(--error-100);
  border-color: var(--error-500);
}

.alert--error .alert__icon,
.alert--error .alert__title {
  color: var(--error-600);
}

.alert--success {
  background: var(--success-100);
  border-color: var(--success-500);
}

.alert--success .alert__icon,
.alert--success .alert__title {
  color: var(--success-600);
}

.alert--info {
  background: var(--info-100);
  border-color: var(--info-500);
}

.alert--info .alert__icon,
.alert--info .alert__title {
  color: var(--info-600);
}

/* ── Action en cours : rond qui tourne dans le bouton (voir busy.js) ── */
.is-loading { pointer-events: none; opacity: .85; cursor: progress; }
.is-loading::before {
  content: ""; flex: none; width: 1em; height: 1em; margin-right: .5em; display: inline-block; vertical-align: -2px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: cdp-spin .7s linear infinite;
}
form[data-busy] button, form[data-busy] a.btn { pointer-events: none; }
form[data-busy] button:not(.is-loading) { opacity: .55; }
@keyframes cdp-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .is-loading::before { animation-duration: 2s; } }

/* ── Choix d'un mot de passe : jauge, critères, confirmation ─────────────────── */
.pw{margin-top:var(--space-2)}
.pw__top{display:flex;align-items:center;gap:var(--space-3);min-height:20px}
.pw__bar{flex:1;display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.pw__bar span{height:6px;border-radius:99px;background:var(--gray-100);overflow:hidden;position:relative}
.pw__bar span::after{content:"";position:absolute;inset:0;border-radius:inherit;background:var(--pw-color,transparent);
  transform:scaleX(0);transform-origin:left;transition:transform .35s cubic-bezier(.2,.8,.2,1),background-color .25s}
.pw[data-level="1"]{--pw-color:#e5484d}
.pw[data-level="2"]{--pw-color:#f08c2e}
.pw[data-level="3"]{--pw-color:#d4a514}
.pw[data-level="4"]{--pw-color:#2f9e5b}
.pw[data-level="1"] .pw__bar span:nth-child(-n+1)::after,
.pw[data-level="2"] .pw__bar span:nth-child(-n+2)::after,
.pw[data-level="3"] .pw__bar span:nth-child(-n+3)::after,
.pw[data-level="4"] .pw__bar span:nth-child(-n+4)::after{transform:scaleX(1)}
.pw__bar span:nth-child(2)::after{transition-delay:.05s}
.pw__bar span:nth-child(3)::after{transition-delay:.1s}
.pw__bar span:nth-child(4)::after{transition-delay:.15s}
.pw__label{min-width:76px;text-align:right;font-size:var(--text-xs);font-weight:600;letter-spacing:.02em;
  color:color-mix(in oklab,var(--pw-color,var(--ink-500)) 78%,#111);transition:color .25s}
.pw__rules{display:flex;flex-wrap:wrap;gap:6px;margin:var(--space-3) 0 0;padding:0;list-style:none}
.pw__rule{display:inline-flex;align-items:center;gap:6px;padding:5px 10px 5px 6px;border-radius:99px;
  background:var(--gray-100);color:var(--ink-600);font-size:var(--text-xs);line-height:1.2;
  transition:background-color .25s,color .25s}
.pw__rule svg{width:16px;height:16px;padding:2px;border-radius:50%;background:#fff;color:transparent;
  box-shadow:inset 0 0 0 1.5px var(--ink-300);transition:background-color .25s,color .25s,box-shadow .25s,transform .3s cubic-bezier(.3,1.6,.5,1)}
.pw__rule em{font-style:normal;opacity:.65}
.pw__rule.is-ok{background:#e3f5ea;color:#17603a}
.pw__rule.is-ok svg{background:#2f9e5b;color:#fff;box-shadow:none;transform:scale(1.08)}
.pw__rule.is-ok em{display:none}
.pw__tip{min-height:1.4em;margin:var(--space-2) 0 0;font-size:var(--text-xs);color:var(--ink-500)}
.pw__match{display:flex;align-items:center;gap:6px;min-height:1.4em;margin:var(--space-2) 0 0;font-size:var(--text-xs);color:var(--ink-500)}
.pw__match svg{width:16px;height:16px;padding:2px;border-radius:50%;background:#2f9e5b;color:#fff;flex:none}
.pw__match.is-ok{color:#17603a}
.pw__match.is-off{color:#a8541a}
@media (prefers-reduced-motion:reduce){.pw *,.pw *::after{transition:none!important}}
