/* ---------- Polices (auto-hébergées, licence OFL) ---------- */
@font-face { font-family: 'Barlow'; font-weight: 400; font-display: swap; src: url(fonts/barlow-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 500; font-display: swap; src: url(fonts/barlow-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 600; font-display: swap; src: url(fonts/barlow-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-display: swap; src: url(fonts/barlow-condensed-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-display: swap; src: url(fonts/barlow-condensed-latin-700-normal.woff2) format('woff2'); }

/* ---------- Jetons ---------- */
:root {
  --ink: #15201f;          /* texte : vert-noir profond */
  --ink-2: #3a4746;
  --muted: #5d6b69;
  --paper: #eef2f1;        /* fond : carrelage blanc froid */
  --surface: #ffffff;
  --line: #cfd8d6;
  --line-strong: #9fb0ad;
  --accent: #17777d;       /* teinte du salon (par défaut : bleu-vert "Barbicide") */
  --accent-ink: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, white);
  --pole: #b3261e;         /* rouge du poteau de barbier : erreurs, annulations */
  --ok: #2f7a3e;
  --warn: #9a6400;

  --f-body: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --f-display: 'Barlow Condensed', 'Arial Narrow', var(--f-body);

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px;
  --r-sm: 6px; --r-md: 10px;
  --step--1: 0.875rem; --step-0: 1rem; --step-1: 1.25rem; --step-2: 1.563rem; --step-3: 1.953rem; --step-4: 2.441rem; --step-5: 3.052rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--f-body); font-size: var(--step-0); line-height: 1.5;
  color: var(--ink); background: var(--paper);
}
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; line-height: 1.05; margin: 0; letter-spacing: 0.005em; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 44px; padding: 0 var(--s5); border-radius: var(--r-sm); border: 1.5px solid var(--ink);
  background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--paper); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 85%, black); }
.btn-danger { border-color: var(--pole); color: var(--pole); }
.btn-danger:hover { background: color-mix(in srgb, var(--pole) 8%, white); }
.btn-quiet { border-color: transparent; background: transparent; }
.btn-quiet:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.btn-sm { min-height: 34px; padding: 0 var(--s3); font-size: var(--step--1); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- Formulaires ---------- */
.field { display: grid; gap: var(--s1); align-content: start; }
.field > span, .label { font-weight: 600; font-size: var(--step--1); color: var(--ink-2); }
.field small { color: var(--muted); font-size: var(--step--1); }
.input, input[type=text], input[type=url], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=time], input[type=color], select, textarea {
  width: 100%; min-height: 44px; padding: var(--s2) var(--s3); border: 1.5px solid var(--line-strong);
  border-radius: var(--r-sm); background: var(--surface);
}
input[type=color] { padding: 2px; width: 64px; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.form-grid { display: grid; gap: var(--s4); }
@media (min-width: 640px) { .form-grid.two { grid-template-columns: 1fr 1fr; } }
.check { display: flex; gap: var(--s2); align-items: center; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }

/* ---------- Messages ---------- */
.alert { padding: var(--s3) var(--s4); border-radius: var(--r-sm); border-left: 4px solid var(--pole); background: color-mix(in srgb, var(--pole) 7%, white); color: #5c130f; }
.alert.ok { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 8%, white); color: #173d1f; }
.toast {
  position: fixed; left: 50%; bottom: var(--s5); transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--ink); color: white; padding: var(--s3) var(--s5); border-radius: var(--r-sm); z-index: 100;
  transition: opacity .2s, transform .2s; pointer-events: none; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--pole); }

/* Poteau de barbier : la seule touche décorative, utilisée comme liseré */
.pole {
  height: 6px;
  background: repeating-linear-gradient(-45deg, var(--pole) 0 10px, #fff 10px 20px, #1f3f8f 20px 30px, #fff 30px 40px);
}

.muted { color: var(--muted); }
.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
