/* ─────────────────────────────────────────────────────────
 * LYA Booking · Design System
 * Référence : docs/03-DESIGN-SYSTEM.md
 * ───────────────────────────────────────────────────────── */

:root {
  --bg: #f6f1e7;
  --ink: #1a1a1a;
  --ink-60: rgba(26, 26, 26, 0.55);
  --ink-40: rgba(26, 26, 26, 0.38);
  --ink-15: rgba(26, 26, 26, 0.15);
  --line: rgba(26, 26, 26, 0.12);
  --error: #8a2a2a;
  --error-bg: rgba(138, 42, 42, 0.05);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Jost', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 24px 40px;
}

main {
  width: 100%;
  max-width: 360px;
  margin: auto 0;
  padding: 40px 0;
}

main.wide {
  max-width: 640px;
}

/* Wordmark : sert sur tous les <img class="wordmark"> en haut de page.
   Fallback texte (.wordmark sur un div/span) conserve l'ancien style. */
.wordmark {
  margin-bottom: auto;
}
img.wordmark {
  display: block;
  height: 40px;
  width: auto;
  max-width: 100%;
}
div.wordmark, span.wordmark {
  font-family: 'Jost', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: var(--ink);
}

/* Brand row : logo + tag admin (ex : "ADMIN", "BONS DE COMMANDE") */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: auto;
}
.brand-tag {
  font-family: 'Jost', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: var(--ink-60);
}

h1 {
  font-family: 'EB Garamond', serif;
  font-weight: 400;
  font-size: 44px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 14px;
}

h2 {
  font-family: 'EB Garamond', serif;
  font-weight: 400;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 14px;
}

.sub {
  font-family: 'Jost', sans-serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-60);
  margin: 0 0 56px;
}

.field {
  margin-bottom: 36px;
}

.label {
  display: block;
  font-family: 'Jost', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-60);
  margin-bottom: 14px;
}

.input, .select, .textarea {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 4px 0 10px;
  font-family: 'EB Garamond', serif;
  font-size: 18px;
  color: var(--ink);
  letter-spacing: 0.01em;
  outline: none;
  border-radius: 0;
  transition: border-color 0.25s ease;
}

.input::placeholder, .textarea::placeholder {
  font-style: italic;
  color: var(--ink-40);
}

.input:focus, .select:focus, .textarea:focus {
  border-bottom-color: var(--ink);
}

.select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%231a1a1a' stroke-width='1' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 2px center;
  background-size: 10px;
  padding-right: 20px;
  cursor: pointer;
}

.textarea {
  resize: none;
  min-height: 72px;
  padding-top: 10px;
}

.btn {
  width: 100%;
  appearance: none;
  border: none;
  background: var(--ink);
  color: var(--bg);
  padding: 18px 20px;
  font-family: 'Jost', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 0;
  transition: background-color 0.25s ease, opacity 0.25s ease;
}
.btn:hover:not(:disabled) { background: #000; }
.btn:disabled { opacity: 0.4; cursor: wait; }

.btn-secondary {
  width: 100%;
  appearance: none;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 17px 20px;
  font-family: 'Jost', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 0;
  transition: all 0.25s ease;
  margin-top: 12px;
}
.btn-secondary:hover {
  background: var(--ink);
  color: var(--bg);
}

.btn-danger {
  color: var(--error);
  border-color: var(--error);
}
.btn-danger:hover {
  background: var(--error);
  color: var(--bg);
}

.msg {
  display: none;
  margin-top: 28px;
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-60);
}
.msg.visible { display: block; }
.msg.error { color: var(--error); }

.shimmer {
  position: relative;
  width: 100%;
  height: 1px;
  background: var(--ink-15);
  overflow: hidden;
  margin: 0 auto 28px;
}
.shimmer::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--ink) 50%,
    transparent 100%);
  animation: slide 1.6s ease-in-out infinite;
}
@keyframes slide {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

.status {
  font-family: 'Jost', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-60);
  text-align: center;
}

footer {
  margin-top: auto;
  padding-top: 40px;
  font-family: 'Jost', sans-serif;
  font-size: 11px;
  color: var(--ink-40);
  text-align: center;
}
footer a {
  color: var(--ink-60);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
footer a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.separator {
  height: 1px;
  background: var(--line);
  margin: 48px 0;
}

/* Card list */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.card {
  width: 100%;
  appearance: none;
  background: transparent;
  border: none;
  border-top: 1px solid var(--line);
  padding: 22px 0;
  text-align: left;
  cursor: pointer;
  transition: opacity 0.2s ease;
  font-family: inherit;
  color: inherit;
}
.card:last-child { border-bottom: 1px solid var(--line); }
.card:hover { opacity: 0.7; }

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.card-badge {
  font-family: 'Jost', sans-serif;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-60);
}
.card-badge.pending   { color: var(--ink); }
.card-badge.confirmed { color: var(--ink-40); }
.card-badge.refused   { color: var(--error); }
.card-badge.completed { color: var(--ink-40); }

.card-date {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 14px;
  color: var(--ink-60);
}
.card-title {
  font-family: 'EB Garamond', serif;
  font-size: 22px;
  margin-bottom: 4px;
}
.card-meta {
  font-family: 'Jost', sans-serif;
  font-size: 13px;
  color: var(--ink-60);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 100;
  overflow-y: auto;
  padding: 32px 24px;
  display: none;
}
.modal.visible { display: block; }
.modal-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: transparent;
  border: none;
  font-family: 'Jost', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-60);
  cursor: pointer;
  padding: 8px;
}
.modal-close:hover { color: var(--ink); }

/* Header établissement (form public) */
.est-header {
  text-align: left;
  margin-bottom: 8px;
}
.est-header #logo {
  display: none;
  width: 64px;
  height: 64px;
  min-width: 64px;
  min-height: 64px;
  max-width: 64px;
  max-height: 64px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 24px;
  flex-shrink: 0;
}
.est-header h1 { margin-bottom: 8px; }
.est-header .sub { margin-bottom: 4px; }
.sub-soft {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 15px;
  color: var(--ink-60);
  margin: 0 0 56px;
}
.sub-soft:empty { display: none; }

/* ─────────────────────────────────────────────────────────
 * Admin nav (horizontale, sous le wordmark)
 * Pattern : un seul niveau, hairline en bas, lien actif en --ink.
 * ───────────────────────────────────────────────────────── */
.admin-nav {
  width: 100%;
  max-width: 640px;
  margin: 0 0 40px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  font-family: 'Jost', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.admin-nav a {
  color: var(--ink-60);
  text-decoration: none;
  transition: color 0.2s ease;
}
.admin-nav a:hover { color: var(--ink); }
.admin-nav a.active { color: var(--ink); }

/* ─────────────────────────────────────────────────────────
 * Toggle sobre (binaire on/off ou 2 valeurs)
 * Pattern : 2 boutons inline, l'actif en --ink, l'inactif en
 * --ink-40 avec hairline --line. Pas de pill, pas de fond.
 * ───────────────────────────────────────────────────────── */
.toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 0;
}
.toggle button {
  appearance: none;
  background: transparent;
  border: none;
  padding: 10px 18px;
  font-family: 'Jost', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-40);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.toggle button + button { border-left: 1px solid var(--line); }
.toggle button:hover { color: var(--ink-60); }
.toggle button.active {
  background: var(--ink);
  color: var(--bg);
}

/* ─────────────────────────────────────────────────────────
 * Section block (sous-section dans une page dense)
 * ───────────────────────────────────────────────────────── */
.section-title {
  font-family: 'Jost', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-60);
  margin: 0 0 24px;
}
.section-title + .field { margin-top: 0; }

/* Filter row (chips inline, identique au pattern utilisé sur le pro
 * dashboard) — pour réutiliser dans /admin/establishments */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-bottom: 28px;
  font-family: 'Jost', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.filter-row .filter {
  color: var(--ink-40);
  cursor: pointer;
  padding-bottom: 6px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
  background: transparent;
  border-top: none;
  border-left: none;
  border-right: none;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}
.filter-row .filter:hover { color: var(--ink-60); }
.filter-row .filter.active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}
.filter-row .filter .count {
  margin-left: 6px;
  font-family: 'EB Garamond', serif;
  font-style: italic;
  letter-spacing: 0;
  text-transform: none;
}

/* ─────────────────────────────────────────────────────────
 * KPI strip (compteurs en header)
 * ───────────────────────────────────────────────────────── */
.kpi-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 36px;
  margin: 0 0 36px;
}
.kpi-strip .kpi {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  min-width: 120px;
}
.kpi-strip .kpi .kpi-label {
  font-family: 'Jost', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-60);
  margin-bottom: 8px;
}
.kpi-strip .kpi .kpi-value {
  font-family: 'EB Garamond', serif;
  font-size: 26px;
  line-height: 1;
  color: var(--ink);
}

/* City group header (utilisé dans la liste des établissements admin) */
.group-header {
  font-family: 'Jost', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-60);
  margin: 32px 0 6px;
}
.group-header:first-child { margin-top: 0; }

@media (max-width: 480px) {
  body { padding: 36px 24px 28px; }
  h1 { font-size: 38px; }
  .admin-nav { gap: 18px; font-size: 10px; }
  .kpi-strip { gap: 24px; }
}
