/* =============================================================================
   KARIBEAN MOOD — Feuille de style principale
   Couleurs : vert #3A6B28 + jaune ananas #F2C030 — fond blanc
   Mobile-first
   ============================================================================= */

/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --krbm-green:        #3A6B28;
  --krbm-green-dark:   #2A5020;
  --krbm-green-light:  #4E8E38;
  --krbm-green-pale:   #EAF2E4;
  --krbm-yellow:       #F2C030;
  --krbm-yellow-dark:  #D4A010;
  --krbm-yellow-light: #F9D870;
  --krbm-yellow-pale:  #FDF8E1;

  --white:      #FFFFFF;
  --gray-50:    #F8F9FA;
  --gray-100:   #F1F3F5;
  --gray-200:   #E9ECEF;
  --gray-300:   #DEE2E6;
  --gray-400:   #CED4DA;
  --gray-500:   #ADB5BD;
  --gray-600:   #6C757D;
  --gray-700:   #495057;
  --gray-800:   #343A40;
  --gray-900:   #212529;

  --red:        #D63F3F;
  --red-pale:   #FEF0F0;
  --green-ok:   #2E7D32;
  --green-pale: #EDF7ED;
  --orange:     #E07B30;
  --orange-pale:#FFF4EC;

  --font:       -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:     0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.12);

  --nav-height: 60px;
  --max-w:      480px;   /* mobile-first, max largeur contenu */
  --max-w-wide: 900px;
}

/* ── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--white);
  color: var(--gray-900);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--krbm-green); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: var(--font); }

/* ── Layout ─────────────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 16px;
}
.container--wide { max-width: var(--max-w-wide); }

.page {
  padding-top: calc(var(--nav-height) + 16px);
  padding-bottom: 80px;
  min-height: 100vh;
}

/* ── Navbar ─────────────────────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 16px;
}
.navbar__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  color: var(--krbm-green);
  text-decoration: none;
  flex: 1;
}
.navbar__logo img { height: 32px; width: auto; }
.navbar__logo-text { color: var(--krbm-green); }
.navbar__actions { display: flex; align-items: center; gap: 8px; }
.navbar__menu-btn {
  width: 40px; height: 40px;
  border: none; background: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border-radius: var(--radius-sm);
  color: var(--gray-700);
}
.navbar__menu-btn:hover { background: var(--gray-100); }

/* ── Bottom nav (mobile) ────────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 64px;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  display: flex;
  align-items: stretch;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  color: var(--gray-500);
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  padding: 8px 0;
  transition: color 0.15s;
}
.bottom-nav__item.active,
.bottom-nav__item:hover { color: var(--krbm-green); }
.bottom-nav__item svg { width: 22px; height: 22px; }

/* ── Boutons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn--primary {
  background: var(--krbm-green);
  color: var(--white);
}
.btn--primary:hover { background: var(--krbm-green-dark); color: var(--white); text-decoration: none; }
.btn--yellow {
  background: var(--krbm-yellow);
  color: var(--krbm-green-dark);
}
.btn--yellow:hover { background: var(--krbm-yellow-dark); text-decoration: none; }
.btn--outline {
  background: transparent;
  border: 1.5px solid var(--krbm-green);
  color: var(--krbm-green);
}
.btn--outline:hover { background: var(--krbm-green-pale); text-decoration: none; }
.btn--ghost {
  background: transparent;
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}
.btn--ghost:hover { background: var(--gray-100); text-decoration: none; }
.btn--danger {
  background: var(--red);
  color: var(--white);
}
.btn--full { width: 100%; }
.btn--sm { padding: 8px 16px; font-size: 14px; }
.btn--lg { padding: 16px 32px; font-size: 18px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Champs formulaire ──────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-800);
}
.form-label--optional::after {
  content: ' (optionnel)';
  font-weight: 400;
  color: var(--gray-500);
}
.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 16px;
  color: var(--gray-900);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}
.form-input:focus {
  outline: none;
  border-color: var(--krbm-green);
  box-shadow: 0 0 0 3px rgba(58,107,40,0.12);
}
.form-input.error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(214,63,63,0.12);
}
.form-input::placeholder { color: var(--gray-400); }
.form-error { font-size: 13px; color: var(--red); display: flex; align-items: center; gap: 4px; }
.form-hint  { font-size: 13px; color: var(--gray-500); }

/* ── Checkbox / Radio ───────────────────────────────────────────────────────── */
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--gray-700);
  cursor: pointer;
}
.checkbox-row input[type=checkbox] {
  width: 18px; height: 18px;
  flex-shrink: 0;
  accent-color: var(--krbm-green);
  margin-top: 2px;
}

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card--flat { box-shadow: none; }
.card--green {
  background: var(--krbm-green-pale);
  border-color: rgba(58,107,40,0.2);
}
.card--yellow {
  background: var(--krbm-yellow-pale);
  border-color: rgba(242,192,48,0.3);
}

/* ── Badges ─────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge--green  { background: var(--krbm-green-pale); color: var(--krbm-green-dark); }
.badge--yellow { background: var(--krbm-yellow-pale); color: #8B6A00; }
.badge--gray   { background: var(--gray-100); color: var(--gray-700); }
.badge--red    { background: var(--red-pale); color: var(--red); }
.badge--orange { background: var(--orange-pale); color: var(--orange); }

/* ── Alerts ─────────────────────────────────────────────────────────────────── */
.alert {
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert--error   { background: var(--red-pale);    color: #8B1A1A; border-left: 3px solid var(--red); }
.alert--success { background: var(--green-pale);   color: #1B5E20; border-left: 3px solid var(--green-ok); }
.alert--warning { background: var(--orange-pale);  color: #7A3A00; border-left: 3px solid var(--orange); }
.alert--info    { background: var(--krbm-green-pale); color: var(--krbm-green-dark); border-left: 3px solid var(--krbm-green); }

/* ── Skeleton loader ────────────────────────────────────────────────────────── */
.sk {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: sk-shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes sk-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.sk-text   { height: 16px; }
.sk-title  { height: 24px; }
.sk-block  { height: 60px; }
.sk-avatar { width: 48px; height: 48px; border-radius: 50%; }

/* ── Dividers ───────────────────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: 20px 0;
}

/* ── Loader spinner ─────────────────────────────────────────────────────────── */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--krbm-green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Ticket card ────────────────────────────────────────────────────────────── */
.ticket-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.ticket-card__header {
  background: var(--krbm-green);
  color: var(--white);
  padding: 16px 20px;
}
.ticket-card__event-name {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
}
.ticket-card__meta {
  font-size: 13px;
  opacity: 0.85;
}
.ticket-card__body {
  padding: 20px;
}
.ticket-card__qr {
  display: flex;
  justify-content: center;
  padding: 20px 0;
}
.ticket-card__info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 14px;
}
.ticket-card__info-row:last-child { border-bottom: none; }
.ticket-card__info-label { color: var(--gray-500); }
.ticket-card__info-value { font-weight: 600; }
.ticket-card__code {
  font-family: monospace;
  font-size: 13px;
  color: var(--gray-600);
  text-align: center;
  margin-top: 12px;
}
.ticket-card--void   .ticket-card__header { background: var(--gray-500); }
.ticket-card--used   .ticket-card__header { background: var(--gray-600); }

/* ── Quantity selector ──────────────────────────────────────────────────────── */
.qty-selector {
  display: flex;
  align-items: center;
  gap: 12px;
}
.qty-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--krbm-green);
  background: var(--white);
  color: var(--krbm-green);
  font-size: 20px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.qty-btn:hover   { background: var(--krbm-green-pale); }
.qty-btn:disabled { border-color: var(--gray-300); color: var(--gray-400); cursor: not-allowed; }
.qty-value { font-size: 18px; font-weight: 700; min-width: 24px; text-align: center; }

/* ── Event header ────────────────────────────────────────────────────────────── */
.event-hero {
  background: var(--krbm-green);
  color: var(--white);
  padding: 32px 20px 24px;
  position: relative;
}
.event-hero__tag {
  display: inline-block;
  background: rgba(255,255,255,0.18);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
}
.event-hero__title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
}
.event-hero__meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  opacity: 0.9;
}
.event-hero__meta-row { display: flex; align-items: center; gap: 8px; }
.event-hero__meta svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ── Responsive (tablette+) ─────────────────────────────────────────────────── */
@media (min-width: 640px) {
  .container { padding: 0 24px; }
  .event-hero__title { font-size: 30px; }
  .bottom-nav { display: none; }
  .navbar { padding: 0 24px; }
}
