:root {
  --cream:       #faf8f5;
  --cream-dark:  #f2ede6;
  --ink:         #1a1a1a;
  --ink-soft:    #342d28;
  --ink-muted:   #5f5249;
  --amber:       #9b6641;
  --amber-light: #c8a27d;
  --amber-pale:  #f5ede3;
  --rule:        #c8bcad;
  --serif:       'Playfair Display', Georgia, serif;
  --garamond:    'EB Garamond', Georgia, serif;
  --sans:        'DM Sans', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

/* ── NAVBAR ─────────────────────────────────────── */
.nav-search {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-search__icon {
  position: absolute;
  left: 0.65rem;
  width: 1rem;
  height: 1rem;
  color: var(--ink-muted);
  pointer-events: none;
  flex-shrink: 0;
}

.nav-search__input {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rule);
  padding: 0.3rem 0.5rem 0.3rem 2rem;
  width: 220px;
  outline: none;
  transition: border-color 0.2s, width 0.3s ease;
}

.nav-search__input::placeholder { color: var(--ink-muted); }
.nav-search__input:focus {
  border-color: var(--amber);
  width: 280px;
}
.nav-search__input::-webkit-search-cancel-button { display: none; }

.nav-link-item {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-decoration: none;
  padding: 0.25rem 0;
  transition: color 0.2s;
  position: relative;
}

.nav-link-item::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1px;
  background: var(--amber);
  transition: width 0.25s ease;
}

.nav-link-item:hover { color: var(--ink); }
.nav-link-item:hover::after { width: 100%; }

/* ── HAMBURGER TOGGLER ───────────────────────────── */
.navbar-toggler {
  --bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='%235f5249' stroke-width='2' stroke-linecap='round' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

/* ── MOBILE MENU (Bootstrap collapse) ───────────── */
.site-nav { position: relative; }

#navMobileMenu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--cream);
  border-bottom: 1px solid var(--rule);
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.nav-mobile-menu .nav-link-item {
  display: block;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--cream-dark);
  font-size: 0.85rem;
}
.nav-mobile-menu .nav-link-item:last-child { border-bottom: none; }
.nav-mobile-menu .nav-link-item::after { display: none; }

/* ── FOOTER ──────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 1.75rem 0;
  background: var(--cream);
}

.footer-brand {
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-muted);
}

.footer-brand span { font-style: italic; color: var(--amber); }
.footer-copy { font-size: 0.75rem; color: var(--ink-muted); }

/* ── ANIMATIONS ──────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── SEARCH DROPDOWN ─────────────────────────────── */
.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: max(100%, 300px);
  max-width: min(400px, 90vw);
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  list-style: none;
  margin: 0;
  padding: 4px 0;
  z-index: 1000;
}
.search-dropdown[hidden] { display: none; }
.search-dropdown__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
}
.search-dropdown__item:hover,
.search-dropdown__item[aria-selected="true"] { background: var(--cream-dark); }
.search-dropdown__portrait {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.search-dropdown__name {
  font-weight: 500;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
}
.search-dropdown__dates {
  font-size: .8em;
  color: var(--ink-muted);
  white-space: nowrap;
}

/* ── Badge session utilisateur navbar ───────────────────── */
.nav-session-badge {
  font-size: .75rem;
  font-weight: 600;
  color: var(--accent, #7c5cbf);
  background: color-mix(in srgb, var(--accent, #7c5cbf) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent, #7c5cbf) 25%, transparent);
  border-radius: 20px;
  padding: .15rem .65rem;
  letter-spacing: .02em;
  white-space: nowrap;
  text-decoration: none;
}
.nav-session-badge--login,
.nav-session-badge--admin {
  cursor: pointer;
  transition: background .15s, color .15s;
}
.nav-session-badge--login {
  background: none;
  border-color: color-mix(in srgb, var(--accent, #7c5cbf) 25%, transparent);
}
.nav-session-badge--login:hover,
.nav-session-badge--admin:hover {
  background: color-mix(in srgb, var(--accent, #7c5cbf) 20%, transparent);
  color: var(--accent, #7c5cbf);
}

/* ── Modales auth ────────────────────────────────────────── */
.bg-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1055;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.bg-modal[hidden] { display: none; }
.bg-modal-box {
  background: #fff;
  border-radius: .5rem;
  padding: 1.5rem;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
}
.bg-modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.bg-modal-error {
  color: #dc3545;
  font-size: .875rem;
  margin-bottom: .75rem;
}
.bg-modal-output {
  font-size: .75rem;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: .25rem;
  padding: .5rem .75rem;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ── QR code fiche ─────────────────────────────────────── */
.qr-section { padding: 2rem 0; text-align: center; }
.qr-label   { font-size: 0.7rem; letter-spacing: .15em; text-transform: uppercase;
               color: var(--ink-muted); margin-bottom: .5rem; }
.qr-img     { border: 1px solid var(--rule); border-radius: 4px; }
