/* ================================================
   7.5 KM DE CÔTE D'IVOIRE — Styles globaux
   Typographie : Lucida Grande Grasse
================================================ */

:root {
  --ink: #0A0A0A;
  --ink-soft: #1a1a1a;
  --ink-mute: #6b6b6b;
  --paper: #FAFAF7;
  --paper-2: #F3F1EA;
  --line: #E6E3DA;
  --orange: #E85A1F;
  --orange-deep: #C64617;
  --orange-soft: #FDECE2;
  --white: #FFFFFF;
  --red: #C0392B;
  --green: #27AE60;
  --blue: #2C6EAA;
  --new-ink: #022B47;
  --new-orange: #F1B962;
  --new-orange-deep: #CC9E54;

  --font: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', Geneva, Verdana, sans-serif;
  --mono: 'Lucida Console', 'Lucida Sans Typewriter', Consolas, monospace;

  --max: 1320px;
  --gutter: clamp(20px, 4vw, 48px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-weight: 600;
  background: var(--paper);
  color: var(--new-ink);
  line-height: 1.5;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }

::selection { background: var(--new-orange); color: var(--white); }

/* ==============================
   LAYOUT
============================== */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ==============================
   HEADER UNIFIÉ (public + admin)
============================== */
.app-header {
  background: var(--new-ink);
  color: var(--paper);
  padding: 16px var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid var(--new-orange);
}
.app-header a { color: inherit; }
.app-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.app-brand .dot {
  width: 10px; height: 10px; background: var(--new-orange); border-radius: 50%;
}
.app-brand .tag {
  color: rgba(250,250,247,0.5);
  font-weight: 600;
  margin-left: 8px;
}
.app-nav { display: flex; gap: 28px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.app-nav a { color: rgba(250,250,247,0.7); transition: color .2s; }
.app-nav a:hover, .app-nav a.active { color: var(--new-orange); }
.app-nav-right { display: flex; align-items: center; gap: 16px; }
.app-nav-right .user { font-size: 12px; font-weight: 700; color: rgba(250,250,247,0.6); text-transform: uppercase; letter-spacing: 0.06em; }

@media (max-width: 720px) {
  .app-nav { display: none; }
}

/* ==============================
   TITRES
============================== */
.page-header {
  padding: 60px var(--gutter) 40px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}
.page-kicker {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--new-orange);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 10px;
}
.page-kicker::before { content: ''; width: 24px; height: 1px; background: var(--new-orange); }
.page-title {
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--new-ink);
}
.page-sub {
  margin-top: 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-mute);
  max-width: 680px;
  line-height: 1.5;
}

/* ==============================
   FORMULAIRES
============================== */
.form-wrap {
  max-width: 760px;
  margin: 40px auto;
  padding: 0 var(--gutter);
}
.form-card {
  background: var(--white);
  border: 1px solid var(--line);
  padding: clamp(24px, 4vw, 48px);
}
.form-section {
  padding-bottom: 28px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.form-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.form-section h3 {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--new-ink);
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px;
}
.form-section h3::before {
  content: '';
  width: 6px; height: 6px; background: var(--new-orange); border-radius: 50%;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.form-row.single { grid-template-columns: 1fr; }
.form-row.third { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 600px) {
  .form-row, .form-row.third { grid-template-columns: 1fr; }
}

.field label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 15px;
  font-weight: 600;
  color: var(--new-ink);
  transition: border-color .2s, background .2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--new-orange);
  background: var(--white);
}
.field.error input, .field.error select { border-color: var(--red); background: #fff5f3; }
.field-error {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--red);
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--paper);
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.checkbox-field:hover { background: var(--orange-soft); border-color: var(--new-orange); }
.checkbox-field input { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--new-orange); margin-top: 2px; }
.checkbox-field span { font-size: 13px; font-weight: 600; line-height: 1.5; }
.checkbox-field.error { border-color: var(--red); background: #fff5f3; }

/* ==============================
   BOUTONS
============================== */
.btn {
  display: inline-flex;
  align-items: center; gap: 8px;
  padding: 14px 24px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background .2s, transform .2s;
  border: none;
  cursor: pointer;
}
.btn-primary { background: var(--new-orange); color: var(--white); }
.btn-primary:hover { background: var(--new-orange-deep); transform: translateY(-1px); }
.btn-dark { background: var(--new-ink); color: var(--paper); }
.btn-dark:hover { background: var(--new-orange); }
.btn-ghost { background: transparent; color: var(--new-ink); border: 1px solid var(--new-ink); }
.btn-ghost:hover { background: var(--new-ink); color: var(--paper); }
.btn-danger { background: var(--red); color: var(--white); }
.btn-danger:hover { background: #8E1F15; }
.btn-sm { padding: 8px 14px; font-size: 11px; }
.btn-block { width: 100%; justify-content: center; }

/* ==============================
   TAGS / BADGES
============================== */
.badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 0;
}
.badge-orange { background: var(--orange-soft); color: var(--new-orange-deep); }
.badge-dark { background: var(--new-ink); color: var(--paper); }
.badge-green { background: #D6F0E2; color: #1F6E43; }
.badge-red { background: #FADBD6; color: #8E1F15; }
.badge-blue { background: #D9E8F5; color: #1C4872; }
.badge-gray { background: var(--paper-2); color: var(--ink-mute); }

/* ==============================
   ALERTES
============================== */
.alert {
  padding: 16px 20px;
  margin-bottom: 24px;
  border-left: 4px solid;
  font-size: 14px;
  font-weight: 700;
}
.alert-success { background: #EAFAF1; border-color: var(--green); color: #1F6E43; }
.alert-error { background: #FADBD6; border-color: var(--red); color: #8E1F15; }
.alert-info { background: #D9E8F5; border-color: var(--blue); color: #1C4872; }
.alert-warn { background: #FFF4E5; border-color: #E67E22; color: #8E4700; }

/* ==============================
   CATEGORY CARDS (choix inscription)
============================== */
.cat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 40px;
}
.cat-card {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 36px;
  position: relative;
  transition: border-color .3s, transform .3s;
  display: flex; flex-direction: column;
}
.cat-card:hover {
  border-color: var(--new-orange);
  transform: translateY(-4px);
}
.cat-card .distance {
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 900;
  color: var(--new-orange);
  letter-spacing: -0.04em;
  line-height: 1;
}
.cat-card h3 {
  margin-top: 12px;
  font-size: 20px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}
.cat-card .tag { margin-top: 8px; }
.cat-card .desc {
  margin-top: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-mute);
  line-height: 1.55;
  flex: 1;
}
.cat-card ul {
  list-style: none;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.cat-card ul li {
  padding: 6px 0;
  font-size: 13px;
  font-weight: 600;
  padding-left: 20px;
  position: relative;
}
.cat-card ul li::before {
  content: '→';
  position: absolute; left: 0;
  color: var(--new-orange);
  font-weight: 900;
}
.cat-card .price {
  margin-top: 20px;
  padding: 12px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
}
.cat-card .price strong { font-size: 16px; color: var(--new-orange); letter-spacing: -0.01em; text-transform: none; }
.cat-card .btn { margin-top: 24px; width: 100%; justify-content: center; }

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

/* ==============================
   FICHE D'INSCRIPTION (imprimable)
============================== */
.fiche-wrap { max-width: 800px; margin: 40px auto; padding: 0 var(--gutter); }
.fiche {
  background: var(--white);
  border: 2px solid var(--new-ink);
  padding: 0;
  overflow: hidden;
}
.fiche-header {
  background: var(--new-ink);
  color: var(--paper);
  padding: 24px 32px;
  display: flex; justify-content: space-between; align-items: center;
}
.fiche-header .brand {
  font-weight: 900;
  font-size: 14px;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.fiche-header .brand .dot { display: inline-block; width: 8px; height: 8px; background: var(--new-orange); border-radius: 50%; margin-right: 8px; }
.fiche-header .cat {
  background: var(--new-orange);
  color: var(--white);
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.fiche-body {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 0;
}
.fiche-main { padding: 32px; }
.fiche-qr {
  padding: 32px;
  background: var(--paper);
  border-left: 1px solid var(--line);
  text-align: center;
}
.fiche-qr img {
  width: 200px; height: 200px;
  border: 1px solid var(--line);
  display: block;
  margin: 0 auto 16px;
}
.fiche-qr .qr-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.fiche-code {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 8px;
}
.fiche-code-val {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 900;
  color: var(--new-ink);
  letter-spacing: 0.04em;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.fiche-name {
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.fiche-meta {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-mute);
  margin-bottom: 28px;
}
.fiche-table { width: 100%; border-collapse: collapse; }
.fiche-table th, .fiche-table td {
  text-align: left;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
}
.fiche-table th {
  width: 40%;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.fiche-table td { color: var(--new-ink); font-weight: 700; }

.fiche-footer {
  padding: 20px 32px;
  background: var(--paper-2);
  border-top: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-mute);
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.fiche-actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 700px) {
  .fiche-body { grid-template-columns: 1fr; }
  .fiche-qr { border-left: none; border-top: 1px solid var(--line); }
}

@media print {
  body { background: white; }
  .app-header, .fiche-actions, .no-print { display: none !important; }
  .fiche-wrap { margin: 0; padding: 0; max-width: none; }
  .fiche { border: 2px solid #000; page-break-inside: avoid; }
}

/* ==============================
   ADMIN - DASHBOARD
============================== */
.admin-body { background: var(--paper-2); min-height: 100vh; }
.admin-content { padding: 40px var(--gutter); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 24px;
  position: relative;
}
.stat-card .label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 12px;
}
.stat-card .value {
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--new-ink);
}
.stat-card .value .unit { font-size: 14px; color: var(--ink-mute); margin-left: 4px; font-weight: 700; }
.stat-card .sub {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-mute);
}
.stat-card.accent { background: var(--new-ink); color: var(--paper); border-color: var(--new-ink); }
.stat-card.accent .label { color: rgba(250,250,247,0.5); }
.stat-card.accent .value { color: var(--new-orange); }
.stat-card.accent .sub { color: rgba(250,250,247,0.6); }

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  margin-bottom: 24px;
}
.panel-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel-header h2 {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.panel-body { padding: 24px; }
.panel-body.padless { padding: 0; }

/* ==============================
   TABLE ADMIN
============================== */
.table {
  width: 100%;
  border-collapse: collapse;
}
.table thead th {
  background: var(--paper-2);
  padding: 14px 16px;
  text-align: left;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-mute);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  vertical-align: middle;
}
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--paper-2); }
.table tbody tr:last-child td { border-bottom: none; }
.table a { color: var(--new-ink); font-weight: 700; }
.table a:hover { color: var(--new-orange); }
.table .code {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  color: var(--new-orange);
  letter-spacing: 0.04em;
}

/* ==============================
   FILTRES
============================== */
.filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 24px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.filters input, .filters select {
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: var(--white);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
}
.filters input:focus, .filters select:focus {
  outline: none; border-color: var(--new-orange);
}
.filters label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-right: 4px;
}

/* ==============================
   PAGE LOGIN
============================== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--new-ink);
  padding: 40px 20px;
}
.login-card {
  background: var(--paper);
  width: 100%;
  max-width: 420px;
  padding: 40px;
  border-top: 4px solid var(--new-orange);
}
.login-card h1 {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.login-card .hint {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-mute);
  margin-bottom: 28px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ==============================
   EMAIL PREVIEW (iframe-like)
============================== */
.email-preview {
  border: 1px solid var(--line);
  background: #F5F3EF;
  padding: 20px;
  max-height: 80vh;
  overflow-y: auto;
}

/* ==============================
   UTILITAIRES
============================== */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-40 { margin-top: 40px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-mute { color: var(--ink-mute); }
.text-orange { color: var(--new-orange); }
.text-sm { font-size: 12px; }
.text-right { text-align: right; }
.fw-900 { font-weight: 900; }
.uppercase { text-transform: uppercase; letter-spacing: 0.1em; }
