/* E'C Nails — socle commun (site public et espace pro). Nécessite tokens.css.
 * Sommaire : reset · fond de page · typographie · champs · boutons · verre (.glass, .panel)
 *            · puces et badges · bandeaux · en-tête pilule · modale · accessibilité · mouvement
 */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background-color: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow-x: clip;
}
img, svg, video, picture { max-width: 100%; height: auto; }
img { border: 0; }
p, ul, ol, figure, blockquote { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
table { border-collapse: collapse; }

/* ---------- Fond de page : marbre voilé sur toute la hauteur du document ----------
 * Calque absolu couvrant tout <body> (et au moins l'écran) : un calque fixe ne couvrait qu'une
 * hauteur d'écran, d'où un fond coupé à mi-page sur les pages longues (captures pleine page,
 * impression). Le marbre garde l'échelle d'un « cover » d'écran (image 1559 × 1009, rapport
 * 1,5451) au lieu d'être agrandi à la hauteur du document, et se répète verticalement sans
 * raccord visible : arriere-plan-miroir = l'image suivie de son reflet vertical (1559 × 2018). */
body { position: relative; }
body::before {
  content: "";
  position: absolute;
  inset: 0;
  min-height: 100vh;
  z-index: -1;
  pointer-events: none;
  background-color: var(--c-bg);
  background-image: var(--g-page), url("../img/arriere-plan-miroir.jpg");
  background-image: var(--g-page), image-set(url("../img/arriere-plan-miroir.webp") type("image/webp"), url("../img/arriere-plan-miroir.jpg") type("image/jpeg"));
  background-size: auto, max(100%, 154.51vh) auto;
  background-position: center top;
  background-repeat: no-repeat, repeat-y;
}
body.has-modal { overflow: hidden; }

/* ---------- Liens ---------- */
a { color: var(--c-gold-dark); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--c-brown); }
.link-underline { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Typographie ---------- */
h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.1;
  color: var(--c-brown);
  text-wrap: pretty;
}
strong { font-weight: 500; }

/* Sur-titre en capitales espacées (« Notre histoire », « Réservation ») */
.kicker {
  margin: 0 0 14px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--c-gold-dark);
}
.kicker-sm { margin: 0; font-size: 11px; letter-spacing: .24em; }

/* Mot en écriture manuscrite dans un titre (« dans le détail », « & ») */
.title-script {
  font-family: var(--font-script);
  font-weight: 400;
  color: var(--c-gold);
}
.title-xl { font-size: clamp(42px, 6vw, 84px); line-height: 1; }
.title-xl .title-script { font-size: 1.15em; }
.title-lg { font-size: clamp(34px, 4vw, 54px); line-height: 1.1; }
.title-md { font-size: clamp(26px, 4vw, 34px); line-height: 1.1; }
.title-sm { font-size: 23px; line-height: 1.15; }
.lead { font-size: 18px; line-height: 1.6; font-weight: 300; color: var(--c-brown); text-wrap: pretty; }
.prose { font-size: 17px; line-height: 1.75; font-weight: 300; color: var(--c-ink); text-wrap: pretty; }
.prose > p + p { margin-top: 18px; }
.text-light { font-weight: 300; }
.text-small { font-size: 14px; }
.text-muted { color: var(--c-gold-dark); }
.text-center { text-align: center; }
.accent { font-weight: 500; color: var(--c-gold); }
.mono { font-family: var(--font-mono); }

/* ---------- Champs de formulaire ---------- */
label, .label {
  display: block;
  margin: 0 0 8px 6px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--c-gold-dark);
}

/* :where() garde une spécificité minimale : une simple classe suffit à surcharger. */
input:where(:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"])),
select,
textarea {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 50px;
  padding: 13px 18px;
  border: 1px solid var(--c-border-soft);
  border-radius: var(--r-field);
  background: var(--g-field);
  box-shadow: var(--sh-field);
  color: var(--c-ink);
  font-size: 16px; /* ≥ 16 px : pas de zoom automatique sur iOS */
  text-align: left;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
textarea { min-height: 110px; line-height: 1.5; resize: vertical; }
input[type="date"]::-webkit-date-and-time-value, input[type="time"]::-webkit-date-and-time-value { text-align: left; }
select {
  padding-right: 46px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23a47e4a' stroke-width='1.5'/%3E%3C/svg%3E"), var(--g-field);
  background-repeat: no-repeat, no-repeat;
  background-position: right 18px center, 0 0;
}
input::placeholder, textarea::placeholder { color: var(--c-muted); opacity: 1; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--c-gold-focus);
  box-shadow: var(--sh-field-focus);
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--c-gold-dark);
  outline-offset: 1px;
}
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: var(--c-danger);
}
input:disabled, select:disabled, textarea:disabled { opacity: .55; cursor: not-allowed; }
.input-pill { border-radius: var(--r-pill); }

/* Case à cocher / bouton radio avec son libellé (consentement, interrupteurs).
 * Envelopper le texte (et ses liens) dans un <span> : <label class="check"><input type="checkbox"><span>… <a>…</a></span></label> */
.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: normal;
  text-transform: none;
  color: var(--c-ink);
  cursor: pointer;
}
.check input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--c-brown); cursor: pointer; }
.check input:focus-visible { outline: 2px solid var(--c-gold-dark); outline-offset: 2px; }

/* Bloc libellé + champ + aide + erreur */
/* align-content: start — dans une ligne de .form-grid étirée par un champ voisin plus haut (aide
 * sous le champ), le libellé et le champ restent en haut : les champs d'une ligne s'alignent. */
.field { display: grid; align-content: start; gap: 0; min-width: 0; }
.field-hint { margin: 8px 0 0 6px; font-size: 13px; font-weight: 300; color: var(--c-brown); }
.field-error { margin: 8px 0 0 6px; font-size: 13px; color: var(--c-danger); }
.field-error:empty { display: none; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 16px;
}
.form-stack { display: grid; gap: 20px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 28px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: transform var(--t-base) var(--ease), box-shadow var(--t-base), background var(--t-base), color var(--t-base), border-color var(--t-base);
}
.btn-lg { min-height: 56px; padding: 0 34px; font-size: 14px; }
.btn-sm { min-height: 44px; padding: 0 20px; font-size: 12px; letter-spacing: .12em; }
.btn-xs { min-height: 38px; padding: 0 18px; font-size: 11px; letter-spacing: .12em; }
.btn-block { display: flex; width: 100%; }

/* Bouton plein brun : action principale */
.btn-primary {
  border-color: transparent;
  background: var(--g-primary);
  color: var(--c-cream);
  letter-spacing: .16em;
  box-shadow: var(--sh-primary);
}
.btn-primary:hover { color: var(--c-cream); transform: translateY(-2px); box-shadow: var(--sh-primary-hover); }

/* Bouton verre clair bordé d'or : action secondaire */
.btn-ghost {
  border-color: var(--c-border);
  background: var(--g-ghost);
  color: var(--c-brown);
  box-shadow: var(--sh-ghost);
}
.btn-ghost:hover { color: var(--c-brown); transform: translateY(-2px); box-shadow: var(--sh-ghost-hover); }
.btn-ghost.btn-light { border-color: var(--c-border-white); }

/* Bouton texte (« ‹ Modifier le créneau », « Supprimer ») */
.btn-link {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  background: none;
  color: var(--c-brown);
  font-size: 13px;
  letter-spacing: .12em;
  transition: background var(--t-fast), color var(--t-fast);
}
.btn-link:hover { background: var(--c-hover); color: var(--c-brown); }
.btn-danger { color: var(--c-danger); }
.btn-link.btn-danger:hover { background: var(--c-danger-tint); color: var(--c-danger); }

/* Bouton rond icône (fermer ×, semaine ‹ ›, menu) */
.btn-icon {
  flex: none;
  width: 44px;
  height: 44px;
  min-height: 0;
  padding: 0;
  border-color: var(--c-border);
  background: var(--g-ghost);
  color: var(--c-brown);
  box-shadow: var(--sh-ghost);
  font-size: 22px;
  line-height: 1;
  letter-spacing: 0;
}
.btn-icon:hover { background: var(--c-brown); border-color: var(--c-brown); color: var(--c-cream); }
.btn-icon.btn-sm { width: 40px; height: 40px; font-size: 20px; }
.btn-icon svg { width: 18px; height: 18px; }

/* Cibles tactiles ≥ 44 × 44 px sous 1100 px (spec V1.1 §5.3) : petits boutons, boutons ronds,
 * cases à cocher avec leur libellé (le texte d'une ligne centré sur la case ; un libellé avec lien,
 * comme le consentement, reste aligné en haut), sélecteur de fichier. */
@media (max-width: 1099.98px) {
  .btn-xs { min-height: 44px; }
  .btn-icon.btn-sm { width: 44px; height: 44px; }
  .check { min-height: 44px; align-items: center; }
  .check:has(a) { align-items: flex-start; }
  input[type=file]::file-selector-button { min-height: 44px; }
}

.btn:disabled, .btn[aria-disabled="true"] {
  opacity: .4;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
  pointer-events: none;
}
.btn.is-loading { cursor: progress; }
.btn.is-loading::after {
  content: "";
  width: 14px;
  height: 14px;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* Menu burger (trois traits) */
.burger { display: inline-flex; flex-direction: column; gap: 5px; }
.burger i { display: block; width: 18px; height: 1px; background: currentColor; }

/* ---------- Verre dépoli ---------- */
.glass {
  position: relative;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--c-border);
  box-shadow: var(--sh-glass);
}
/* Variante « tuile » : bord blanc, ombre plus douce (stats, étapes fidélité, contact) */
.glass-soft {
  position: relative;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--c-border-white);
  box-shadow: var(--sh-glass-soft);
}
.glass-hover { transition: transform var(--t-slow) var(--ease), box-shadow var(--t-slow), background-color var(--t-slow); }
.glass-hover:hover { transform: translateY(-4px); box-shadow: var(--sh-glass-hover); }

/* Grand panneau de section (reflet en haut) */
.panel {
  position: relative;
  max-width: var(--w-content);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 64px);
  border-radius: var(--r-panel);
  overflow: hidden;
  overflow: clip; /* pas de conteneur de défilement : position:sticky reste possible dedans */
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--c-border);
  box-shadow: var(--sh-glass);
}
.panel::before, .sheen::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 38%;
  border-radius: inherit;
  background: var(--g-sheen);
  pointer-events: none;
}
.panel > * { position: relative; }
.card { border-radius: var(--r-card); padding: 22px; }
.card-lg { border-radius: var(--r-card-lg); padding: 28px 26px 24px; }

/* ---------- Puces, étiquettes, badges ---------- */
/* Puce de choix (prestation, prothésiste) : aria-pressed="true" ou .is-selected quand choisie */
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-pill);
  background: var(--g-choice);
  box-shadow: var(--sh-choice);
  color: var(--c-brown);
  font-size: 13px;
  letter-spacing: .06em;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast), color var(--t-fast);
}
.chip:hover { box-shadow: var(--sh-ghost); }
.chip[aria-pressed="true"], .chip[aria-checked="true"], .chip.is-selected {
  border-color: transparent;
  background: var(--g-primary);
  color: var(--c-cream);
  box-shadow: var(--sh-selected);
}
.chip:disabled { opacity: .45; cursor: not-allowed; }
.chip-meta { opacity: .75; font-size: 12px; }
.chip-avatar { flex: none; width: 24px; height: 24px; border-radius: 50%; object-fit: cover; margin-left: -6px; }
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }

/* Étiquette bordée (durée, nombre de résultats) */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid rgba(164, 126, 74, .4);
  border-radius: var(--r-pill);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--c-gold-dark);
  white-space: nowrap;
}
/* Prix en pastille dorée */
.price-tag {
  flex: none;
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid rgba(164, 126, 74, .4);
  border-radius: var(--r-pill);
  background: var(--c-tint-strong);
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1.2;
  color: var(--c-gold-deep);
  white-space: nowrap;
}
/* Pastille prestation (listes admin) */
.pill {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid var(--c-border-faint);
  border-radius: var(--r-pill);
  background: rgba(217, 183, 124, .14);
  color: var(--c-brown);
  font-size: 13px;
  line-height: 1.3;
}
/* Badge (« Anniv. -10 % », « Aujourd'hui », « Annulé ») */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid rgba(164, 126, 74, .4);
  border-radius: var(--r-pill);
  background: var(--c-tint-strong);
  color: var(--c-gold-deep);
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-dark { border-color: transparent; background: var(--g-primary); color: var(--c-cream); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); letter-spacing: .16em; padding: 6px 12px; }
.badge-danger { border-color: rgba(168, 65, 47, .35); background: var(--c-danger-tint); color: var(--c-danger); }
.badge-muted { border-color: rgba(90, 62, 43, .15); background: var(--c-taken); color: var(--c-brown); }

/* Point doré décoratif */
.dot-gold { flex: none; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--g-gold-dot); box-shadow: 0 0 0 4px rgba(233, 207, 152, .28); }

/* ---------- Bandeaux et messages ---------- */
/* Bandeau doré en pointillés (préremplissage, récapitulatif, bon anniversaire) */
.notice {
  margin: 0;
  padding: 12px 18px;
  border: 1px dashed rgba(164, 126, 74, .5);
  border-radius: var(--r-field);
  background: var(--c-tint);
  color: var(--c-gold-deep);
  font-size: 14px;
  line-height: 1.5;
}
.notice-plain { border-style: solid; border-color: transparent; }
.notice-pill { border-radius: 26px; text-align: center; }
/* Message d'erreur */
.alert {
  margin: 0;
  padding: 12px 18px;
  border-radius: 22px;
  background: var(--c-danger-tint);
  color: var(--c-danger);
  font-size: 14px;
  line-height: 1.5;
}
.alert:empty { display: none; }
.alert-success { background: rgba(79, 122, 74, .1); color: var(--c-success); }

/* Séparateur haut d'une barre d'actions (bas de formulaire / modale) */
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--c-line);
}
.actions-end { justify-content: flex-end; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- En-tête pilule (site et admin) ---------- */
.topbar { position: sticky; top: 0; z-index: 20; padding: 10px var(--gutter) 0; }
.topbar-inner { max-width: var(--w-content); margin: 0 auto; display: grid; gap: 8px; }
/* Le verre est porté par ::before : un backdrop-filter sur .header-pill elle-même en ferait le
 * bloc conteneur des descendants position:fixed (barre d'onglets basse de l'admin). */
.header-pill {
  position: relative;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 8px 10px 8px 18px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-pill);
  box-shadow: var(--sh-header);
}
.header-pill::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}
.brand { display: flex; align-items: center; flex: none; }
.brand img { display: block; width: auto; height: 44px; }

/* ---------- Modale ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(8px, 3vh, 40px) clamp(8px, 2vw, 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--c-backdrop);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.modal {
  width: 100%;
  max-width: 880px;
  margin: auto 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: var(--r-modal);
  background: var(--c-paper);
  box-shadow: var(--sh-modal);
  animation: pop .35s var(--ease) both;
}
.modal:focus { outline: none; }
.modal-md { max-width: 660px; }
.modal-sm { max-width: 460px; }
.modal-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px clamp(16px, 3vw, 32px);
  overflow: hidden;
  border-bottom: 1px solid var(--c-line);
  background-color: var(--c-paper);
  background-image: var(--g-head), var(--img-page);
  background-image: var(--g-head), var(--img-page-set);
  background-size: cover;
  background-position: center;
}
.modal-head > * { position: relative; }
.modal-kicker { font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--c-gold-dark); }
.modal-title {
  margin-top: 4px;
  font-family: var(--font-serif);
  font-size: clamp(26px, 4vw, 32px);
  font-weight: 500;
  line-height: 1.1;
  color: var(--c-brown);
}
.modal-body { padding: clamp(16px, 3vw, 32px); }
.modal-body.form-stack { gap: 24px; }

/* ---------- Divers ---------- */
.spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(164, 126, 74, .3);
  border-top-color: var(--c-gold);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
.loading-row { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 28px 0; color: var(--c-gold-dark); font-size: 14px; }

/* ---------- Accessibilité ---------- */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 12px 20px;
  border-radius: var(--r-pill);
  background: var(--c-brown);
  color: var(--c-cream);
  transition: top var(--t-fast);
}
.skip-link:focus { top: 12px; color: var(--c-cream); }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--c-gold-dark);
  outline-offset: 3px;
}
.btn-primary:focus-visible, .chip[aria-pressed="true"]:focus-visible { outline-color: var(--c-brown); }

/* ---------- Animations ---------- */
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
.pop-in { animation: pop .3s var(--ease) both; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .btn:hover, .glass-hover:hover, .chip:hover { transform: none; }
  .spinner, .btn.is-loading::after { animation: spin 1.6s linear infinite !important; }
}
