/* ═══════════════════════════════════════════════════════
   CABINET DE CURIOSITÉS — DESIGN SYSTEM — THÈME LEGO
   ═══════════════════════════════════════════════════════ */


/* ── CSS VARIABLES ── */
:root {
  /* Couleurs LEGO adoucies (utilisées en touches discrètes) */
  --brick-red:    #b4504b;
  --brick-yellow: #d6b25a;
  --brick-blue:   #4a77b4;
  --brick-green:  #4f9270;
  --brick-orange: #c98a52;

  /* Mode sombre (défaut) : ardoise bleu-gris, accent ambre doux */
  --accent-rgb: 214, 178, 90;
  --border-rgb: 255, 255, 255;
  --stud-dot:   rgba(255, 255, 255, 0.025);
  --on-accent:  #1c1a14;

  --bg-primary:    #11151d;
  --bg-secondary:  #161b25;
  --bg-surface:    #1c2230;
  --bg-card:       #1e2534;
  --bg-glass:      rgba(17, 21, 29, 0.88);
  --bg-overlay:    rgba(10, 13, 19, 0.88);

  --border-subtle: rgba(var(--border-rgb), 0.07);
  --border-mid:    rgba(var(--border-rgb), 0.14);
  --border-accent: rgba(var(--accent-rgb), 0.55);

  --text-primary:   #e9e6dd;
  --text-secondary: #c3c8d4;
  --text-muted:     #8791a5;
  --text-link:      #d6b25a;

  --accent-violet:  #d6b25a;   /* accent principal = ambre doux */
  --accent-gold:    #c9a24a;
  --accent-rose:    #d87a7d;
  --accent-teal:    #6dbb92;
  --accent-blue:    #7fa6d8;
  --accent-orange:  #d09a64;
  --accent-red:     #d9726e;

  --shadow-sm:   0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:   0 4px 14px rgba(0,0,0,0.35);
  --shadow-lg:   0 10px 30px rgba(0,0,0,0.4);
  --shadow-glow: none;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  --font-display: 'Lilita One', 'Fredoka', system-ui, sans-serif;
  --font-body:    'Fredoka', system-ui, sans-serif;
  --font-mono:    'DM Mono', monospace;

  --nav-height: 64px;
  --transition: 0.2s cubic-bezier(.4,0,.2,1);
}

/* Mode clair : papier chaud, accent brique atténué */
[data-theme="light"] {
  --accent-rgb: 168, 66, 60;
  --border-rgb: 0, 0, 0;
  --stud-dot:   rgba(0, 0, 0, 0.025);
  --on-accent:  #ffffff;

  --bg-primary:    #f6f4ef;
  --bg-secondary:  #eeebe3;
  --bg-surface:    #e6e2d7;
  --bg-card:       #ffffff;
  --bg-glass:      rgba(246, 244, 239, 0.9);
  --bg-overlay:    rgba(246, 244, 239, 0.92);

  --border-subtle: rgba(var(--border-rgb), 0.07);
  --border-mid:    rgba(var(--border-rgb), 0.14);
  --border-accent: rgba(var(--accent-rgb), 0.55);

  --text-primary:   #23221f;
  --text-secondary: #46443e;
  --text-muted:     #7d7a70;
  --text-link:      #2f5f9e;

  --accent-violet:  #a8423c;
  --accent-gold:    #a67a1c;
  --accent-rose:    #a8385f;
  --accent-teal:    #2f7a52;
  --accent-blue:    #2f5f9e;
  --accent-orange:  #b46a24;
  --accent-red:     #a83a36;

  --shadow-sm:   0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:   0 4px 14px rgba(0,0,0,0.1);
  --shadow-lg:   0 10px 30px rgba(0,0,0,0.14);
  --shadow-glow: none;
}

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  padding-top: var(--nav-height);
  transition: background var(--transition), color var(--transition);
  line-height: 1.6;
}

/* Noise grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

/* Background radial glow */
body::after {
  content: '';
  position: fixed;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 80vw;
  height: 60vw;
  background: radial-gradient(ellipse, rgba(var(--accent-rgb),0.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

[data-theme="light"] body::after {
  background: radial-gradient(ellipse, rgba(var(--accent-rgb),0.06) 0%, transparent 70%);
}

/* ── TYPOGRAPHY ── */
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; letter-spacing: 0.02em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.15; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1.25; }
h3 { font-size: 1.15rem; }

a { color: var(--text-link); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-violet); }

/* ── NAVIGATION ── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  z-index: 900;
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  transition: background var(--transition);
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-style: italic;
  color: var(--accent-violet);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent-violet);
  background: rgba(var(--accent-rgb),0.1);
  border-color: var(--border-mid);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── BREADCRUMB NAV (fallback for non-auth) ── */
.crumbs {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}

/* ── HERO / INTRO ── */
.hero {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 80px auto 60px;
  padding: 60px 40px;
  text-align: center;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-violet);
  margin-bottom: 20px;
  opacity: 0.9;
}

.hero h1 {
  color: var(--text-primary);
  margin-bottom: 18px;
}

.hero h1 em {
  color: var(--accent-violet);
  font-style: italic;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 48px;
  line-height: 1.75;
}

/* ── COLLECTION GRID (homepage) ── */
.collections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 20px;
}

.collection-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.35s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.collection-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.35s;
}

.collection-card:hover::before { opacity: 1; }
.collection-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.card-pez::before    { background: radial-gradient(ellipse at 50% 0%, rgba(244,127,172,0.12) 0%, transparent 70%); }
.card-piece::before  { background: radial-gradient(ellipse at 50% 0%, rgba(232,200,122,0.12) 0%, transparent 70%); }
.card-bd::before     { background: radial-gradient(ellipse at 50% 0%, rgba(127,179,245,0.12) 0%, transparent 70%); }
.card-dvd::before    { background: radial-gradient(ellipse at 50% 0%, rgba(111,214,200,0.12) 0%, transparent 70%); }

.card-pez:hover    { border-color: rgba(244,127,172,0.4); }
.card-piece:hover  { border-color: rgba(232,200,122,0.4); }
.card-bd:hover     { border-color: rgba(127,179,245,0.4); }
.card-dvd:hover    { border-color: rgba(111,214,200,0.4); }

.card-icon {
  font-size: 2.8rem;
  line-height: 1;
  display: block;
  transition: transform 0.35s cubic-bezier(.4,0,.2,1);
}

.collection-card:hover .card-icon {
  transform: scale(1.15) rotate(-3deg);
}

.card-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text-primary);
}

.card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.card-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  font-weight: 500;
}

.card-pez   .card-badge { background: rgba(244,127,172,0.15); color: var(--accent-rose); }
.card-piece .card-badge { background: rgba(232,200,122,0.15); color: var(--accent-gold); }
.card-bd    .card-badge { background: rgba(127,179,245,0.15); color: var(--accent-blue); }
.card-dvd   .card-badge { background: rgba(111,214,200,0.15); color: var(--accent-teal); }

/* ── SEARCH BAR ── */
.search-bar-container {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 820px;
  margin: 36px auto 28px;
  padding: 0 24px;
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
}

.search-container {
  flex: 1;
  min-width: 280px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}

#searchInput {
  width: 100%;
  padding: 14px 20px 14px 44px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-pill);
  outline: none;
  transition: all var(--transition);
}

#searchInput::placeholder { color: var(--text-muted); }
#searchInput:focus {
  border-color: var(--accent-violet);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb),0.12), var(--shadow-sm);
  background: var(--bg-surface);
}

.total-count {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.total-count .count-num {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--accent-gold);
}

/* ── COLLECTION SECTION ── */
.collection {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto 60px;
  padding: 0 24px;
}

.collection-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.collection-header h2 {
  color: var(--text-primary);
}

.category-count {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 2px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
}

/* ── GALLERY GRID ── */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

/* ── CARTE (standard) ── */
.carte {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 14px 14px;
  transition: all 0.3s cubic-bezier(.4,0,.2,1);
  position: relative;
  overflow: hidden;
}

.carte::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse at 50% -20%, rgba(var(--accent-rgb),0.08) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.carte:hover::after { opacity: 1; }
.carte:hover {
  transform: translateY(-4px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.carte img {
  width: 140px;
  height: 210px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
  display: block;
}

.carte img:hover { transform: scale(1.04); }

.carte h3 {
  font-size: 0.95rem;
  color: var(--text-primary);
  text-align: center;
  line-height: 1.4;
  margin-top: 2px;
}

/* BD specific */
.carte-bd img {
  height: 225px;
  object-fit: cover;
  width: 150px;
}

/* DVD specific */
.carte-dvd img {
  height: 220px;
  width: 150px;
  object-fit: cover;
}

/* Numero badge */
.badge-numero {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.badge-bd  { background: rgba(127,179,245,0.15); color: var(--accent-blue); border: 1px solid rgba(127,179,245,0.25); }
.badge-dvd { background: rgba(111,214,200,0.15); color: var(--accent-teal); border: 1px solid rgba(111,214,200,0.25); }

.carte .meta-line {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

.carte .meta-line span { margin: 0 4px; }

/* ── DELETE BUTTON ── */
.btn-delete {
  display: none;
  padding: 5px 12px;
  background: transparent;
  color: var(--accent-red);
  border: 1px solid rgba(244,106,106,0.25);
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 4px;
}

.carte:hover .btn-delete { display: block; }

.btn-delete:hover {
  background: rgba(244,106,106,0.12);
  border-color: rgba(244,106,106,0.5);
  transform: translateY(-1px);
}

.carte-actions {
  display: none;
  gap: 8px;
  margin-top: 4px;
}

.carte:hover .carte-actions {
  display: flex;
}

.btn-edit {
  padding: 5px 12px;
  background: transparent;
  color: var(--accent-violet);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  display: inline-block;
}

.btn-edit:hover {
  background: rgba(var(--accent-rgb), 0.12);
  border-color: var(--accent-violet);
  transform: translateY(-1px);
}

/* ── POPUP IMAGE ── */
.popup {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(16px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1100;
  cursor: zoom-out;
  padding: 40px;
}

.popup img {
  max-width: min(85vw, 640px);
  max-height: 85vh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-mid);
  animation: popupIn 0.25s cubic-bezier(.4,0,.2,1);
}

@keyframes popupIn {
  from { transform: scale(0.9); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* ── DELETE CONFIRM POPUP ── */
.delete-popup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(10px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1200;
  padding: 20px;
}

.delete-popup-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-xl);
  padding: 40px 44px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: popupIn 0.3s cubic-bezier(.4,0,.2,1);
}

.delete-popup-icon { font-size: 3rem; margin-bottom: 12px; }

.delete-popup-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.delete-popup-message {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.65;
  margin-bottom: 8px;
}

.delete-popup-message strong {
  color: var(--accent-violet);
}

.delete-popup-warning {
  font-size: 0.82rem;
  color: var(--accent-red);
  margin-bottom: 28px;
  font-style: italic;
}

.delete-popup-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-cancel {
  padding: 10px 24px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-cancel:hover {
  background: var(--bg-card);
  border-color: var(--border-accent);
  color: var(--text-primary);
}

.btn-confirm {
  padding: 10px 24px;
  background: rgba(244,106,106,0.15);
  color: var(--accent-red);
  border: 1px solid rgba(244,106,106,0.35);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-confirm:hover {
  background: rgba(244,106,106,0.25);
  border-color: rgba(244,106,106,0.6);
  transform: translateY(-1px);
}

/* ── FORMULAIRE ── */
.page-header {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 48px 24px 0;
  margin-bottom: 32px;
}

.page-header h1 {
  color: var(--text-primary);
  margin-bottom: 10px;
}

.page-header h1 em { color: var(--accent-violet); font-style: italic; }

.page-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.type-selector {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 600px;
  margin: 0 auto 32px;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.type-btn {
  padding: 9px 22px;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.type-btn:hover {
  border-color: var(--border-accent);
  color: var(--text-primary);
  background: var(--bg-surface);
}

.type-btn.active {
  background: rgba(var(--accent-rgb),0.15);
  border-color: var(--accent-violet);
  color: var(--accent-violet);
  font-weight: 600;
}

.formulaire {
  max-width: 520px;
  margin: 0 auto 60px;
  padding: 36px 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  z-index: 1;
}

.formulaire .form-section-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--text-primary);
  text-align: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.formulaire input[type="text"],
.formulaire input[type="number"],
.formulaire input[type="password"],
.formulaire select {
  padding: 11px 16px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--transition);
  -webkit-appearance: none;
}

.formulaire input:focus,
.formulaire select:focus {
  border-color: var(--accent-violet);
  background: var(--bg-secondary);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb),0.1);
}

.formulaire input::placeholder { color: var(--text-muted); }

.formulaire input[type="file"] {
  padding: 10px 16px;
  font-size: 0.88rem;
  font-family: var(--font-body);
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px dashed var(--border-mid);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--transition);
}

.formulaire input[type="file"]:hover {
  border-color: var(--accent-violet);
}

.formulaire input[type="file"]::file-selector-button {
  padding: 6px 14px;
  background: rgba(var(--accent-rgb),0.12);
  color: var(--accent-violet);
  border: 1px solid rgba(var(--accent-rgb),0.3);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  margin-right: 10px;
  transition: all var(--transition);
}

.formulaire input[type="file"]::file-selector-button:hover {
  background: rgba(var(--accent-rgb),0.22);
}

.btn-primary {
  padding: 14px 28px;
  background: rgba(var(--accent-rgb),0.15);
  color: var(--accent-violet);
  border: 1px solid rgba(var(--accent-rgb),0.4);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.02em;
}

.btn-primary:hover {
  background: rgba(var(--accent-rgb),0.25);
  border-color: var(--accent-violet);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(var(--accent-rgb),0.25);
}

/* ── LOGIN ── */
.login-wrapper {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  z-index: 1;
}

.login-card {
  max-width: 400px;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-icon {
  font-size: 2.5rem;
  margin-bottom: 20px;
}

.login-card h2 {
  color: var(--text-primary);
  margin-bottom: 8px;
}

.login-card p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 32px;
}

.error-msg {
  padding: 10px 16px;
  background: rgba(244,106,106,0.1);
  border: 1px solid rgba(244,106,106,0.25);
  border-radius: var(--radius-md);
  color: var(--accent-red);
  font-size: 0.88rem;
  margin-bottom: 16px;
  text-align: left;
}

/* ── NOTIFICATIONS ── */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 2000;
  padding: 14px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s cubic-bezier(.4,0,.2,1);
  max-width: 360px;
}

.toast.success { border-color: rgba(111,214,200,0.4); }
.toast.success::before { content: '✓'; color: var(--accent-teal); font-weight: 700; }

@keyframes toastIn {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── SORT & FILTER ROW ── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 820px;
  margin: 0 auto 16px;
  padding: 0 24px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.toolbar-label {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sort-btn {
  padding: 6px 14px;
  font-size: 0.8rem;
  font-family: var(--font-body);
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition);
}

.sort-btn:hover,
.sort-btn.active {
  color: var(--accent-violet);
  border-color: var(--border-accent);
  background: rgba(var(--accent-rgb),0.08);
}

/* ── STATS PAGE (homepage stats) ── */
.stats-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  max-width: 700px;
  margin: 48px auto 0;
  padding: 0 24px;
  flex-wrap: wrap;
}

.stat-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.stat-chip .stat-n {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--text-primary);
}

/* ── BOUTON CONNEXION ── */
.btn-login {
  padding: 7px 16px;
  background: rgba(var(--accent-rgb),0.1);
  color: var(--accent-violet);
  border: 1px solid rgba(var(--accent-rgb),0.3);
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-family: var(--font-body);
  text-decoration: none;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-login:hover {
  background: rgba(var(--accent-rgb),0.2);
  border-color: var(--accent-violet);
  color: var(--accent-violet);
  transform: translateY(-1px);
}

/* ── BOUTON DECONNEXION ── */
.btn-logout {
  padding: 7px 16px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-family: var(--font-body);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-logout:hover {
  color: var(--accent-red);
  border-color: rgba(244,106,106,0.35);
  background: rgba(244,106,106,0.06);
}

/* ── PAGE TITLE BAR ── */
.page-title-bar {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 40px auto 0;
  padding: 0 24px 28px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.page-title-bar h1 {
  color: var(--text-primary);
  line-height: 1.1;
}

.page-title-bar h1 em { color: var(--accent-violet); font-style: italic; }

.page-title-bar .nav-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .nav { padding: 0 16px; }
  .nav-brand { font-size: 1rem; }
  .nav-links a { font-size: 0.78rem; padding: 5px 10px; }
  .hero { padding: 40px 20px; margin-top: 40px; }
  .formulaire { padding: 28px 24px; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .search-bar-container { flex-direction: column; }
  .total-count { width: 100%; justify-content: center; }
  .delete-popup-content { padding: 28px 24px; }
}

@media (max-width: 480px) {
  .collections-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .carte img { width: 100%; height: 180px; }
  .carte-bd img, .carte-dvd img { height: 180px; width: 100%; }
}

/* ── UTILITIES ── */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-32 { margin-top: 32px; }

/* Divider */
.divider {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-violet), transparent);
  margin: 24px auto;
}

/* Section spacer */
.section-spacer { height: 60px; }

/* Fade in animation */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
  animation: fadeInUp 0.5s cubic-bezier(.4,0,.2,1) both;
}

.fade-in-up:nth-child(2)  { animation-delay: 0.05s; }
.fade-in-up:nth-child(3)  { animation-delay: 0.10s; }
.fade-in-up:nth-child(4)  { animation-delay: 0.15s; }
.fade-in-up:nth-child(5)  { animation-delay: 0.20s; }

/* Stagger gallery cards */
.gallery .carte {
  animation: fadeInUp 0.4s cubic-bezier(.4,0,.2,1) both;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-accent); }

/* ═══════════════════════════════════════════════════════
   AJOUT — DVD Disney : état "non possédé" (grisé)
   ═══════════════════════════════════════════════════════ */

.carte.non-possede {
  opacity: 0.35;
  filter: grayscale(1);
}

.carte.non-possede:hover {
  opacity: 0.55;
  transform: none;
  box-shadow: none;
  border-color: var(--border-subtle);
}

.carte.non-possede::after { display: none; }

.placeholder-manquant {
  width: 150px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px dashed var(--border-mid);
  border-radius: var(--radius-sm);
  font-size: 2rem;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════
   AJOUT — Toggle "Possédé ?" (switch stylé)
   ═══════════════════════════════════════════════════════ */

.toggle-possession {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 28px;
}

.toggle-possession input[type="checkbox"] {
  position: absolute;
  inset: 0;
  width: 52px;
  height: 28px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.toggle-slider {
  position: relative;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-pill);
  transition: all var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text-muted);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.toggle-possession input[type="checkbox"]:checked ~ .toggle-slider {
  background: rgba(var(--accent-rgb), 0.22);
  border-color: var(--accent-violet);
}

.toggle-possession input[type="checkbox"]:checked ~ .toggle-slider::before {
  transform: translateX(24px);
  background: var(--accent-violet);
  box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.4);
}

.toggle-possession input[type="checkbox"]:focus-visible ~ .toggle-slider {
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.2);
}

.toggle-possession input[type="checkbox"]:hover ~ .toggle-slider {
  border-color: var(--border-accent);
}

.toggle-label {
  display: none;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  user-select: none;
  transition: color var(--transition);
}

.toggle-possession input[type="checkbox"]:checked ~ .toggle-yes {
  display: inline;
  color: var(--accent-teal);
}

.toggle-possession input[type="checkbox"]:not(:checked) ~ .toggle-no {
  display: inline;
  color: var(--accent-red);
}

/* ═══════════════════════════════════════════════════════
   AJOUT — Toggle de thème (clair / sombre) dans la nav
   ═══════════════════════════════════════════════════════ */

.theme-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  border: 1px solid var(--border-mid);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.theme-toggle::before {
  content: '☾';
  position: absolute;
  top: 1px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-violet);
  color: var(--bg-primary);
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] .theme-toggle::before {
  content: '☀';
  transform: translateX(20px);
  background: var(--accent-gold);
}

.theme-toggle:hover {
  border-color: var(--border-accent);
}

.theme-toggle-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  white-space: nowrap;
}
/* ═══════════════════════════════════════════════════════
   AJOUT — Recettes de cuisine
   ═══════════════════════════════════════════════════════ */

.carte-recette {
  max-width: 320px;
  align-items: stretch;
  text-align: left;
  padding: 18px 20px 20px;
}

.carte-recette img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
}

.carte-recette h3 {
  text-align: left;
  font-size: 1.15rem;
  margin-top: 4px;
}

.recette-section { width: 100%; }

.recette-section h4 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 6px;
}

.recette-ingredients,
.recette-etapes {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.recette-ingredients li::before {
  content: '•';
  color: var(--accent-violet);
  margin-right: 8px;
}

.recette-etapes { counter-reset: etape; }

.recette-etapes li {
  counter-increment: etape;
  display: flex;
  gap: 8px;
}

.recette-etapes li::before {
  content: counter(etape);
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(var(--accent-rgb),0.15);
  color: var(--accent-violet);
  font-size: 0.72rem;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Carte collection (page d'accueil) — optionnel si tu ajoutes une tuile Recettes */
.card-recette::before { background: radial-gradient(ellipse at 50% 0%, rgba(232,200,122,0.12) 0%, transparent 70%); }
.card-recette:hover { border-color: rgba(232,200,122,0.4); }
.card-recette .card-badge { background: rgba(232,200,122,0.15); color: var(--accent-gold); }

/* ── FORMULAIRE — lignes dynamiques (ingrédients / étapes) ── */
.dynamic-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dynamic-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.dynamic-row input[type="text"] { flex: 1; }

.btn-remove-row {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--accent-red);
  border: 1px solid rgba(244,106,106,0.25);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all var(--transition);
}

.btn-remove-row:hover {
  background: rgba(244,106,106,0.12);
  border-color: rgba(244,106,106,0.5);
}

.btn-add-row {
  margin-top: 4px;
  align-self: flex-start;
  padding: 7px 16px;
  background: rgba(var(--accent-rgb),0.1);
  color: var(--accent-violet);
  border: 1px dashed rgba(var(--accent-rgb),0.35);
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-add-row:hover {
  background: rgba(var(--accent-rgb),0.18);
  border-color: var(--accent-violet);
}

/* Grille dédiée : une seule colonne sur mobile, deux sur desktop,
   au lieu des vignettes étroites de 180px utilisées pour pez/bd/dvd */
.gallery-recette {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}
 
@media (min-width: 860px) {
  .gallery-recette {
    grid-template-columns: repeat(2, 1fr);
  }
}
 
/* La carte recette prend toute la largeur de sa colonne,
   texte aligné à gauche (pas centré comme les cartes-image) */
.carte-recette {
  max-width: none;
  width: 100%;
  align-items: stretch;
  text-align: left;
  padding: 26px 26px 22px;
  gap: 14px;
}
 
.carte-recette img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: var(--radius-md);
  cursor: pointer;
}
 
.carte-recette h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  text-align: left;
  color: var(--text-primary);
  margin: 4px 0 2px;
  line-height: 1.25;
}
 
/* Section ingrédients / étapes */
.recette-section {
  width: 100%;
}
 
.recette-section h4 {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent-teal);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border-subtle);
}
 
/* Ingrédients : liste à puces discrètes */
.recette-ingredients {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
 
.recette-ingredients li {
  position: relative;
  padding-left: 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
 
.recette-ingredients li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-teal);
}
 
/* Étapes : liste numérotée avec pastilles rondes */
.recette-etapes {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  counter-reset: etape;
}
 
.recette-etapes li {
  position: relative;
  padding-left: 36px;
  font-size: 0.92rem;
  color: var(--text-primary);
  line-height: 1.65;
  counter-increment: etape;
}
 
.recette-etapes li::before {
  content: counter(etape);
  position: absolute;
  left: 0;
  top: -1px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(111, 214, 200, 0.15);
  border: 1px solid rgba(111, 214, 200, 0.35);
  color: var(--accent-teal);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
 
/* Actions (modifier / supprimer) alignées à gauche, toujours visibles
   (contrairement aux cartes-image où elles n'apparaissent qu'au survol) */
.carte-recette .carte-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 6px;
}
 
/* Responsive : image plus basse sur mobile */
@media (max-width: 480px) {
  .carte-recette img {
    height: 180px;
  }
}
/* ═══════════════════════════════════════════════════════
   AJOUT — Confort tactile & agrandissement mobile
   ═══════════════════════════════════════════════════════ */

@media (max-width: 768px) {

  /* Base légèrement plus grande : fait grandir proportionnellement
     tout ce qui est en rem (textes, badges, icônes...) */
  html { font-size: 17.5px; }

  /* Navigation : on ne cache plus les liens, on les fait passer
     à la ligne et on agrandit les zones cliquables */
  .nav {
    height: auto;
    min-height: var(--nav-height);
    padding: 14px 16px;
    flex-wrap: wrap;
    row-gap: 10px;
  }

  .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    order: 3;
  }

  .nav-links a {
    font-size: 1.02rem;
    padding: 11px 16px;
  }

  .nav-brand { font-size: 1.25rem; }

  .nav-right { gap: 14px; }

  .theme-toggle { width: 50px; height: 28px; }
  .theme-toggle::before { width: 24px; height: 24px; font-size: 0.8rem; }
  [data-theme="light"] .theme-toggle::before { transform: translateX(22px); }

  .btn-login, .btn-logout {
    font-size: 0.9rem;
    padding: 9px 16px;
  }

  /* Boutons de type / filtres : plus grands, plus faciles à toucher */
  .type-btn {
    font-size: 0.95rem;
    padding: 11px 20px;
  }

  .sort-btn {
    font-size: 0.88rem;
    padding: 9px 16px;
  }

  /* Formulaire */
  .form-group label { font-size: 0.88rem; }

  .formulaire input[type="text"],
  .formulaire input[type="number"],
  .formulaire input[type="password"],
  .formulaire select,
  .formulaire input[type="file"] {
    font-size: 1rem;
    padding: 13px 16px;
  }

  .btn-primary {
    font-size: 1.02rem;
    padding: 16px 28px;
  }

  /* Toggle "Possédé ?" : switch plus grand, plus facile à toucher */
  .toggle-possession { min-height: 34px; }
  .toggle-possession input[type="checkbox"] { width: 60px; height: 34px; }
  .toggle-slider { width: 60px; height: 34px; }
  .toggle-slider::before { width: 28px; height: 28px; }
  .toggle-possession input[type="checkbox"]:checked ~ .toggle-slider::before {
    transform: translateX(26px);
  }
  .toggle-label { font-size: 0.98rem; }

  .btn-add-row, .btn-remove-row {
    font-size: 0.9rem;
    padding: 9px 16px;
  }
  .btn-remove-row { width: 38px; height: 38px; }

  /* Cartes : actions (Modifier / Supprimer) toujours visibles au tactile,
     car il n'y a pas de survol sur téléphone */
  .carte-actions {
    display: flex !important;
    gap: 10px;
    margin-top: 8px;
  }

  .btn-edit, .btn-delete {
    font-size: 0.85rem;
    padding: 8px 16px;
  }

  .carte h3 { font-size: 1.05rem; }
  .carte .meta-line { font-size: 0.85rem; }
  .badge-numero { font-size: 0.8rem; padding: 4px 12px; }

  .recette-ingredients, .recette-etapes { font-size: 0.92rem; }
  .recette-section h4 { font-size: 0.8rem; }

  /* Barre de recherche */
  #searchInput { font-size: 1rem; padding: 15px 20px 15px 46px; }
  .total-count { font-size: 0.95rem; }

  .gallery { gap: 22px; }

  .collection-card { padding: 28px 20px; }
  .card-name { font-size: 1.25rem; }
  .card-desc { font-size: 0.85rem; }
  .card-badge { font-size: 0.78rem; padding: 4px 14px; }
}

@media (max-width: 480px) {
  .carte img { height: 200px; }
  .carte-bd img, .carte-dvd img { height: 200px; }
  .placeholder-manquant { width: 100%; height: 200px; }
}

/* ═══════════════════════════════════════════════════════
   AJOUT — Grilles spécifiques par collection
   ═══════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  /* Recettes : une seule par ligne, uniquement sur mobile */
  .gallery-recette {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  /* Pez et pièces : 3 par ligne sur mobile */
  .gallery-pez,
  .gallery-piece {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
}

@media (max-width: 480px) {
  /* Cartes plus compactes pour bien tenir à 3 sur petit écran */
  .gallery-pez .carte img,
  .gallery-piece .carte img {
    height: 130px;
  }

  .gallery-pez .carte h3,
  .gallery-piece .carte h3 {
    font-size: 0.8rem;
  }

  .gallery-pez .carte,
  .gallery-piece .carte {
    padding: 10px 6px 8px;
    gap: 6px;
  }
}
/* ═══════════════════════════════════════════════════════
   AJOUT — Filtres JS (recherche / J'ai / Il me manque)
   ═══════════════════════════════════════════════════════ */

.is-hidden { display: none !important; }

.carte img[role="button"]:focus-visible,
.nav a:focus-visible,
.btn-primary:focus-visible,
.type-btn:focus-visible {
  outline: 2px solid var(--accent-violet);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ═══════════════════════════════════════════════════════
   AJOUT — Impression (surtout pour imprimer une recette)
   ═══════════════════════════════════════════════════════ */
@media print {
  .nav, .search-bar-container, .type-selector, .toolbar, .page-title-bar,
  .carte-actions, .no-print, .popup, .delete-popup, .toast, .total-count { display: none !important; }

  body, html { background: #fff !important; color: #000 !important; }
  body::before, body::after { display: none !important; }

  /* Impression d'une seule recette (bouton « Imprimer ») */
  body.printing-recipe .carte:not(.print-target),
  body.printing-recipe .collection-header { display: none !important; }

  .carte, .carte-recette {
    break-inside: avoid;
    box-shadow: none !important;
    background: #fff !important;
    border: 1px solid #ccc !important;
    color: #000 !important;
  }
  .carte *, .carte-recette * { color: #000 !important; }
  .carte img { max-height: 220px; width: auto; }
}


/* ═══════════════════════════════════════════════════════
   THÈME LEGO — version sobre (touches de couleur discrètes)
   ═══════════════════════════════════════════════════════ */

/* Fond : tenons à peine visibles, plus de halo */
body::before {
  background-image: radial-gradient(circle at 50% 50%, var(--stud-dot) 0 7px, transparent 8px);
  background-size: 44px 44px;
  opacity: 1;
}
body::after { display: none; }

h1, h2, h3 { letter-spacing: 0.02em; }
body { font-weight: 400; }

/* ── NAV : barre neutre ── */
.nav {
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border-mid);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.nav-brand {
  font-style: normal;
  font-size: 1.15rem;
  color: var(--accent-violet);
  background: none;
  border: 0;
  padding: 0;
  box-shadow: none;
}
.nav-brand:hover { color: var(--text-primary); transform: none; }
.nav-links a { color: var(--text-secondary); }
.nav-links a:hover {
  color: var(--text-primary);
  background: rgba(var(--border-rgb), 0.06);
  border-color: transparent;
}
.nav-links a.active {
  color: var(--accent-violet);
  background: rgba(var(--accent-rgb), 0.12);
  border-color: transparent;
  box-shadow: none;
}

/* ── HERO ── */
.hero-eyebrow { color: var(--text-muted); }
.hero h1 em {
  font-style: normal;
  color: var(--accent-violet);
  text-shadow: none;
}
.page-header h1 em, .page-title-bar h1 em { font-style: normal; }

/* ── TUILES D'ACCUEIL : cartes plates, liseré coloré ── */
.collection-card {
  margin-top: 0;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-mid);
  border-top: 3px solid var(--tile, var(--brick-yellow));
  border-radius: var(--radius-lg);
  padding: 32px 24px 28px;
  box-shadow: var(--shadow-sm);
}
.collection-card::before, .collection-card::after { display: none; }
.collection-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-accent);
  border-top-color: var(--tile, var(--brick-yellow));
  box-shadow: var(--shadow-md);
}
.collection-card:active { transform: none; }

.card-pez   { --tile: var(--brick-red); }
.card-piece { --tile: var(--brick-yellow); }
.card-bd    { --tile: var(--brick-blue); }
.card-dvd   { --tile: var(--brick-green); }
.card-pez, .card-piece, .card-bd, .card-dvd { background: var(--bg-card); color: var(--text-primary); }
.card-pez .card-name, .card-piece .card-name, .card-bd .card-name, .card-dvd .card-name { color: var(--text-primary); }
.card-pez .card-desc, .card-piece .card-desc, .card-bd .card-desc, .card-dvd .card-desc { color: var(--text-muted); }
.card-pez .card-badge, .card-piece .card-badge, .card-bd .card-badge, .card-dvd .card-badge {
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent-violet);
}
.card-badge { font-weight: 500; }

.stat-chip { border: 1px solid var(--border-mid); box-shadow: none; }
.stat-chip span:first-child { color: var(--accent-violet); }

/* ── CARTES (sets / pièces) ── */
.carte {
  overflow: hidden;
  margin-top: 0;
  border: 1px solid var(--border-mid);
  border-top: 3px solid var(--stud, var(--brick-yellow));
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.carte::before { display: none; }
.carte:hover {
  transform: translateY(-2px);
  border-color: var(--border-accent);
  border-top-color: var(--stud, var(--brick-yellow));
  box-shadow: var(--shadow-md);
}
.gallery .carte:nth-child(4n+1) { --stud: var(--brick-red); }
.gallery .carte:nth-child(4n+2) { --stud: var(--brick-yellow); }
.gallery .carte:nth-child(4n+3) { --stud: var(--brick-blue); }
.gallery .carte:nth-child(4n+4) { --stud: var(--brick-green); }
.carte.non-possede, .carte.non-possede:hover { box-shadow: none; }

.badge-bd, .badge-dvd {
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--accent-violet);
  border: 0;
  font-weight: 500;
  box-shadow: none;
}

/* ── EN-TÊTES DE SECTION ── */
.collection-header { border-bottom: 1px solid var(--border-mid); }
.category-count {
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--accent-violet);
  border: 0;
  font-weight: 500;
  box-shadow: none;
}

/* ── BOUTONS : plats ── */
.btn-primary {
  background: var(--accent-violet);
  color: var(--on-accent);
  border: 0;
  border-radius: var(--radius-md);
  box-shadow: none;
  font-weight: 500;
}
.btn-primary:hover {
  background: var(--accent-violet);
  filter: brightness(1.08);
  border: 0;
  transform: none;
  box-shadow: var(--shadow-sm);
}
.btn-primary:active { transform: translateY(1px); box-shadow: none; }

.type-btn, .sort-btn { border-width: 1px; box-shadow: none; }
.type-btn.active, .sort-btn.active {
  background: rgba(var(--accent-rgb), 0.14);
  border-color: var(--border-accent);
  color: var(--accent-violet);
}
.type-btn:active, .sort-btn:active { transform: none; box-shadow: none; }

.btn-confirm { background: var(--accent-red); color: #fff; border: 0; box-shadow: none; }
.btn-confirm:hover { filter: brightness(1.08); border: 0; transform: none; }
.btn-cancel { border-width: 1px; box-shadow: none; }

/* ── CHAMPS ── */
#searchInput, .formulaire input, .formulaire select { border-width: 1px; }
#searchInput:focus,
.formulaire input:focus,
.formulaire select:focus {
  border-color: var(--accent-violet);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.18);
}

.formulaire, .login-card, .delete-popup-content {
  border: 1px solid var(--border-mid);
  border-top: 3px solid var(--accent-violet);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.total-count { border: 1px solid var(--border-mid); box-shadow: none; }
.toast { border-width: 1px; border-left: 4px solid var(--accent-violet); }

.divider { height: 1px; background: var(--border-mid); border-radius: 0; }
::-webkit-scrollbar-thumb { background: var(--border-mid); }
/* Titre anglais sous le titre français */
.titre-en { margin: -2px 0 6px; font-size: .85em; font-style: italic; opacity: .7; }

/* ── STATISTIQUES ── */
.stats { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; padding: 0 24px 48px; }
.stats-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 18px 12px; box-shadow: var(--shadow-sm);
}
.stat-icon  { font-size: 1.5rem; }
.stat-value { font-family: var(--font-display); font-size: 1.6rem; color: var(--accent-violet); line-height: 1.1; }
.stat-label { color: var(--text-muted); font-size: .85rem; }
.stats-note { color: var(--text-muted); font-size: .9rem; margin: 0 0 22px; text-align: center; }
.stats-empty { color: var(--text-muted); text-align: center; padding: 12px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.stats-panel {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.stats-panel h2 { font-size: 1.05rem; margin: 0 0 14px; color: var(--text-primary); }
.bars, .top-list { list-style: none; margin: 0; padding: 0; }
.bars li { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 10px; padding: 4px 0; font-size: .9rem; }
.bar-label { color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: var(--bg-surface); border-radius: var(--radius-pill); height: 10px; overflow: hidden; }
.bar-fill  { display: block; height: 100%; background: var(--accent-violet); border-radius: var(--radius-pill); }
.bar-fill.alt { background: var(--accent-teal); }
.bar-value { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.bar-value small { color: var(--text-muted); }
.top-list { counter-reset: top; }
.top-list li {
  counter-increment: top; display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--border-subtle); font-size: .92rem;
}
.top-list li:last-child { border-bottom: 0; }
.top-name::before { content: counter(top) ". "; color: var(--text-muted); }
.top-name small { display: block; margin-left: 1.4em; color: var(--text-muted); font-style: italic; }
.top-value { color: var(--accent-violet); white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .bars li { grid-template-columns: 80px 1fr auto; } }


/* ═══════════════════════════════════════════════════════
   AJOUT — Menu burger (≤ 1024px) + carte de connexion + mobile
   ═══════════════════════════════════════════════════════ */

.nav-burger { display: none; }
.nav-auth-mobile { display: none; }

.nav-burger {
  width: 44px;
  height: 44px;
  padding: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  cursor: pointer;
  flex-shrink: 0;
}
.nav-burger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav.is-open .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.is-open .nav-burger span:nth-child(2) { opacity: 0; }
.nav.is-open .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-burger:focus-visible,
.password-toggle:focus-visible {
  outline: 2px solid var(--accent-violet);
  outline-offset: 2px;
}

@media (max-width: 1024px) {
  /* Barre fixe et compacte : marque + thème + burger. Les liens passent dans un menu déroulant. */
  .nav {
    height: var(--nav-height);
    min-height: 0;
    padding: 0 16px;
    flex-wrap: nowrap;
    gap: 12px;
  }
  .nav-brand {
    font-size: 1.1rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .nav-right { gap: 10px; flex-shrink: 0; }
  .theme-toggle-label { display: none; }
  .nav-right > .btn-login,
  .nav-right > form { display: none; }
  .nav-burger { display: inline-flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    order: 0;
    width: auto;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 4px;
    padding: 12px 16px 18px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-mid);
    box-shadow: var(--shadow-lg);
    max-height: calc(100vh - var(--nav-height));
    max-height: calc(100dvh - var(--nav-height));
    overflow-y: auto;
  }
  .nav.is-open .nav-links { display: flex; }

  .nav-links a {
    font-size: 1rem;
    padding: 13px 16px;
    border-radius: var(--radius-md);
  }

  .nav-auth-mobile {
    display: block;
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
  }
  .nav-auth-mobile form { margin: 0; }
  .nav-auth-mobile .btn-login,
  .nav-auth-mobile .btn-logout {
    width: 100%;
    justify-content: center;
    padding: 13px 16px;
    font-size: 1rem;
  }

  .login-wrapper {
    min-height: calc(100vh - var(--nav-height));
    min-height: calc(100dvh - var(--nav-height));
  }
}

/* Le lien « Admin » du menu garde l'aspect d'un bouton (sinon .nav-links a le recolore) */
.nav-links .nav-auth-mobile .btn-login {
  color: var(--accent-violet);
  background: rgba(var(--accent-rgb), 0.1);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
}

/* ── Carte de connexion : le champ n'était pas stylé (hors .formulaire) ── */
.login-card .form-group { text-align: left; }

.login-card input[type="password"],
.login-card input[type="text"] {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  font-size: 1rem;              /* ≥ 16px : évite le zoom automatique d'iOS */
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--transition);
  -webkit-appearance: none;
  appearance: none;
}
.login-card input:focus {
  border-color: var(--accent-violet);
  background: var(--bg-secondary);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.18);
}
.login-card input::placeholder { color: var(--text-muted); }

.password-field { position: relative; display: flex; }
.password-field input { padding-right: 104px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  min-height: 38px;
  padding: 0 12px;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
}
.password-toggle:hover { color: var(--accent-violet); }

@media (max-width: 480px) {
  .login-wrapper { align-items: flex-start; padding: 24px 16px; }
  .login-card { padding: 32px 22px; }

  /* Accueil */
  .hero { margin: 24px auto 32px; padding: 28px 16px; }
  .hero-subtitle { font-size: 1rem; margin-bottom: 32px; }
  .collections-grid { grid-template-columns: 1fr; padding: 0; gap: 12px; }
  .collection-card { padding: 22px 16px; gap: 10px; }

  /* Choix du type dans le formulaire d'ajout */
  .type-selector { flex-wrap: wrap; justify-content: center; }
  .type-btn { padding: 10px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .nav-burger span { transition: none; }
}
