/* La Parenthèse — Design System */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300;9..144,400;9..144,500&family=Manrope:wght@300;400;500;600&display=swap');

/* ─── Tokens ─── */
:root {
  --sunset-deep:   #1a0a00;
  --sunset-dark:   #6b2d0a;
  --sunset-warm:   #c4622d;
  --sunset-mid:    #e8956d;
  --sunset-light:  #f5c99a;
  --sunset-pale:   #fdf3e8;
  --sunset-cream:  #fffaf5;

  --text-primary:  #1a0a00;
  --text-secondary:#5a3520;
  --text-muted:    #a07860;
  --border:        rgba(196,98,45,.18);
  --border-strong: rgba(196,98,45,.35);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --ff-display: 'Fraunces', Georgia, serif;
  --ff-body:    'Manrope', system-ui, sans-serif;

  --shadow-sm: 0 1px 3px rgba(26,10,0,.08);
  --shadow-md: 0 4px 16px rgba(26,10,0,.10);
  --shadow-lg: 0 12px 40px rgba(26,10,0,.14);
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--ff-body);
  color: var(--text-primary);
  background: var(--sunset-cream);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--sunset-warm); text-decoration: none; }
a:hover { color: var(--sunset-dark); }
img { max-width: 100%; display: block; }

/* ─── Typography ─── */
h1,h2,h3 { font-family: var(--ff-display); font-weight: 400; line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }

/* ─── Logo ─── */
.site-logo {
  display: block;
  height: 56px;   /* nav — was 44px */
  width: auto;
}
.site-logo--sm { height: 38px; }
.site-logo--xs { height: 28px; }

/* ─── Layout ─── */
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.container--narrow { max-width: 680px; }
.container--wide { max-width: 1300px; }

/* ─── Nav ─── */
.site-nav {
  background: var(--sunset-deep);
  padding: 14px 0;
  position: sticky; top: 0; z-index: 100;
}
.site-nav__inner {
  display: flex; align-items: center; justify-content: space-between;
}
.site-nav__links { display: flex; gap: 24px; }
.site-nav__links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--sunset-light);
  letter-spacing: 0.04em;
  opacity: 0.8;
  transition: opacity .2s;
}
.site-nav__links a:hover { opacity: 1; }

/* ─── Hero ─── */
.hero {
  background: var(--sunset-deep);
  padding: 72px 0 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 100%, rgba(196,98,45,.22) 0%, transparent 70%);
  pointer-events: none;
}
.hero__logo-wrap {
  display: flex; justify-content: center; align-items: center;
  margin-bottom: 0;
}
.hero__logo {
  height: clamp(110px, 22vw, 200px);  /* was clamp(80px, 18vw, 140px) */
  width: auto;
  position: relative; z-index: 1;
}
.hero__sub {
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sunset-mid);
  opacity: 0.8;
  position: relative; z-index: 1;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 22px;
  font-family: var(--ff-body);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary { background: var(--sunset-warm); color: var(--sunset-cream); border-color: var(--sunset-warm); }
.btn-primary:hover { background: var(--sunset-dark); border-color: var(--sunset-dark); color: var(--sunset-cream); }
.btn-outline { background: transparent; color: var(--sunset-warm); border-color: var(--sunset-warm); }
.btn-outline:hover { background: var(--sunset-warm); color: var(--sunset-cream); }
.btn-ghost { background: transparent; color: var(--text-secondary); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--sunset-warm); color: var(--sunset-warm); }
.btn-danger { background: #8b1a1a; color: #fff; border-color: #8b1a1a; }
.btn-danger:hover { background: #6b1010; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-wallet { background: #4285f4; color: #fff; border-color: #4285f4; }
.btn-wallet:hover { background: #2c6ae0; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ─── Cards ─── */
.card {
  background: var(--sunset-cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* ─── Event Cards ─── */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
  padding: 48px 0;
}
.event-card {
  background: var(--sunset-cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.event-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.event-cover { height: 180px; background-size: cover; background-position: center; }
.event-cover--default {
  background: linear-gradient(135deg, var(--sunset-dark) 0%, var(--sunset-warm) 50%, var(--sunset-light) 100%);
}
.event-card__body { padding: 24px; }
.event-card__meta {
  display: flex; gap: 12px; align-items: center;
  font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--sunset-warm); margin-bottom: 10px;
}
.event-card__title {
  font-family: var(--ff-display);
  font-size: 1.4rem; font-weight: 400;
  color: var(--text-primary); margin-bottom: 6px; line-height: 1.25;
}
.event-card__location { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 8px; }
.event-card__desc { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.5; }
.event-card__footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 16px; border-top: 1px solid var(--border);
  gap: 12px; flex-wrap: wrap;
}
.event-price { font-family: var(--ff-display); font-size: 1.3rem; color: var(--sunset-warm); }
.event-card__actions { display: flex; align-items: center; gap: 10px; }

/* ─── Badges ─── */
.badge {
  display: inline-block; padding: 3px 10px;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em;
  border-radius: 100px;
}
.badge-ok      { background: #d4edda; color: #1a5c2a; }
.badge-warning { background: #fff3cd; color: #7a5200; }
.badge-danger  { background: #f8d7da; color: #7a1020; }
.badge-grey    { background: #e9ecef; color: #495057; }
.badge-full    { background: var(--sunset-pale); color: var(--text-muted); padding: 3px 10px; border-radius: 100px; font-size: .75rem; }

/* ─── Forms ─── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--sunset-dark); margin-bottom: 7px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 11px 14px;
  font-family: var(--ff-body); font-size: 0.95rem;
  background: var(--sunset-cream);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: border-color .15s;
  appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--sunset-warm);
  box-shadow: 0 0 0 3px rgba(196,98,45,.12);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 5px; }
.form-error {
  background: #fef2f2; border: 1px solid #fca5a5;
  color: #7f1d1d; padding: 10px 14px;
  border-radius: var(--radius-md); font-size: 0.875rem;
  margin-bottom: 16px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

/* ─── Section ─── */
.section { padding: 56px 0; }
.no-events { text-align: center; padding: 64px 24px; color: var(--text-muted); font-family: var(--ff-display); font-size: 1.2rem; }
.no-events em { font-style: italic; opacity: .7; }

/* ══════════════════════════════════════════════
   ADMIN LAYOUT — responsive first
══════════════════════════════════════════════ */

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

/* ── Sidebar ── */
.admin-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--sunset-deep);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 200;
  transition: transform .25s ease;
}

.admin-sidebar__logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  margin-bottom: 8px;
  flex-shrink: 0;
}
.admin-sidebar__logo img {
  height: 48px;   /* was 36px */
  width: auto;
}
.admin-sidebar__logo .admin-label {
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sunset-mid);
  margin-top: 6px;
  opacity: .8;
}

.admin-nav { flex: 1; padding: 4px 0; }
.admin-nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 18px;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(245,201,154,.65);
  transition: all .15s;
  border-left: 2px solid transparent;
  white-space: nowrap;
}
.admin-nav a:hover,
.admin-nav a.active {
  color: var(--sunset-light);
  background: rgba(255,255,255,.06);
  border-left-color: var(--sunset-warm);
}
.admin-nav .nav-icon { font-size: 1rem; flex-shrink: 0; }

.admin-sidebar__footer {
  padding: 12px 18px;
  border-top: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.admin-sidebar__footer a {
  font-size: 0.78rem;
  color: rgba(245,201,154,.4);
  transition: color .15s;
}
.admin-sidebar__footer a:hover { color: var(--sunset-mid); }

/* ── Hamburger (mobile only) ── */
.admin-hamburger {
  display: none;
  position: fixed;
  top: 12px; left: 12px;
  z-index: 300;
  background: var(--sunset-deep);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  cursor: pointer;
  color: var(--sunset-light);
  font-size: 1.2rem;
  line-height: 1;
}

/* ── Overlay (mobile) ── */
.admin-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 150;
}

/* ── Main content ── */
.admin-main {
  flex: 1;
  padding: 28px 32px;
  min-width: 0; /* permet au flex child de rétrécir */
  overflow-x: auto;
}

.admin-header { margin-bottom: 24px; }
.admin-header h1 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
.admin-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}
.admin-header-row h1 { margin: 0; }

/* ─── Stats cards ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--sunset-cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}
.stat-card__label { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.stat-card__value { font-family: var(--ff-display); font-size: 1.9rem; font-weight: 400; color: var(--sunset-warm); line-height: 1; }
.stat-card__sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

/* ─── Tables ─── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }
table { width: 100%; border-collapse: collapse; min-width: 480px; }
th {
  text-align: left; padding: 10px 14px;
  font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted); background: var(--sunset-pale);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 10px 14px; font-size: 0.875rem;
  color: var(--text-primary); border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--sunset-pale); }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }

/* ─── Dashboard 2-col grid ─── */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

/* ─── Progress ─── */
.progress-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; flex: 1; min-width: 60px; }
.progress-fill { height: 100%; background: var(--sunset-warm); border-radius: 3px; transition: width .3s; }
.dash-event-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.dash-event-row:last-child { border-bottom: none; }
.dash-event-info { flex: 1; min-width: 120px; }
.dash-event-title { font-weight: 600; font-size: 0.875rem; display: block; }
.dash-event-date { font-size: 0.75rem; color: var(--text-muted); }
.dash-event-bar { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 100px; }
.progress-label { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }

/* ─── Code badges ─── */
.code-badge {
  display: inline-block; padding: 4px 10px; margin: 3px;
  background: var(--sunset-pale); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); font-family: monospace; font-size: .85rem;
  color: var(--sunset-dark); letter-spacing: 0.05em;
}

/* ─── QR preview ─── */
.qr-preview { width: 150px; height: 150px; border-radius: var(--radius-md); border: 1px solid var(--border); }

/* ─── Control / scanner ─── */
.scanner-result {
  min-height: 120px; border-radius: var(--radius-lg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; text-align: center; transition: all .2s;
}
.result-valid  { background: #d4edda; }
.result-already{ background: #fff3cd; }
.result-invalid{ background: #f8d7da; }
.result-icon   { font-size: 3rem; margin-bottom: 8px; }
.result-name   { font-size: 1.3rem; font-weight: 700; }
.result-msg    { font-size: 0.9rem; margin-top: 4px; }
.scan-status   { font-size: 0.8rem; }
.scan-ok       { color: #1a5c2a; font-weight: 600; }
.participant-row.row-scanned td { opacity: .5; }
.participant-name  { font-weight: 600; font-size: .9rem; }
.participant-email { font-size: .75rem; color: var(--text-muted); }
.btn-manual-scan { background: var(--sunset-pale); color: var(--sunset-dark); border-color: var(--border-strong); }
.btn-manual-scan:hover { background: var(--sunset-warm); color: #fff; border-color: var(--sunset-warm); }

/* ─── Confirmation page ─── */
.confirmation-card {
  max-width: 520px; margin: 48px auto;
  background: var(--sunset-cream); border: 1px solid var(--border);
  border-radius: var(--radius-xl); overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.confirmation-card__header {
  background: linear-gradient(135deg, var(--sunset-dark), var(--sunset-warm), var(--sunset-light));
  padding: 36px 32px; text-align: center;
}
.confirmation-card__header h1 { color: var(--sunset-cream); font-size: 1.8rem; }
.confirmation-card__body { padding: 32px; }
.detail-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .9rem;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-muted); }
.detail-value { font-weight: 600; }
.ref-box {
  background: var(--sunset-pale); border-radius: var(--radius-md);
  padding: 12px; text-align: center; margin: 16px 0;
}
.ref-label { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.ref-value { font-family: monospace; font-size: 1.1rem; font-weight: bold; color: var(--text-primary); margin-top: 2px; }

/* ─── Footer ─── */
.site-footer {
  background: var(--sunset-deep);
  padding: 28px 24px;
  text-align: center;
  margin-top: auto;
}
.site-footer img {
  height: 48px;   /* was 32px */
  width: auto;
  opacity: .6;
  margin: 0 auto;
}

/* ══════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════ */

@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  /* Sidebar devient un drawer latéral */
  .admin-sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .admin-sidebar.is-open {
    transform: translateX(0);
  }
  .admin-overlay.is-visible {
    display: block;
  }
  .admin-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .admin-main {
    padding: 20px 16px 20px;
    padding-top: 60px; /* espace pour le hamburger */
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .admin-header-row {
    flex-direction: column;
    align-items: flex-start;
  }
  table { min-width: 400px; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .confirmation-card { margin: 20px; }
  .confirmation-card__body { padding: 20px; }
}
