/*
  Bev-Ops · prise de rendez-vous
  Direction A1 « Carnet » reprise du site bev-ops.com : papier ivoire, encre chaude,
  sauge pour l'état choisi, terre en accent rare. Besley pour les titres, Schibsted Grotesk pour le texte.
*/

@font-face { font-family: "Besley"; src: url("/fonts/besley-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Besley"; src: url("/fonts/besley-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Besley"; src: url("/fonts/besley-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Schibsted Grotesk"; src: url("/fonts/schibsted-grotesk-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Schibsted Grotesk"; src: url("/fonts/schibsted-grotesk-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --ivoire: #f6f1e7;
  --papier: #fbf8f2;
  --sauge-pale: #e3e8dd;
  --sauge: #4f6352;
  --sauge-fonce: #3b4b3e;
  --encre: #22201b;
  --encre-2: #554d43;
  --encre-3: #6a6155;
  --terre: #9c4b27;
  --terre-fonce: #7d3b1d;
  --terre-pale: #f3e4d6;
  --trait: rgb(34 32 27 / 0.14);
  --trait-fort: rgb(34 32 27 / 0.28);
  --ombre: 0 1px 2px rgb(34 32 27 / 0.08), 0 12px 32px rgb(34 32 27 / 0.09);

  --titre: "Besley", Georgia, "Times New Roman", serif;
  --texte: "Schibsted Grotesk", ui-sans-serif, system-ui, sans-serif;

  --e-1: 4px; --e-2: 8px; --e-3: 12px; --e-4: 16px; --e-5: 20px; --e-6: 24px;
  --e-8: 32px; --e-10: 40px; --e-12: 48px; --e-16: 64px;
  --rayon: 6px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--ivoire);
  color: var(--encre);
  font: 400 1.0625rem/1.6 var(--texte);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1, h2, h3, p, ul { margin: 0; }
h1, h2, h3 { font-family: var(--titre); font-weight: 400; text-wrap: balance; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--encre); outline-offset: 3px; }

svg { fill: none; stroke: currentcolor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.insecable { white-space: nowrap; }

.evitement {
  position: absolute; left: var(--e-4); top: -100px; z-index: 10;
  padding: var(--e-3) var(--e-4); background: var(--encre); color: var(--papier); border-radius: var(--rayon);
}
.evitement:focus { top: var(--e-4); }

.annonce { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Bandeau et pied ---------- */

.bandeau { padding: var(--e-5) var(--e-5) 0; }
.marque {
  display: inline-flex; align-items: center; gap: var(--e-3);
  min-height: 48px; text-decoration: none;
  font: 500 1.125rem/1 var(--titre); letter-spacing: 0.01em;
}
.marque img { display: block; width: 36px; height: auto; }

.pied { margin-top: auto; padding: var(--e-8) var(--e-5); text-align: center; font-size: 0.875rem; color: var(--encre-3); }

/* ---------- La feuille du carnet ---------- */

.carnet {
  width: min(100% - 2 * var(--e-4), 1080px);
  margin: var(--e-6) auto 0;
  display: grid;
  grid-template-columns: 1fr;
  background: var(--papier);
  border: 1px solid var(--trait);
  border-radius: 10px;
  box-shadow: var(--ombre);
  overflow: hidden;
}

@media (min-width: 900px) {
  .carnet { grid-template-columns: 300px 1fr; margin-top: var(--e-10); min-height: 560px; }
  .bandeau { padding-inline: var(--e-12); }
}

/* ---------- Profil ---------- */

.profil {
  padding: var(--e-6) var(--e-5);
  border-bottom: 1px solid var(--trait);
}
/* Téléphone : photo à côté du titre, pour que le calendrier remonte */
@media (max-width: 899px) {
  .profil { display: grid; grid-template-columns: auto 1fr; column-gap: var(--e-4); align-items: end; }
  .profil > picture { grid-row: 1 / span 2; }
  .profil__photo { width: 56px; }
  .profil__nom { margin-top: 0; }
  .profil__faits, .profil__phrase, .profil__choix { grid-column: 1 / -1; }
  .profil__faits { display: flex; flex-wrap: wrap; column-gap: var(--e-5); }
}
@media (min-width: 900px) {
  .profil { padding: var(--e-8); border-bottom: 0; border-right: 1px solid var(--trait); }
}

.profil__photo {
  display: block; width: 64px; height: auto; aspect-ratio: 72 / 88;
  border-radius: 999px 999px var(--rayon) var(--rayon);
  object-fit: cover; background: var(--sauge-pale);
}
.profil__nom { margin-top: var(--e-4); font-size: 0.9375rem; color: var(--encre-3); }
.profil__titre { margin-top: var(--e-1); font-size: clamp(1.75rem, 5vw, 2.125rem); line-height: 1.1; }

.profil__faits { margin-top: var(--e-5); display: grid; gap: var(--e-2); color: var(--encre-2); font-size: 0.9375rem; font-weight: 500; }
.profil__faits li { display: flex; align-items: center; gap: var(--e-3); }
.profil__faits svg { width: 20px; height: 20px; flex: none; color: var(--sauge); }

.profil__phrase {
  margin-top: var(--e-5); padding-top: var(--e-5);
  border-top: 1px solid var(--trait);
  font: italic 400 1.0625rem/1.55 var(--titre);
  color: var(--encre-2);
}

.profil__choix {
  margin-top: var(--e-6); padding: var(--e-4);
  border-radius: var(--rayon); background: var(--sauge-pale); color: var(--sauge-fonce);
  animation: apparition 0.4s var(--ease);
}
.profil__choix-titre { font-size: 0.8125rem; font-weight: 500; }
.profil__choix-date { margin-top: var(--e-1); font: 500 1.125rem/1.3 var(--titre); color: var(--encre); }
.profil__choix-date::first-letter { text-transform: uppercase; }
.profil__choix-heure { font-size: 0.9375rem; }

/* ---------- Étapes ---------- */

.etape { padding: var(--e-6) var(--e-5) var(--e-8); animation: apparition 0.45s var(--ease); }
.etape:focus { outline: none; }

#etape-creneau { display: grid; gap: var(--e-8); }
@media (min-width: 680px) {
  #etape-creneau { grid-template-columns: minmax(0, 1fr) 220px; gap: var(--e-6); }
}
@media (min-width: 900px) {
  .etape { padding: var(--e-8); }
}

@keyframes apparition {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Calendrier ---------- */

.calendrier__tete { display: flex; align-items: center; justify-content: space-between; gap: var(--e-4); }
.calendrier__mois { font-size: 1.375rem; line-height: 1.2; }
.calendrier__mois::first-letter { text-transform: uppercase; }
.calendrier__nav { display: flex; gap: var(--e-1); }

.rond {
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: 999px; background: transparent; cursor: pointer;
  transition: background-color 0.16s var(--ease);
}
.rond svg { width: 20px; height: 20px; }
.rond:hover:not(:disabled) { background: var(--sauge-pale); }
.rond:disabled { color: var(--trait-fort); cursor: default; }

.grille { margin-top: var(--e-4); }
.grille__entetes, .grille__jours { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--e-1); }
.grille__entetes span {
  padding-block: var(--e-2); text-align: center;
  font-size: 0.8125rem; font-weight: 500; color: var(--encre-3);
}

.jour {
  position: relative; aspect-ratio: 1; min-height: 40px; max-height: 64px; width: 100%;
  display: grid; place-items: center;
  border: 0; border-radius: var(--rayon);
  background: transparent; color: var(--encre-3);
  font-size: 0.9375rem; font-variant-numeric: tabular-nums;
}
.jour--libre {
  background: var(--sauge-pale); color: var(--sauge-fonce); font-weight: 500; cursor: pointer;
  transition: background-color 0.16s var(--ease), color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.jour--libre:hover { box-shadow: inset 0 0 0 1.5px var(--sauge); }
.jour--libre[aria-selected="true"] { background: var(--sauge); color: var(--papier); box-shadow: none; }
.jour--aujourdhui::after {
  content: ""; position: absolute; bottom: 7px; left: 50%; width: 4px; height: 4px; margin-left: -2px;
  border-radius: 99px; background: currentcolor;
}
.jour--vide { visibility: hidden; }
.jour--passe { opacity: 0.4; }

.jour--squelette {
  background: linear-gradient(90deg, var(--ivoire) 0%, var(--sauge-pale) 50%, var(--ivoire) 100%) 0 0 / 300% 100%;
  animation: lueur 1.4s ease-in-out infinite;
}
@keyframes lueur { to { background-position: -150% 0; } }

.fuseau { margin-top: var(--e-4); display: flex; align-items: center; gap: var(--e-2); font-size: 0.8125rem; color: var(--encre-3); }
.fuseau svg { width: 16px; height: 16px; }

/* ---------- Heures ---------- */

.horaires__titre { font-size: 1.125rem; line-height: 1.3; min-height: 44px; display: flex; align-items: center; }
.horaires__titre::first-letter { text-transform: uppercase; }
.horaires__liste {
  margin-top: var(--e-3); display: grid; gap: var(--e-2);
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
}
@media (min-width: 680px) {
  .horaires__liste { grid-template-columns: 1fr; max-height: 430px; overflow-y: auto; padding: 2px 6px 2px 2px; scrollbar-width: thin; }
}
.horaires__vide { margin-top: var(--e-3); font-size: 0.9375rem; color: var(--encre-3); }

.heure { display: flex; gap: var(--e-2); }
.heure__choix, .heure__valider {
  min-height: 48px; border-radius: var(--rayon); cursor: pointer;
  font-weight: 500; font-variant-numeric: lining-nums;
  transition: background-color 0.16s var(--ease), color 0.16s var(--ease), border-color 0.16s var(--ease), flex-basis 0.25s var(--ease);
}
.heure__choix {
  flex: 1 1 100%; border: 1.5px solid var(--trait-fort); background: var(--papier); color: var(--encre);
}
.heure__choix:hover { border-color: var(--sauge); color: var(--sauge-fonce); }
.heure__valider { display: none; flex: 1 1 50%; border: 1.5px solid var(--encre); background: var(--encre); color: var(--papier); }
.heure__valider:hover { background: var(--sauge-fonce); border-color: var(--sauge-fonce); }
.heure--active .heure__choix { flex-basis: 50%; border-color: var(--encre-2); background: var(--encre-2); color: var(--papier); }
.heure--active .heure__valider { display: block; }
.heure--active { grid-column: 1 / -1; }
@media (min-width: 680px) { .heure--active { grid-column: auto; } }

/* ---------- Formulaire ---------- */

.formulaire { max-width: 560px; display: grid; gap: var(--e-5); }
.retour {
  justify-self: start; display: inline-flex; align-items: center; gap: var(--e-1);
  min-height: 44px; margin-left: -6px; padding: 0 var(--e-2) 0 0;
  border: 0; background: none; color: var(--encre-2); font-size: 0.9375rem; font-weight: 500; cursor: pointer;
}
.retour svg { width: 18px; height: 18px; }
.retour:hover { color: var(--encre); text-decoration: underline; text-underline-offset: 4px; }
.formulaire__titre { font-size: clamp(1.5rem, 4vw, 1.875rem); line-height: 1.15; }
.formulaire__aide { margin-top: calc(-1 * var(--e-3)); color: var(--encre-2); }

.champs-duo { display: grid; gap: var(--e-5); }
@media (min-width: 560px) { .champs-duo { grid-template-columns: 1fr 1fr; } }

.champ { display: grid; gap: var(--e-2); }
.champ label { font-size: 0.9375rem; font-weight: 500; }
.champ input, .champ select, .champ textarea {
  width: 100%; min-height: 48px; padding: var(--e-3) var(--e-4);
  border: 1.5px solid var(--trait-fort); border-radius: var(--rayon);
  background: var(--papier);
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.champ textarea { resize: vertical; min-height: 112px; line-height: 1.5; }
.champ select {
  appearance: none; padding-right: var(--e-10); cursor: pointer;
  background: var(--papier) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23554d43' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5.5 8 4.5 4.5L14.5 8'/%3E%3C/svg%3E") no-repeat right 12px center / 20px;
}
.champ input::placeholder, .champ textarea::placeholder { color: var(--encre-3); opacity: 0.75; }
.champ input:hover, .champ select:hover, .champ textarea:hover { border-color: var(--encre-3); }
.champ input:focus, .champ select:focus, .champ textarea:focus {
  outline: none; border-color: var(--sauge); box-shadow: 0 0 0 3px var(--sauge-pale);
}
.champ__aide { font-size: 0.875rem; color: var(--encre-3); }
.champ__erreur { font-size: 0.875rem; font-weight: 500; color: var(--terre-fonce); }
.champ__erreur:empty { display: none; }
.champ--erreur input, .champ--erreur select, .champ--erreur textarea { border-color: var(--terre); }

.piege { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.formulaire__erreur {
  padding: var(--e-3) var(--e-4); border-radius: var(--rayon);
  background: var(--terre-pale); color: var(--terre-fonce); font-size: 0.9375rem; font-weight: 500;
}
.formulaire__erreur:empty { display: none; }

.formulaire__rgpd { font-size: 0.8125rem; color: var(--encre-3); }

/* ---------- Boutons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--e-3);
  min-height: 48px; padding: var(--e-3) var(--e-5);
  border: 1.5px solid transparent; border-radius: var(--rayon);
  font: 500 1rem/1.25 var(--texte); text-align: center; text-decoration: none; cursor: pointer;
  transition: background-color 0.16s var(--ease), color 0.16s var(--ease), border-color 0.16s var(--ease);
}
.btn--plein { background: var(--encre); color: var(--papier); }
.btn--plein:hover { background: var(--sauge-fonce); }
.btn--trait { border-color: currentcolor; background: transparent; color: var(--encre); }
.btn--trait:hover { border-color: var(--encre); background: var(--encre); color: var(--papier); }
.btn--large { min-height: 52px; width: 100%; }
@media (min-width: 560px) { .btn--large { width: auto; justify-self: start; padding-inline: var(--e-8); } }

.btn[aria-busy="true"] { cursor: progress; }
.btn[aria-busy="true"]::before {
  content: ""; width: 16px; height: 16px; border-radius: 99px;
  border: 2px solid rgb(251 248 242 / 0.35); border-top-color: var(--papier);
  animation: tour 0.8s linear infinite;
}
@keyframes tour { to { transform: rotate(1turn); } }

/* ---------- Confirmation ---------- */

.etape--merci { display: grid; place-items: center; text-align: center; }
.merci { max-width: 440px; display: grid; justify-items: center; gap: var(--e-4); padding-block: var(--e-8); }
.merci__coche { width: 56px; height: 56px; color: var(--sauge); stroke-width: 2; }
.merci__coche circle { stroke-dasharray: 139; stroke-dashoffset: 139; animation: trace 0.7s var(--ease) forwards; }
.merci__coche path { stroke-dasharray: 32; stroke-dashoffset: 32; animation: trace 0.4s 0.45s var(--ease) forwards; }
@keyframes trace { to { stroke-dashoffset: 0; } }
.merci__titre { font-size: clamp(1.75rem, 5vw, 2.25rem); line-height: 1.1; }
.merci__date { font: 500 1.125rem/1.4 var(--titre); color: var(--sauge-fonce); }
.merci__date::first-letter { text-transform: uppercase; }
.merci__texte { color: var(--encre-2); }
.merci__note { font-size: 0.875rem; color: var(--encre-3); }

.sans-js { padding: var(--e-8); }

/* ---------- Mouvement réduit ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .merci__coche circle, .merci__coche path { stroke-dashoffset: 0; }
}
