/**
 * La scène du comptoir : l'app posée sur la page, manipulable.
 *
 * Le parti pris tient en une phrase : la page ne montre plus le produit, elle
 * le pose devant le visiteur. Le drapeau de baignade, la navigation interne et
 * les rubriques fonctionnent sans JavaScript ; le script n'ajoute que le
 * réveil, le son de la cloche et la personnalisation en direct.
 */

.comptoir {
  max-width: var(--colonne);
  margin: 0 auto;
  padding: 30px 20px 12px;
}

.comptoir__titre {
  font-size: var(--display);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.08;
  margin: 16px 0 14px;
  max-width: 13em;
}

.comptoir__titre em {
  font-weight: 500;
  font-style: italic;
  color: var(--tomette);
}

.comptoir__sous {
  font-size: 1.08rem;
  margin-bottom: 24px;
}

/* ------------------------------------------------------------ La cloche */

.sonnerie {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font: 700 1rem var(--texte);
  color: var(--encre);
  background: var(--sable);
  border: 1.5px solid rgba(46, 36, 26, 0.2);
  border-radius: 14px;
  padding: 12px 22px 12px 14px;
  min-height: 60px;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.2s ease;
}

.sonnerie:hover {
  border-color: var(--tomette);
}

.sonnerie:active {
  transform: translateY(2px);
}

.sonnerie__cloche {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  transform-origin: 50% 78%;
}

.sonnerie__dome { fill: var(--tomette); }
.sonnerie__socle { fill: var(--encre); }
.sonnerie__bouton { fill: var(--encre); }

.sonnerie.tinte .sonnerie__cloche {
  animation: tinter 0.55s cubic-bezier(0.3, 0, 0.2, 1);
}

@keyframes tinter {
  0% { rotate: 0deg; }
  20% { rotate: 10deg; }
  45% { rotate: -8deg; }
  70% { rotate: 4deg; }
  100% { rotate: 0deg; }
}

/* ------------------------------------------------------------ Votre enseigne */

.enseigne {
  margin: 22px 0 24px;
  padding: 16px 18px;
  background: var(--ticket);
  border: 1.5px dashed rgba(46, 36, 26, 0.28);
  border-radius: 14px;
}

.enseigne__champ span,
.enseigne__teintes legend {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(46, 36, 26, 0.65);
  margin-bottom: 6px;
}

.enseigne__champ input {
  width: 100%;
  font: 600 1.05rem var(--titres);
  color: var(--encre);
  background: transparent;
  border: none;
  border-bottom: 2px solid rgba(46, 36, 26, 0.3);
  padding: 8px 2px;
  min-height: 44px;
}

.enseigne__champ input:focus {
  outline: none;
  border-bottom-color: var(--tomette);
}

.enseigne__teintes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  border: none;
  padding: 0;
  margin: 14px 0 0;
}

.enseigne__teintes legend {
  margin-bottom: 8px;
}

.teinte {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: inset 0 0 0 2px var(--ticket), 0 0 0 1.5px transparent;
  transition: box-shadow 0.18s ease, transform 0.15s ease;
}

.teinte:hover {
  transform: scale(1.08);
}

.teinte--tomette { background: #BF4A24; }
.teinte--olivier { background: #5F6B3C; }
.teinte--lagune { background: #17605F; }
.teinte--prune { background: #5B4A7A; }

.teinte input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}

/* Le nom de la teinte n'est là que pour les lecteurs d'écran. */
.teinte span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.teinte:has(input:checked) {
  box-shadow: inset 0 0 0 3px var(--ticket), 0 0 0 2px var(--encre);
}

.teinte:has(input:focus-visible) {
  outline: 2px solid var(--tomette);
  outline-offset: 3px;
}

.comptoir__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 36px;
}

/* ------------------------------------------------------------ L'appareil */

.scene {
  position: relative;
  max-width: 380px;
  margin: 0 auto;
}

/* Toujours dans le flux : en absolu, le tampon recouvrait l'en-tête de l'app
   ou sortait de l'écran selon la largeur. */
.tampon--scene {
  display: block;
  width: max-content;
  max-width: 100%;
  margin: 0 auto 14px;
}

.appareil {
  border: 9px solid var(--encre);
  border-radius: 34px;
  background: var(--encre);
  box-shadow: 20px 26px 60px -18px rgba(46, 36, 26, 0.5);
  overflow: hidden;
  transform: rotate(-1.5deg);
  transition: filter 0.6s ease;
}

/* L'écran endormi n'est posé que par le script : sans JavaScript, tout est
   visible d'emblée. */
.appareil[data-etat="eteint"] {
  filter: brightness(0.42) saturate(0.5);
}

.appareil__ecran {
  --accent: #BF4A24;
  background: #FBF9F4;
  border-radius: 26px;
  /* Aucun défilement interne : sur un téléphone, un conteneur défilant au
     milieu de la page capture le doigt et la page semble bloquée. Une seule
     rubrique est affichée à la fois, comme dans une vraie application. */
  padding-bottom: 12px;
  font-size: 0.92rem;
}

/* Les commandes de vue : invisibles, mais ce sont elles qui pilotent tout,
   sans une ligne de JavaScript. */
.ap-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ap-carte {
  display: none;
}

#vBaignade:checked ~ .ap-corps [data-vue="baignade"],
#vMenu:checked ~ .ap-corps [data-vue="menu"],
#vAnimations:checked ~ .ap-corps [data-vue="animations"],
#vWifi:checked ~ .ap-corps [data-vue="wifi"],
#vHoraires:checked ~ .ap-corps [data-vue="horaires"] {
  display: block;
  animation: vue-entre 0.28s ease both;
}

@keyframes vue-entre {
  from { opacity: 0; translate: 0 8px; }
}

/* La hauteur est réservée pour que le changement de rubrique ne fasse pas
   sauter la page. */
.ap-corps {
  min-height: 240px;
}

.ap-entete {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 12px;
  background: var(--accent);
  color: #fff;
  transition: background-color 0.35s ease;
}

.ap-entete__pastille {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--accent);
  font: 800 1.05rem var(--titres);
  transition: color 0.35s ease;
}

.ap-entete__nom {
  font: 700 1rem var(--titres);
  line-height: 1.2;
}

.ap-entete__lieu {
  font-size: 0.78rem;
  opacity: 0.85;
}

.ap-notif {
  margin: 10px 12px 0;
  padding: 11px 13px;
  background: var(--encre);
  color: var(--papier);
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.35;
}

.ap-notif[hidden] {
  display: none;
}

.ap-notif.entre {
  animation: notif 0.45s cubic-bezier(0.2, 1.2, 0.3, 1);
}

@keyframes notif {
  from { translate: 0 -130%; opacity: 0; }
}

.ap-onglets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  background: #FBF9F4;
}

.ap-onglets::-webkit-scrollbar {
  display: none;
}

.ap-onglets label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--encre);
  background: rgba(46, 36, 26, 0.07);
  border-radius: 999px;
  padding: 8px 13px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

#vBaignade:checked ~ .ap-onglets [for="vBaignade"],
#vMenu:checked ~ .ap-onglets [for="vMenu"],
#vAnimations:checked ~ .ap-onglets [for="vAnimations"],
#vWifi:checked ~ .ap-onglets [for="vWifi"],
#vHoraires:checked ~ .ap-onglets [for="vHoraires"] {
  background: var(--accent);
  color: #fff;
}

/* Le focus clavier doit se voir sur l'étiquette, le bouton radio étant masqué. */
.ap-radio:focus-visible ~ .ap-onglets label[for] {
  outline: 2px solid var(--tomette);
  outline-offset: 2px;
}

.ap-carte {
  margin: 0 12px 12px;
  padding: 15px;
  background: #fff;
  border: 1px solid rgba(46, 36, 26, 0.1);
  border-radius: 16px;
}

.ap-carte h2 {
  font: 700 1rem var(--titres);
  margin-bottom: 10px;
}

.ap-section {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 12px 0 5px;
  transition: color 0.35s ease;
}

.ap-plat,
.ap-ligne {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dotted rgba(46, 36, 26, 0.18);
  font-size: 0.88rem;
}

.ap-plat:last-of-type,
.ap-ligne:last-of-type {
  border-bottom: none;
}

.ap-ligne small {
  display: block;
  font-size: 0.76rem;
  color: rgba(46, 36, 26, 0.6);
}

.ap-heure {
  flex-shrink: 0;
  font-weight: 700;
  color: var(--accent);
  transition: color 0.35s ease;
}

.ap-ligne code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  background: rgba(46, 36, 26, 0.07);
  border-radius: 6px;
  padding: 3px 7px;
}

.ap-note {
  margin-top: 10px;
  font-size: 0.8rem;
  color: rgba(46, 36, 26, 0.65);
}

/* ------------------------------------------------------------ Le drapeau */

.drapeau {
  border: none;
  padding: 0;
  margin: 0;
}

.drapeau legend {
  font-size: 0.76rem;
  color: rgba(46, 36, 26, 0.6);
  margin-bottom: 10px;
}

.drapeau input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.drapeau__scene {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--couleur-drapeau, #3D9D4E) 12%, transparent);
  transition: background-color 0.3s ease;
}

.drapeau__mat {
  width: 3px;
  height: 44px;
  flex-shrink: 0;
  background: var(--encre);
  border-radius: 2px;
}

/* Le tissu flotte : c'est ce qui rend le drapeau vivant plutôt qu'un rond de couleur. */
.drapeau__tissu {
  position: absolute;
  left: 17px;
  top: 12px;
  width: 34px;
  height: 22px;
  background: var(--couleur-drapeau, #3D9D4E);
  clip-path: polygon(0 0, 100% 0, 100% 76%, 0 100%);
  transform-origin: left center;
  animation: flotte 1.8s ease-in-out infinite alternate;
  transition: background-color 0.3s ease;
}

@keyframes flotte {
  from { transform: skewY(-3deg) scaleX(0.96); }
  to { transform: skewY(3deg) scaleX(1.03); }
}

.drapeau__scene p {
  margin-left: 42px;
  font-size: 0.85rem;
  line-height: 1.35;
  display: none;
}

.drapeau__scene p strong {
  font-family: var(--titres);
}

#dVert:checked ~ .drapeau__scene { --couleur-drapeau: #3D9D4E; }
#dVert:checked ~ .drapeau__scene [data-vert] { display: block; }
#dJaune:checked ~ .drapeau__scene { --couleur-drapeau: #D9A92B; }
#dJaune:checked ~ .drapeau__scene [data-jaune] { display: block; }
#dRouge:checked ~ .drapeau__scene { --couleur-drapeau: #B3372A; }
#dRouge:checked ~ .drapeau__scene [data-rouge] { display: block; }

.drapeau__choix {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.drapeau__choix label {
  flex: 1;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1.5px solid rgba(46, 36, 26, 0.2);
  border-radius: 10px;
  padding: 9px;
  min-height: 40px;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.drapeau__choix label:hover {
  border-color: var(--encre);
}

#dVert:checked ~ .drapeau__choix [for="dVert"],
#dJaune:checked ~ .drapeau__choix [for="dJaune"],
#dRouge:checked ~ .drapeau__choix [for="dRouge"] {
  background: var(--encre);
  border-color: var(--encre);
  color: var(--papier);
}

.scene__legende {
  margin-top: 16px;
  font-style: italic;
  font-size: 0.9rem;
  text-align: center;
  color: rgba(46, 36, 26, 0.7);
}

/* ------------------------------------------------------------ Bureau */

@media (min-width: 940px) {
  .comptoir {
    display: grid;
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    gap: 0 56px;
    align-items: start;
    padding-top: 44px;
  }

  .comptoir__texte {
    padding-top: 20px;
  }

  .scene {
    margin: 0;
    max-width: 400px;
    position: sticky;
    top: 28px;
  }

  /* Le pointeur incline légèrement l'appareil : posé par le script. */
  .appareil {
    transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) rotate(-1.5deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .drapeau__tissu,
  .sonnerie__cloche,
  .ap-notif {
    animation: none !important;
  }

  .appareil {
    transition: none;
  }
}

/* ------------------------------------------------------------ Mouvement au défilement */

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    /* L'état masqué vit dans les keyframes : sans prise en charge de la
       timeline, rien n'est jamais caché. */
    .etape,
    .reference__carte,
    .questions details,
    .ticket {
      animation: revele linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 34%;
    }

    .tampon {
      animation: tampon-pose linear both;
      animation-timeline: view();
      animation-range: entry 5% entry 42%;
    }

    /* Parallaxe douce sur les photos d'ambiance. */
    /* Le conteneur recadre : sans lui, l'agrandissement de la parallaxe
       débordait de la page et décalait tout sur iOS. */
    .etape__photo picture,
    .reference__photo picture {
      display: block;
      overflow: clip;
    }

    .etape__photo img,
    .reference__photo img {
      scale: 1.08;
      animation: parallaxe linear both;
      animation-timeline: view();
      animation-range: cover 0% cover 100%;
    }
  }
}

@keyframes revele {
  from { opacity: 0; translate: 0 26px; }
  to { opacity: 1; translate: 0 0; }
}

@keyframes tampon-pose {
  0% { opacity: 0; scale: 2.2; rotate: -16deg; }
  55% { opacity: 1; scale: 0.94; rotate: -4deg; }
  75% { scale: 1.03; }
  100% { opacity: 1; scale: 1; rotate: var(--rot, -2.5deg); }
}

@keyframes parallaxe {
  from { translate: 0 -4%; }
  to { translate: 0 4%; }
}

/* L'accompagnement humain : dit là où le doute se joue, sans en faire un slogan. */
.etape__humain {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--sable);
  border-left: 3px solid var(--tomette);
  border-radius: 0 10px 10px 0;
  font-size: 0.96rem;
}

/* ------------------------------------------------------------ Créer son app */

.creer {
  max-width: var(--colonne);
  margin: 0 auto;
  padding: 44px 20px 70px;
  display: grid;
  gap: 34px;
}

.creer h1 {
  font-size: clamp(1.9rem, 1.4rem + 2.4vw, 2.7rem);
  font-weight: 800;
  letter-spacing: -0.015em;
  margin: 14px 0 12px;
}

.creer__lede {
  font-size: 1.08rem;
  margin-bottom: 20px;
}

.creer__points {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.creer__points li {
  position: relative;
  padding-left: 28px;
  font-size: 0.98rem;
}

.creer__points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 14px;
  height: 8px;
  border-left: 2.5px solid var(--olivier);
  border-bottom: 2.5px solid var(--olivier);
  rotate: -45deg;
}

.creer__form,
.creer__reussite {
  background: var(--ticket);
  border: 1.5px solid rgba(46, 36, 26, 0.22);
  border-radius: 18px;
  padding: 26px 22px 24px;
}

.creer__form[hidden],
.creer__reussite[hidden] {
  display: none;
}

.creer__champ {
  display: block;
  margin-bottom: 18px;
}

.creer__champ > span {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(46, 36, 26, 0.65);
  margin-bottom: 6px;
}

.creer__champ input,
.creer__champ select {
  width: 100%;
  font: 400 1.05rem var(--texte);
  color: var(--encre);
  background: #fff;
  border: 2px solid rgba(46, 36, 26, 0.2);
  border-radius: 12px;
  padding: 13px 14px;
  min-height: 52px;
}

.creer__champ input:focus,
.creer__champ select:focus {
  outline: none;
  border-color: var(--tomette);
}

.creer__champ small {
  display: block;
  margin-top: 6px;
  font-size: 0.84rem;
  color: rgba(46, 36, 26, 0.65);
}

.creer__form .bouton {
  width: 100%;
  margin-top: 6px;
}

.creer__statut {
  margin-top: 12px;
  font-weight: 600;
  min-height: 1.4em;
}

.creer__statut.est-erreur {
  color: var(--brique);
}

.creer__mentions {
  margin-top: 14px;
  font-size: 0.86rem;
  color: rgba(46, 36, 26, 0.65);
}

.creer__reussite h2 {
  font-size: 1.5rem;
  margin: 12px 0 10px;
}

.creer__url {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 10px 0 18px;
  word-break: break-all;
}

.creer__identifiants {
  background: #fff;
  border: 1.5px dashed rgba(46, 36, 26, 0.3);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 18px;
}

.creer__identifiants p {
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.creer__identifiants strong {
  display: block;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(46, 36, 26, 0.6);
}

.creer__identifiants code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.05rem;
  background: var(--sable);
  border-radius: 6px;
  padding: 4px 9px;
}

.creer__note {
  font-size: 0.84rem;
  color: rgba(46, 36, 26, 0.65);
}

.creer__reussite .bouton {
  width: 100%;
}

@media (min-width: 880px) {
  .creer {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    align-items: start;
    gap: 56px;
  }

  .creer__intro {
    padding-top: 12px;
  }
}

/* Autocomplétion des établissements sur la page de création. */

.creer__champ--suggest {
  position: relative;
}

.creer__champ--suggest > label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(46, 36, 26, 0.65);
  margin-bottom: 6px;
}

.creer__champ--suggest input {
  width: 100%;
  font: 400 1.05rem var(--texte);
  color: var(--encre);
  background: #fff;
  border: 2px solid rgba(46, 36, 26, 0.2);
  border-radius: 12px;
  padding: 13px 14px;
  min-height: 52px;
}

.creer__champ--suggest input:focus {
  outline: none;
  border-color: var(--tomette);
}

.creer__champ--suggest small {
  display: block;
  margin-top: 6px;
  font-size: 0.84rem;
  color: rgba(46, 36, 26, 0.65);
}

/* Fiche reconnue : la promesse devient concrète, on le dit. */
.creer__champ--suggest small.est-confirme {
  color: var(--olivier);
  font-weight: 600;
}

.creer__suggestions {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 20;
  margin-top: 4px;
  background: #fff;
  border: 1.5px solid rgba(46, 36, 26, 0.25);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 10px 16px 36px -14px rgba(46, 36, 26, 0.4);
}

.creer__suggestions[hidden] {
  display: none;
}

.creer__suggestions li {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 11px 14px;
  min-height: 50px;
  cursor: pointer;
  border-bottom: 1px solid rgba(46, 36, 26, 0.1);
}

.creer__suggestions li:last-child {
  border-bottom: none;
}

.creer__suggestions li.est-actif,
.creer__suggestions li:hover {
  background: var(--sable);
}

.creer__suggestions strong {
  font-family: var(--titres);
  font-size: 1rem;
}

.creer__suggestions span {
  font-size: 0.84rem;
  color: rgba(46, 36, 26, 0.65);
}

/* Copier le mot de passe : un geste au lieu d'une dictée. */
.creer__copier {
  font: 600 0.78rem var(--texte, sans-serif);
  margin-left: 8px;
  padding: 6px 12px;
  min-height: 32px;
  border: 1.5px solid rgba(46, 36, 26, 0.3);
  border-radius: 999px;
  background: #fff;
  color: var(--encre, #2e241a);
  cursor: pointer;
}

.creer__copier:active {
  transform: translateY(1px);
}

/* « Me renvoyer mes accès » : un filet de sécurité, pas un appel à l'action. */
.creer__renvoyer {
  display: block;
  margin: 14px auto 0;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
}

.creer__sans-fiche {
  display: block;
  margin-top: 6px;
  color: rgba(46, 36, 26, 0.6);
}
