/* ============================================================
   L'HOMME À L'OEUVRE — Design System
   Source unique de vérité : couleurs, typo, espacement, ombres.
   Sert de base au site public ET à l'admin.
   Inspiration : Linear, Notion, Stripe, Vercel — adapté au monde du jardin.
   ============================================================ */

:root {
  /* ---------- COULEURS — style Stripe/Linear (clair, pro, contrasté) ----------
     On abandonne l'ivoire chaleureux pour un gris très clair corporate.
     Vert forêt + terracotta conservés en accents. */
  /* Surfaces (du plus clair au plus foncé) */
  --bg-app:        #FAFAFA;   /* fond global gris très clair — corporate */
  --bg-subtle:     #F4F4F5;   /* fonds de sections alternés */
  --bg-surface:    #FFFFFF;   /* cartes, panels (blanc pur) */
  --bg-overlay:    rgba(15, 23, 42, 0.55); /* overlay modal/lightbox */
  --bg-hover:      #F4F4F5;   /* survol de lignes/boutons ghost */

  /* Texte */
  --text-primary:    #0F172A; /* slate-900 — titres, texte fort */
  --text-secondary:  #475569; /* slate-600 — texte courant */
  --text-tertiary:   #64748B; /* slate-500 — infos secondaires */
  --text-inverse:    #FFFFFF; /* texte sur fond foncé */

  /* Bordures */
  --border-subtle:   #E2E8F0; /* slate-200 — bordures discrètes */
  --border-default:  #CBD5E1; /* slate-300 — bordures normales */
  --border-strong:   #94A3B8; /* slate-400 — bordures inputs focus */

  /* Couleur de marque (vert forêt) — conservée, identité paysage */
  --brand:           #1F3D2B; /* vert forêt profond */
  --brand-soft:      #2F5D44;
  --brand-subtle:    #E3EAE3;

  /* CTA principal = TERRACOTTA (conservé) */
  --accent:          #C2683F; /* terracotta — boutons primaires */
  --accent-hover:    #A8542E;
  --accent-subtle:   #F5E6DC;
  --accent-contrast: #FFFFFF;

  /* Vert jardin (couleur secondaire) */
  --accent-secondary:        #2F5D44;
  --accent-secondary-hover:  #1F3D2B;

  /* Couleur sombre profonde (footer, CTA band) */
  --deep-bg:         #0F172A; /* slate-900 — cohérent corporate */
  --deep-bg-soft:    #1E293B; /* slate-800 */
  --cream-warm:      #F8FAFC; /* slate-50 */

  /* États sémantiques */
  --success:         #15803D;
  --success-subtle:  #F0FDF4;
  --warning:         #B7791F;
  --warning-subtle:  #FFFBEB;
  --danger:          #DC2626;
  --danger-subtle:   #FEF2F2;
  --info:            #2563EB;
  --info-subtle:     #EFF6FF;

  /* Typographie — Inter pour TOUT (titres ET corps), style Stripe/Linear */
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Échelle typographique (plus large pour les titres énormes) */
  --text-xs:   0.75rem;    /* 12px */
  --text-sm:   0.875rem;   /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-md:   1.125rem;   /* 18px */
  --text-lg:   1.25rem;    /* 20px */
  --text-xl:  clamp(1.5rem, 1.3rem + 0.8vw, 2rem);
  --text-2xl: clamp(2rem, 1.6rem + 1.6vw, 3rem);
  --text-3xl: clamp(2.5rem, 1.8rem + 3vw, 4.5rem); /* h1 énorme */

  /* Graisses */
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;

  /* Interlignage */
  --leading-tight: 1.1;
  --leading-tighter: 1.05;
  --leading-normal: 1.5;
  --leading-relaxed: 1.65;

  /* ---------- ESPACEMENT (sections immenses style corporate) ---------- */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  --space-32: 128px; /* sections très amples */

  /* ---------- RADIUS (pill pour boutons, sinon arrondi doux) ---------- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* ---------- OMBRES (relief marqué, cartes qui se détachent du fond) ---------- */
  --shadow-xs: 0 1px 3px rgba(15, 23, 42, 0.10);
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.10), 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 6px 16px rgba(15, 23, 42, 0.12), 0 3px 6px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 14px 30px rgba(15, 23, 42, 0.15), 0 6px 12px rgba(15, 23, 42, 0.08);
  --shadow-xl: 0 24px 48px rgba(15, 23, 42, 0.20), 0 10px 20px rgba(15, 23, 42, 0.10);
  --shadow-2xl: 0 32px 64px rgba(15, 23, 42, 0.30);

  /* ---------- TRANSITIONS ---------- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-base: 220ms;
  --duration-slow: 400ms;

  /* ---------- LAYOUT ---------- */
  --container-max: 1200px;
  --container-narrow: 760px;
  --header-height: 72px;
  --sidebar-width: 256px;

  /* Z-index */
  --z-header: 100;
  --z-sidebar: 90;
  --z-dropdown: 200;
  --z-modal: 1000;
  --z-toast: 1100;

  /* Eyebrows : pastille orange plein + texte blanc — identique en clair et sombre,
     pour une lisibilité parfaite et un rendu « badge » cohérent. Le hero garde son
     propre style (.eyebrow--light) blanc translucide sur la photo. */
  --eyebrow-bg: var(--accent);
  --eyebrow-text: #fff;
}

/* ============================================================
   THÈME SOMBRE
   Activé via [data-theme="dark"] sur <html>
   ============================================================ */
[data-theme="dark"] {
  --bg-app:        #0F1A14;   /* anthracite vert profond */
  --bg-subtle:     #14211B;
  --bg-surface:    #1A2922;
  --bg-overlay:    rgba(0, 0, 0, 0.70);
  --bg-hover:      #213029;

  --text-primary:    #F0F4F1;
  --text-secondary:  #B5BFB8;
  --text-tertiary:   #95A099; /* éclairci pour contraste AA ≥ 4.5:1 sur fond sombre */
  --text-inverse:    #0F1A14;

  --border-subtle:   #2A3A33;
  --border-default:  #34473E;
  --border-strong:   #4A5E54;

  --brand:           #5EBC8A;   /* vert marque plus clair en sombre */
  --brand-soft:      #4FE0B0;
  --brand-subtle:    rgba(94, 188, 138, 0.15);

  --accent:          #E8845C;   /* terracotta éclairci pour le contraste sur fond sombre */
  --accent-hover:    #F09570;
  --accent-subtle:   rgba(232, 132, 92, 0.15);
  --accent-contrast: #0F1A14;

  --accent-secondary:        #5EBC8A;
  --accent-secondary-hover:  #4FE0B0;

  --success-subtle:  rgba(94, 188, 138, 0.15);
  --warning:         #ECC94B;
  --warning-subtle:  rgba(236, 201, 75, 0.15);
  --danger:          #FC8181;
  --danger-subtle:   rgba(252, 129, 129, 0.15);
  --info:            #63B3ED;
  --info-subtle:     rgba(99, 179, 237, 0.15);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5), 0 4px 8px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.6);
}

/* ============================================================
   RÉINITIALISATION & BASE (shared)
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background var(--duration-base) var(--ease-out),
              color var(--duration-base) var(--ease-out);
}

img, picture, svg, video { max-width: 100%; display: block; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
ul, ol { list-style: none; }

/* Sélection texte */
::selection { background: var(--accent-subtle); color: var(--text-primary); }

/* Scrollbar moderne */
* { scrollbar-width: thin; scrollbar-color: var(--border-default) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: var(--radius-full); border: 2px solid var(--bg-app); }
*::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* Focus visible (accessibilité) */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px; top: 0;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: var(--space-3) var(--space-5);
  z-index: var(--z-toast);
  border-radius: 0 0 var(--radius-md) 0;
  font-weight: var(--fw-semibold);
}
.skip-link:focus { left: 0; }

/* ============================================================
   TYPOGRAPHIE (shared)
   ============================================================ */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  line-height: var(--leading-tighter);
  letter-spacing: -0.03em;
}
h1 { font-size: var(--text-3xl); font-weight: var(--fw-extrabold); }
h2 { font-size: var(--text-2xl); font-weight: var(--fw-bold); }
h3 { font-size: var(--text-xl); font-weight: var(--fw-semibold); }
h4 { font-size: var(--text-lg); font-family: var(--font-sans); font-weight: var(--fw-semibold); }
p  { line-height: var(--leading-relaxed); }

.lead {
  font-size: var(--text-md);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--eyebrow-text);
  background: var(--eyebrow-bg);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-4);
}
.eyebrow::before { content: none; }

.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }

/* ============================================================
   COMPOSANTS — BOUTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0 var(--space-5);
  height: 44px;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  border-radius: var(--radius-full); /* pill — style Stripe/Linear */
  transition: all var(--duration-fast) var(--ease-out);
  white-space: nowrap;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Variante principale — terracotta, ombre colorée */
.btn--primary {
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: 0 1px 2px rgba(194, 104, 63, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn--primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(194, 104, 63, 0.35), 0 2px 4px rgba(194, 104, 63, 0.20);
}
.btn--primary:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(194, 104, 63, 0.20); }
.btn--primary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Variante secondaire (vert jardin) */
.btn--secondary {
  background: var(--accent-secondary);
  color: #fff;
}
.btn--secondary:hover { background: var(--accent-secondary-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* Variante fantôme — bordure discrète, style Linear */
.btn--ghost {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-default);
  box-shadow: var(--shadow-xs);
}
.btn--ghost:hover { background: var(--bg-hover); border-color: var(--border-strong); transform: translateY(-1px); }

/* Variante texte */
.btn--text {
  background: transparent;
  color: var(--accent);
  padding: 0 var(--space-2);
  height: auto;
  box-shadow: none;
}
.btn--text:hover { background: var(--accent-subtle); }

/* Variante danger */
.btn--danger {
  background: var(--danger-subtle);
  color: var(--danger);
}
.btn--danger:hover { background: var(--danger); color: #fff; }

/* États */
.btn:disabled, .btn.is-disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* Tailles */
.btn--sm { height: 36px; padding: 0 var(--space-4); font-size: var(--text-xs); }
.btn--lg { height: 52px; padding: 0 var(--space-8); font-size: var(--text-base); }
.btn--block { display: flex; width: 100%; }
.btn--icon { width: 44px; padding: 0; }
.btn--icon.btn--sm { width: 36px; }

/* ============================================================
   BADGES (statuts)
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  height: 24px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.01em;
}
.badge--new      { background: var(--warning-subtle); color: var(--warning); }
.badge--read     { background: var(--info-subtle);    color: var(--info); }
.badge--done     { background: var(--success-subtle); color: var(--success); }
.badge--archived { background: var(--bg-hover);       color: var(--text-tertiary); }
.badge--admin    { background: var(--accent-subtle);  color: var(--accent); }
.badge--neutral  { background: var(--bg-hover);       color: var(--text-secondary); }

/* ============================================================
   CHAMPS DE FORMULAIRE (inputs)
   ============================================================ */
.field { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-4); }
.field-label {
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.field-label .req { color: var(--danger); }
.field-hint { font-size: var(--text-xs); color: var(--text-tertiary); }

.input, .select, .textarea {
  width: 100%;
  height: 40px;
  padding: 0 var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease-out);
}
.textarea { height: auto; padding: var(--space-3) var(--space-4); resize: vertical; min-height: 100px; line-height: var(--leading-normal); }
.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='%238A948E' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  padding-right: var(--space-8);
}
/* Les options déroulées gardent toujours leur texte complet (jamais coupé) */
.select option {
  white-space: normal;
  word-break: break-word;
  padding: var(--space-1) var(--space-2);
}

.input::placeholder, .textarea::placeholder { color: var(--text-tertiary); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}
.input:disabled { background: var(--bg-subtle); cursor: not-allowed; }

/* Erreur de champ */
.field.has-error .input,
.field.has-error .select,
.field.has-error .textarea { border-color: var(--danger); }
.field-error {
  font-size: var(--text-xs);
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* Checkbox/Radio stylés */
.checkbox, .radio {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  font-size: var(--text-sm);
}
.checkbox input, .radio input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }

/* ============================================================
   CARTES
   ============================================================ */
.card {
  background: var(--bg-surface);
  border: 2px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out),
              border-color var(--duration-base) var(--ease-out);
}
.card--hoverable:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

/* Card avec header */
.card-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.card-header h2, .card-header h3 { margin: 0; }
.card-body { padding: var(--space-6); }
.card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ============================================================
   TABLEAUX
   ============================================================ */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border-subtle); }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.table th, .table td {
  text-align: left;
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
}
.table th {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: var(--fw-semibold);
  color: var(--text-tertiary);
  background: var(--bg-subtle);
  height: 40px;
}
.table tbody tr { transition: background var(--duration-fast) var(--ease-out); }
.table tbody tr:hover { background: var(--bg-hover); }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr.unread td { font-weight: var(--fw-semibold); }

/* ============================================================
   ALERTES
   ============================================================ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
  border: 1px solid transparent;
}
.alert--success { background: var(--success-subtle); color: var(--success); border-color: var(--success); }
.alert--error   { background: var(--danger-subtle);   color: var(--danger);   border-color: var(--danger); }
.alert--info    { background: var(--info-subtle);     color: var(--info);     border-color: var(--info); }
.alert--warning { background: var(--warning-subtle);  color: var(--warning);  border-color: var(--warning); }

/* ============================================================
   UTILITAIRES DE LAYOUT
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-6);
}
.container-narrow { max-width: var(--container-narrow); }

.stack > * + * { margin-top: var(--space-4); }
.stack-sm > * + * { margin-top: var(--space-2); }
.stack-lg > * + * { margin-top: var(--space-8); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.min-w-0 { min-width: 0; }
.ml-auto { margin-left: auto; }
.hidden { display: none; }

.grid { display: grid; gap: var(--space-6); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
/* CRITIQUE — sans min-width:0 les colonnes grid refusent de rétrécir
   sous la largeur min-intrinsèque de leur contenu (long email, URL, mot
   long), ce qui écrase les colonnes voisines et fait déborder/tronquer
   les champs de formulaire (select, input). On l'applique à TOUS les
   enfants directs d'un grid pour garantir des colonnes vraiment égales. */
.grid > * { min-width: 0; }
/* Collapse responsive : les multi-colonnes passent à 1 colonne avant que
   les champs ne deviennent trop étroits pour afficher leur texte. */
@media (max-width: 860px) {
  .grid--2 { grid-template-columns: 1fr; }
  .grid--3 { grid-template-columns: 1fr; }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .grid--4 { grid-template-columns: 1fr; }
}

.mt-2 { margin-top: var(--space-4); }
.mt-4 { margin-top: var(--space-8); }
.mb-0 { margin-bottom: 0; }

/* ============================================================
   ANIMATIONS (entrées, reveal au scroll)
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes shimmer {
  0%   { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* Spinner */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border-default);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ============================================================
   ACCESSIBILITÉ — reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header, .cta-bar, .nav-toggle, .hero--immersive__scroll, .theme-toggle { display: none !important; }
}

/* ============================================================
   COMPOSANTS D'INTERACTION (toasts, modales, tooltips)
   ============================================================ */

/* ---------- Toasts ---------- */
#toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 380px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  color: var(--text-primary);
  pointer-events: auto;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity var(--duration-base) var(--ease-out),
              transform var(--duration-base) var(--ease-spring);
}
.toast--visible { opacity: 1; transform: translateX(0); }
.toast--leaving { opacity: 0; transform: translateX(20px); }
.toast--success { border-left-color: var(--success); }
.toast--error   { border-left-color: var(--danger); }
.toast--info    { border-left-color: var(--info); }
.toast--warning { border-left-color: var(--warning); }
.toast__icon {
  width: 22px; height: 22px; border-radius: var(--radius-full);
  display: grid; place-items: center; flex-shrink: 0;
  font-size: 12px; font-weight: var(--fw-bold); color: #fff;
}
.toast--success .toast__icon { background: var(--success); }
.toast--error .toast__icon   { background: var(--danger); }
.toast--info .toast__icon    { background: var(--info); }
.toast--warning .toast__icon { background: var(--warning); }
.toast__msg { flex: 1; }
.toast__close {
  width: 24px; height: 24px; border-radius: var(--radius-sm);
  color: var(--text-tertiary); font-size: var(--text-md);
  display: grid; place-items: center; flex-shrink: 0;
}
.toast__close:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ---------- Modale ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(6px);
  z-index: var(--z-modal);
  display: grid; place-items: center;
  padding: var(--space-6);
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease-out);
}
.modal-overlay--visible { opacity: 1; }
.modal-overlay--leaving { opacity: 0; }
.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  transform: scale(0.96);
  transition: transform var(--duration-base) var(--ease-spring);
}
.modal-overlay--visible .modal { transform: scale(1); }
.modal--sm { max-width: 420px; }
.modal--lg { max-width: 720px; }
.modal__header {
  padding: var(--space-6) var(--space-6) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}
.modal__header h3 { margin: 0; font-size: var(--text-lg); }
.modal__body { padding: var(--space-6); }
.modal__body p { color: var(--text-secondary); font-size: var(--text-sm); }
.modal__footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-subtle);
  display: flex; gap: var(--space-3); justify-content: flex-end;
}

/* ---------- Tooltip ---------- */
.tooltip {
  position: absolute;
  z-index: var(--z-dropdown);
  padding: var(--space-2) var(--space-3);
  background: var(--text-primary);
  color: var(--bg-surface);
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--duration-fast);
  box-shadow: var(--shadow-md);
}
.tooltip--visible { opacity: 1; }
.tooltip::after {
  content: ""; position: absolute;
  bottom: -4px; left: 50%; transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--text-primary);
}

/* ---------- Indicateur de saisie (formulaire devis) ---------- */
.upload-preview {
  display: flex; flex-wrap: wrap; gap: var(--space-2);
  margin-top: var(--space-3);
}
.upload-preview__item {
  position: relative; width: 72px; height: 72px;
  border-radius: var(--radius-md); overflow: hidden;
  border: 1px solid var(--border-default);
}
.upload-preview__item img { width: 100%; height: 100%; object-fit: cover; }
.upload-preview__remove {
  position: absolute; top: 2px; right: 2px;
  width: 20px; height: 20px; border-radius: var(--radius-full);
  background: rgba(0,0,0,0.6); color: #fff;
  display: grid; place-items: center; font-size: 12px;
}

/* ---------- Onboarding / bannière de bienvenue ---------- */
.onboarding-banner {
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  background: linear-gradient(135deg, var(--accent-subtle) 0%, var(--bg-surface) 100%);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-6);
}
.onboarding-banner__icon {
  width: 48px; height: 48px; border-radius: var(--radius-md);
  background: var(--accent); color: var(--accent-contrast);
  display: grid; place-items: center; flex-shrink: 0; font-size: 24px;
}
.onboarding-banner h2 { font-size: var(--text-md); margin: 0 0 var(--space-1); }
.onboarding-banner p { margin: 0; font-size: var(--text-sm); color: var(--text-secondary); }

/* ---------- Barre de recherche ---------- */
.search-box {
  position: relative; width: 100%; max-width: 320px;
}
.search-box input {
  width: 100%; height: 40px;
  padding: 0 var(--space-4) 0 var(--space-10);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  font-size: var(--text-sm);
}
.search-box input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }
.search-box__icon {
  position: absolute; left: var(--space-4); top: 50%; transform: translateY(-50%);
  color: var(--text-tertiary); pointer-events: none;
}

/* ---------- Indicateur "Pas de résultat" (après recherche) ---------- */
.no-result {
  text-align: center; padding: var(--space-12) var(--space-6);
  color: var(--text-tertiary);
}

/* ---------- Toast responsive ---------- */
@media (max-width: 480px) {
  #toast-container { left: var(--space-4); right: var(--space-4); bottom: var(--space-4); max-width: none; }
}
