/* Complicéo — feuille de style unique (landing + app)

   Ambiance : nuit sensuelle. Fond aubergine presque noir, texte crème à fort contraste,
   accent rouge braise. Aucun orange.
   Titres : Bodoni Moda italique (élégance, lingerie, sensualité).
   Texte courant : Bricolage Grotesque.
   Les deux polices sont hébergées sur le site (aucune requête vers un tiers). */

@font-face {
  font-family: "Bodoni";
  src: url("/fonts/bodoni-moda-italic.woff2") format("woff2-variations");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Bricolage";
  src: url("/fonts/bricolage-grotesque.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-style: normal;
  font-display: swap;
}

:root {
  --nuit: #17101A;
  --velours: #241821;
  --velours-2: #2E1F2A;
  --creme: #F4E9E1;
  --poudre: #CDB8B0;
  --braise: #C2253D;
  --braise-fonce: #9E1A30;
  --braise-clair: #E8566A;
  --trait: #3D2B37;
  --largeur: 1120px;
  --marge: 24px;
  --titre: "Bodoni", "Didot", "Bodoni 72", Georgia, serif;
  --texte: "Bricolage", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  background: var(--nuit);
}

body {
  margin: 0;
  background: var(--nuit);
  color: var(--creme);
  font-family: var(--texte);
  font-size: 18px;
  line-height: 1.6;
}

img {
  display: block;
  max-width: 100%;
}

/* L'attribut hidden doit toujours l'emporter (sinon .btn { display: inline-block } le neutralise). */
[hidden] {
  display: none !important;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--creme);
  font-family: var(--titre);
  font-style: italic;
  font-weight: 500;
  font-optical-sizing: auto;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--braise-clair);
}

::selection {
  background: var(--braise);
  color: var(--creme);
}

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

.wrap {
  max-width: var(--largeur);
  margin: 0 auto;
  padding: 0 var(--marge);
}

/* ---------- Bouton ---------- */

.btn {
  display: inline-block;
  background: var(--braise);
  color: var(--creme);
  border: 0;
  border-radius: 999px;
  padding: 15px 30px;
  font-family: var(--texte);
  font-size: 1.1rem;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  background: var(--braise-fonce);
}

.btn[disabled] {
  background: var(--velours-2);
  color: var(--poudre);
  cursor: not-allowed;
}

.btn-petit {
  padding: 10px 20px;
  font-size: 1rem;
}

/* ---------- Landing : en-tête ---------- */

.entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
}

.marque {
  font-family: var(--titre);
  font-style: italic;
  font-size: 1.7rem;
  font-weight: 500;
  color: var(--creme);
  text-decoration: none;
}

/* ---------- Landing : hero ---------- */

/* Texte à gauche dans la nuit, photo qui déborde jusqu'au bord droit de l'écran. */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  min-height: min(calc(100vh - 76px), 880px);
}

.hero-texte {
  align-self: center;
  padding: 48px 56px 80px max(var(--marge), calc((100vw - var(--largeur)) / 2 + var(--marge)));
}

.hero h1 {
  font-size: clamp(2.8rem, 4.9vw, 4.6rem);
  line-height: 1;
  letter-spacing: -0.01em;
  margin-bottom: 0.5em;
}

.hero-chapo {
  font-size: 1.2rem;
  color: var(--poudre);
  max-width: 30em;
  margin-bottom: 1.9em;
}

.hero-age {
  margin: 1.4em 0 0;
  font-size: 0.95rem;
  color: var(--poudre);
  max-width: 30em;
}

.hero-photo {
  position: relative;
  overflow: hidden;
  background: var(--velours);
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 50%;
  animation: apparition 1.8s ease-out both;
}

/* Vidéo du hero : posée par-dessus la photo, invisible tant qu'elle ne joue pas. */
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 50%;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.hero-photo.video-prete .hero-video {
  opacity: 1;
}

/* Fondu du bord gauche de la photo dans la nuit */
.hero-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--nuit) 0%, rgba(23, 16, 26, 0) 22%);
  pointer-events: none;
}

@keyframes apparition {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ---------- Landing : sections ---------- */

.section {
  padding: 104px 0;
}

.section-velours {
  background: var(--velours);
}

.section h2 {
  font-size: clamp(2.2rem, 4.4vw, 3.4rem);
  line-height: 1.04;
  margin-bottom: 0.7em;
  max-width: 15em;
}

/* Photo + texte côte à côte */
.duo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 64px;
  align-items: center;
}

.duo-photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 2px;
}

.duo-inverse .duo-photo {
  order: 2;
}

/* Liste des traces : de simples lignes séparées par un filet */
.traces {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--trait);
}

.traces li {
  padding: 14px 0;
  border-bottom: 1px solid var(--trait);
  color: var(--poudre);
}

/* Promesses : liste de définitions sur deux colonnes, sans cartes */
.promesses {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 64px;
  margin: 0;
}

.promesse {
  padding: 26px 0 22px;
  border-top: 1px solid var(--trait);
}

.promesse dt {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.promesse dd {
  margin: 0;
  color: var(--poudre);
  max-width: 32em;
}

/* Défi : un échange montré tel qu'il apparaîtra dans l'app */
.defi {
  display: grid;
  gap: 12px;
  max-width: 26em;
  margin-top: 2em;
}

.bulle {
  padding: 14px 18px;
  border-radius: 18px;
  background: var(--velours-2);
  color: var(--creme);
  max-width: 85%;
}

.bulle-moi {
  justify-self: end;
  background: var(--braise);
  border-bottom-right-radius: 6px;
}

.bulle-toi {
  border-bottom-left-radius: 6px;
}

.bulle-etat {
  justify-self: end;
  font-size: 0.9rem;
  color: var(--poudre);
}

.texte-court {
  max-width: 32em;
  color: var(--poudre);
}

/* Effacement : aperçu du choix de délai */
.delais {
  list-style: none;
  margin: 1.6em 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.delais li {
  padding: 8px 16px;
  border: 1px solid var(--trait);
  border-radius: 8px;
  background: var(--velours-2);
  font-size: 1rem;
  font-weight: 600;
  color: var(--poudre);
}

.delais li[aria-current="true"] {
  border-color: var(--braise-clair);
  color: var(--creme);
}

/* Étapes : vraie séquence, donc numérotée */
.etapes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 40px;
  counter-reset: etape;
}

.etapes li {
  counter-increment: etape;
  color: var(--poudre);
}

.etapes li::before {
  content: counter(etape);
  display: block;
  font-family: var(--titre);
  font-style: italic;
  font-size: 4.2rem;
  font-weight: 500;
  line-height: 1;
  color: var(--braise-clair);
  margin-bottom: 12px;
}

.etapes li span {
  display: block;
  color: var(--creme);
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 4px;
}

/* À savoir : deux colonnes de texte */
.savoir {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 64px;
}

.savoir h3 {
  font-size: 1.7rem;
  line-height: 1.1;
  margin-bottom: 12px;
}

.savoir p {
  color: var(--poudre);
}

/* Appel final : la robe tombée au pied du lit, le texte posé dans la partie sombre à gauche. */
.final {
  display: flex;
  align-items: center;
  min-height: min(76vh, 680px);
  padding: 96px 0;
  text-align: left;
  background:
    linear-gradient(90deg, rgba(23, 16, 26, 0.96) 0%, rgba(23, 16, 26, 0.82) 34%, rgba(23, 16, 26, 0.25) 52%, rgba(23, 16, 26, 0) 66%),
    url("/img/lereste.webp") 70% 50% / cover no-repeat,
    var(--nuit);
}

.final .wrap {
  width: 100%;
}

.final p {
  font-family: var(--titre);
  font-style: italic;
  font-size: clamp(2.5rem, 4.2vw, 3.6rem);
  font-weight: 500;
  line-height: 1.02;
  max-width: 7.4em;
  margin-bottom: 0.7em;
}

.final-prix {
  display: block;
  margin-top: 16px;
  font-size: 0.95rem;
  color: var(--poudre);
}

.pied {
  padding: 28px 0 40px;
  border-top: 1px solid var(--trait);
  color: var(--poudre);
  font-size: 0.95rem;
}

.pied .wrap {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.pied p {
  margin: 0;
}

/* ---------- Landing : mobile ---------- */

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero-photo {
    order: -1;
    width: 100%;
    aspect-ratio: 4 / 5;
    max-height: 72vh;
  }

  .hero-photo::after {
    background: linear-gradient(0deg, var(--nuit) 0%, rgba(23, 16, 26, 0) 28%);
  }

  /* La version mobile de la vidéo est déjà recadrée sur le couple. */
  .hero-video {
    object-position: 50% 50%;
  }

  .hero-texte {
    padding: 28px var(--marge) 64px;
  }

  .section {
    padding: 72px 0;
  }

  .duo {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .duo-inverse .duo-photo {
    order: 0;
  }

  .promesses {
    grid-template-columns: 1fr;
  }

  .etapes {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .etapes li {
    display: grid;
    grid-template-columns: 56px 1fr;
    align-items: start;
  }

  .etapes li::before {
    font-size: 3.2rem;
    margin: 0;
    grid-row: span 2;
  }

  .savoir {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .final {
    align-items: flex-end;
    min-height: 640px;
    padding: 72px 0 64px;
    background:
      linear-gradient(0deg, rgba(23, 16, 26, 0.96) 0%, rgba(23, 16, 26, 0.75) 38%, rgba(23, 16, 26, 0) 70%),
      url("/img/lereste.webp") 58% 50% / cover no-repeat,
      var(--nuit);
  }
}

/* Petit écran : le bouton de l'en-tête passerait sur deux lignes. Le bouton du hero prend le relais,
   et la photo est raccourcie pour qu'il reste proche du haut de page. */
@media (max-width: 560px) {
  .entete .btn-petit {
    display: none;
  }

  .hero-photo {
    max-height: 58vh;
  }
}

/* ---------- App ---------- */

/* Fond de l'app : velours aubergine, assombri pour garder le texte lisible et l'écran neutre.
   Élément fixe plutôt que background-attachment: fixed (cassé sur iPhone). */
body.app {
  background: transparent;
}

body.app::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(23, 16, 26, 0.6), rgba(23, 16, 26, 0.6)),
    url("/img/fond.webp") center / cover no-repeat,
    var(--nuit);
}

.app-main {
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(40px + env(safe-area-inset-top)) var(--marge) calc(32px + env(safe-area-inset-bottom));
  max-width: 560px;
  margin: 0 auto;
}

.app-main h1 {
  font-size: 2.8rem;
  line-height: 1;
  margin-bottom: 0.4em;
}

.app-chapo {
  font-size: 1.1rem;
  color: var(--poudre);
  margin-bottom: 1.6em;
}

.app-steps {
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
  counter-reset: etape;
  display: grid;
  gap: 12px;
}

.app-steps li {
  counter-increment: etape;
  position: relative;
  padding: 14px 16px 14px 58px;
  background: rgba(36, 24, 33, 0.88);
  border: 1px solid var(--trait);
  border-radius: 14px;
}

.app-steps li::before {
  content: counter(etape);
  position: absolute;
  left: 18px;
  top: 10px;
  font-family: var(--titre);
  font-style: italic;
  font-size: 2rem;
  font-weight: 500;
  line-height: 1;
  color: var(--braise-clair);
}

.app-message {
  margin: 0 0 18px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--trait);
  background: rgba(36, 24, 33, 0.92);
  color: var(--creme);
}

.app-message-ok {
  border-color: var(--braise-clair);
}

.app-message-erreur {
  border-color: var(--braise);
  background: rgba(62, 18, 30, 0.92);
}

/* Blocs d'action de l'app (départ, formulaires, confirmation, connecté) */
.bloc {
  display: grid;
  gap: 14px;
  justify-items: start;
}

.bloc p {
  margin: 0;
  color: var(--poudre);
}

.bloc-titre {
  font-size: 2rem;
  line-height: 1.05;
  margin-bottom: 4px;
}

.formulaire {
  justify-items: stretch;
}

.formulaire .btn {
  justify-self: start;
}

.champ {
  display: grid;
  gap: 6px;
  font-size: 0.95rem;
  color: var(--poudre);
}

.champ input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--trait);
  background: rgba(23, 16, 26, 0.85);
  color: var(--creme);
  font-family: var(--texte);
  font-size: 1.05rem;
}

.champ input:focus {
  outline: none;
  border-color: var(--braise-clair);
  box-shadow: 0 0 0 3px rgba(232, 86, 106, 0.25);
}

.aide {
  font-size: 0.9rem;
}

.case {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  color: var(--poudre);
  font-size: 0.95rem;
  cursor: pointer;
}

.case input {
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  accent-color: var(--braise);
}

.lien {
  justify-self: start;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--poudre);
  font-family: var(--texte);
  font-size: 0.95rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.lien:hover {
  color: var(--creme);
}

.app-steps + .app-message {
  margin-top: -8px;
}

.step-title {
  display: block;
  font-weight: 600;
}

.step-text {
  display: block;
  color: var(--poudre);
  font-size: 0.95rem;
}

/* Contenus intimes (photos, vidéos, vocaux) : pas de menu « Enregistrer », pas de glisser-déposer, pas de sélection.
   Toute photo affichée dans l'app doit porter la classe .media. */
.media,
.media * {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* Voile de discrétion : recouvre tout dès que l'app passe en arrière-plan. */
.voile {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--nuit);
  display: flex;
  align-items: center;
  justify-content: center;
}

.voile[hidden] {
  display: none;
}

body.voile-actif .app-main,
body.voile-actif .carnet {
  filter: blur(24px);
}

/* ---------- App : connecté (code reçu, paiement) ---------- */

.connecte > h1,
.connecte .app-chapo,
.connecte .app-steps {
  display: none;
}

.bloc-separe {
  margin-top: 10px;
  padding-top: 24px;
  border-top: 1px solid var(--trait);
}

.bloc-sous-titre {
  font-size: 1.7rem;
  line-height: 1.1;
}

.champ input.champ-code {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.btn-second {
  background: transparent;
  color: var(--creme);
  border: 1px solid var(--trait);
}

.btn-second:hover {
  background: var(--velours-2);
}

.btn.a-confirmer,
.lien.a-confirmer {
  background: var(--braise);
  border-color: var(--braise);
  color: var(--creme);
}

.lien.a-confirmer {
  padding: 4px 10px;
  border-radius: 8px;
  text-decoration: none;
}

/* ---------- Le carnet ---------- */

body.carnet-ouvert {
  overflow: hidden;
}

.carnet {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

.carnet-tete {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(14px + env(safe-area-inset-top)) 16px 12px;
  border-bottom: 1px solid rgba(61, 43, 55, 0.7);
  background: rgba(23, 16, 26, 0.82);
}

.carnet-titre {
  flex: 1;
  min-width: 0;
  font-size: 1.9rem;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icone {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--trait);
  border-radius: 50%;
  background: rgba(23, 16, 26, 0.6);
  color: var(--creme);
  cursor: pointer;
}

.icone svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icone-plein {
  background: var(--braise);
  border-color: var(--braise);
}

.icone-plein:hover {
  background: var(--braise-fonce);
}

.icone.ouvert svg {
  transform: rotate(45deg);
}

.carnet-message {
  margin: 12px 16px 0;
}

.carnet-bandeau {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 16px 0;
  padding: 10px 14px;
  border: 1px solid var(--trait);
  border-radius: 12px;
  background: rgba(36, 24, 33, 0.92);
  font-size: 0.95rem;
  color: var(--poudre);
}

.carnet-bandeau p {
  margin: 0;
}

.carnet-corps {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
}

.panneau {
  width: 100%;
  max-width: 560px;
  margin: auto;
  padding: 28px 24px;
  display: grid;
  gap: 14px;
  justify-items: start;
}

.panneau h2 {
  font-size: 2.2rem;
  line-height: 1.05;
}

.panneau p {
  margin: 0;
  color: var(--poudre);
}

.panneau .code {
  margin: 4px 0 0;
  font-size: 2.6rem;
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0.12em;
  color: var(--creme);
  font-variant-numeric: tabular-nums;
}

.rangee {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 6px 0;
}

/* Carte du code (ou d'attente) en haut du carnet, quand l'autre personne n'a pas encore rejoint */
.panneau.panneau-carte {
  width: calc(100% - 28px);
  margin: 14px auto 0;
  padding: 22px 20px;
  border: 1px solid var(--trait);
  border-radius: 18px;
  background: rgba(36, 24, 33, 0.94);
}

.panneau.panneau-carte h2 {
  font-size: 1.9rem;
}

.panneau.panneau-carte .code {
  font-size: 2.3rem;
}

.panneau.panneau-carte p {
  font-size: 0.95rem;
}

.panneau.panneau-carte .rangee .btn {
  padding: 12px 22px;
  font-size: 1rem;
}

/* Exemples : le carnet tel qu'il sera, sans contenu réel */
.fil-exemples {
  flex: 1 0 auto;
}

.exemples-intro {
  align-self: center;
  max-width: 26em;
  margin: 4px 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--poudre);
}

.item-exemple {
  opacity: 0.88;
  pointer-events: none;
}

/* Le fil des échanges */
.fil {
  flex: 1 0 auto;
  margin: 0;
  padding: 18px 14px 10px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fil-vide {
  margin: auto;
  padding: 24px 32px;
  max-width: 24em;
  text-align: center;
  color: var(--poudre);
}

.item {
  display: flex;
  flex-direction: column;
  max-width: min(84%, 460px);
  gap: 4px;
}

.item-moi {
  align-self: flex-end;
  align-items: flex-end;
}

.item-toi {
  align-self: flex-start;
  align-items: flex-start;
}

.item .bulle {
  max-width: 100%;
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.item-moi .bulle {
  background: var(--braise);
  border-bottom-right-radius: 6px;
}

.item-toi .bulle {
  border-bottom-left-radius: 6px;
}

.item .bulle-illisible {
  background: transparent;
  border: 1px dashed var(--trait);
  color: var(--poudre);
  font-size: 0.95rem;
}

.item-pied {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0 6px;
  font-size: 0.78rem;
  color: var(--poudre);
}

.item-effacer {
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--poudre);
  font-family: var(--texte);
  font-size: 0.78rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.item-effacer.a-confirmer {
  color: var(--braise-clair);
  font-weight: 650;
}

/* Photo : rien ne s'affiche tant qu'elle n'est pas déchiffrée */
.item .bulle-photo {
  width: min(70vw, 300px);
  padding: 0;
  overflow: hidden;
  background: linear-gradient(135deg, var(--velours-2), var(--velours));
  cursor: zoom-in;
}

.item-moi .bulle-photo {
  background: linear-gradient(135deg, var(--velours-2), var(--velours));
}

.bulle-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.bulle-photo.chargee img {
  opacity: 1;
}

.bulle-photo.illisible::after {
  content: "Photo illisible";
  display: block;
  padding: 16px;
  color: var(--poudre);
  font-size: 0.9rem;
}

/* Vocal */
.item .bulle-vocal {
  padding: 6px;
}

.vocal-lecture {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(23, 16, 26, 0.35);
  color: var(--creme);
  font-family: var(--texte);
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.vocal-lecture::before {
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 7px 0 7px 12px;
  border-color: transparent transparent transparent currentColor;
}

.en-lecture .vocal-lecture::before {
  width: 11px;
  height: 14px;
  border-width: 0 4px;
  border-color: transparent currentColor;
}

/* Défi : carte à part, pour les deux */
.item .bulle-defi,
.item-moi .bulle-defi {
  display: grid;
  gap: 6px;
  min-width: min(70vw, 260px);
  padding: 16px 18px;
  border: 1px solid var(--braise-clair);
  border-radius: 18px;
  background: rgba(36, 24, 33, 0.96);
  white-space: normal;
}

.defi-titre {
  margin: 0;
  font-family: var(--titre);
  font-style: italic;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--braise-clair);
}

.defi-texte {
  margin: 0;
  font-size: 1.05rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.defi-limite,
.defi-etat {
  margin: 0;
  font-size: 0.85rem;
  color: var(--poudre);
}

.defi-etat:empty,
.defi-limite:empty,
.defi-choix:empty {
  display: none;
}

.defi-etat {
  color: var(--creme);
  font-weight: 650;
}

.defi-choix {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

/* Zone d'écriture */
.compose {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(61, 43, 55, 0.7);
  background: rgba(23, 16, 26, 0.94);
}

.compose-ligne {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.compose-ligne textarea {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  max-height: 140px;
  padding: 10px 16px;
  border: 1px solid var(--trait);
  border-radius: 22px;
  background: rgba(23, 16, 26, 0.9);
  color: var(--creme);
  font-family: var(--texte);
  font-size: 1.05rem;
  line-height: 1.4;
  resize: none;
}

.compose-ligne textarea:focus {
  outline: none;
  border-color: var(--braise-clair);
}

.mode-defi .compose-ligne textarea {
  border-color: var(--braise-clair);
}

.delai {
  justify-self: start;
  padding: 2px 4px;
  border: 0;
  background: none;
  color: var(--poudre);
  font-family: var(--texte);
  font-size: 0.85rem;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  cursor: pointer;
}

.compose-defi {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.compose-defi-titre {
  font-family: var(--titre);
  font-style: italic;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--braise-clair);
}

.compose-defi-limite {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--poudre);
  font-size: 0.95rem;
}

.compose-defi select {
  padding: 6px 10px;
  border: 1px solid var(--trait);
  border-radius: 10px;
  background: var(--nuit);
  color: var(--creme);
  font-family: var(--texte);
  font-size: 1rem;
}

.compose-vocal {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
}

.vocal-point {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--braise-clair);
  animation: battement 1.2s ease-in-out infinite;
}

.vocal-duree {
  flex: 1;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

@keyframes battement {
  50% {
    opacity: 0.3;
  }
}

.tiroir {
  position: absolute;
  left: 12px;
  bottom: calc(100% + 8px);
  z-index: 10;
  display: grid;
  min-width: 230px;
  border: 1px solid var(--trait);
  border-radius: 16px;
  background: var(--velours);
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.tiroir-choix {
  position: relative;
  display: block;
  padding: 15px 18px;
  border: 0;
  border-bottom: 1px solid var(--trait);
  background: none;
  color: var(--creme);
  font-family: var(--texte);
  font-size: 1.05rem;
  text-align: left;
  cursor: pointer;
}

.tiroir-choix:last-child {
  border-bottom: 0;
}

.tiroir-choix:hover {
  background: var(--velours-2);
}

.invisible {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Plein écran : aperçu avant envoi et photo en grand */
.plein-ecran {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  background: var(--nuit);
}

.plein-ecran img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.plein-ecran-actions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(24px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  gap: 12px;
}

#visionneuse {
  cursor: zoom-out;
}

/* Réglages */
.feuille {
  position: fixed;
  inset: 0;
  z-index: 800;
  display: flex;
  align-items: flex-end;
  background: rgba(10, 6, 12, 0.7);
}

.feuille-corps {
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  max-height: 88dvh;
  margin: 0 auto;
  padding: 26px 22px calc(22px + env(safe-area-inset-bottom));
  overflow-y: auto;
  display: grid;
  gap: 24px;
  border: 1px solid var(--trait);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  background: var(--velours);
}

.feuille-corps h2 {
  font-size: 2.1rem;
  line-height: 1;
}

.feuille-section {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.feuille-section h3 {
  font-family: var(--texte);
  font-style: normal;
  font-size: 1.05rem;
  font-weight: 650;
}

.feuille-section p {
  margin: 0;
  color: var(--poudre);
  font-size: 0.95rem;
}

.feuille-section .champ {
  width: 100%;
}

.autre-app {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--trait);
  border-radius: 14px;
  color: var(--creme);
  text-decoration: none;
}

.autre-app:hover {
  border-color: var(--poudre);
}

.autre-app-nom {
  font-weight: 650;
}

.autre-app-texte {
  font-size: 0.9rem;
  color: var(--poudre);
}

.pied-autres a {
  color: var(--creme);
}

.feuille-ligne {
  display: grid;
  gap: 10px;
  justify-items: start;
  width: 100%;
}

.voile-corps {
  display: grid;
  gap: 14px;
  justify-items: center;
  width: min(320px, 100% - 48px);
}

.voile-code {
  display: grid;
  gap: 14px;
  justify-items: center;
  width: 100%;
}

.voile-code .champ {
  width: 100%;
  text-align: center;
}

.voile-code input {
  text-align: center;
  font-size: 1.6rem;
  letter-spacing: 0.4em;
}

.voile-code .lien {
  justify-self: center;
}

.voile-message {
  min-height: 1.4em;
  margin: 0;
  color: var(--poudre);
  font-size: 0.95rem;
  text-align: center;
}

.feuille-pied {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 6px;
  border-top: 1px solid var(--trait);
}

/* ---------- Tableau de bord (/tableau/) ---------- */

body.tableau {
  background: var(--nuit);
}

.tb {
  max-width: 980px;
  margin: 0 auto;
  padding: calc(32px + env(safe-area-inset-top)) var(--marge) 56px;
  display: grid;
  gap: 28px;
}

.tb-tete h1 {
  font-size: 2.6rem;
  line-height: 1;
}

.tb-chapo {
  margin: 8px 0 0;
  color: var(--poudre);
}

.tb-cle {
  display: grid;
  gap: 14px;
  justify-items: start;
  max-width: 420px;
}

.tb-cle .champ {
  width: 100%;
}

#tb-contenu {
  display: grid;
  gap: 28px;
  transition: opacity 0.2s ease;
}

#tb-contenu.tb-recharge {
  opacity: 0.55;
}

.tb-filtres {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tb-filtre {
  padding: 8px 14px;
  border: 1px solid var(--trait);
  border-radius: 999px;
  background: transparent;
  color: var(--poudre);
  font-family: var(--texte);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.tb-filtre[aria-pressed="true"] {
  border-color: var(--creme);
  background: var(--creme);
  color: var(--nuit);
}

.tb-actualiser {
  margin-left: auto;
}

.tb-carte,
.tb-tuile {
  margin: 0;
  padding: 18px 20px;
  border: 1px solid var(--trait);
  border-radius: 16px;
  background: var(--velours);
}

.tb-etiquette {
  margin: 0;
  font-family: var(--texte);
  font-style: normal;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--poudre);
}

.tb-hero-valeur {
  margin: 6px 0 2px;
  font-size: 4rem;
  font-weight: 650;
  line-height: 1;
  color: var(--creme);
}

.tb-note {
  margin: 0;
  font-size: 0.9rem;
  color: var(--poudre);
}

.tb-tuiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.tb-valeur {
  margin: 6px 0 0;
  font-size: 2rem;
  font-weight: 650;
  line-height: 1.1;
  color: var(--creme);
}

.tb-tuile .tb-note {
  margin-top: 4px;
  font-size: 0.82rem;
}

.tb-section {
  display: grid;
  gap: 14px;
}

.tb-section h2 {
  font-size: 2rem;
  line-height: 1.05;
}

.tb-graphe {
  margin-top: 12px;
  width: 100%;
}

.tb-graphe svg {
  display: block;
  max-width: 100%;
  height: auto;
}

.tb-grille {
  stroke: var(--trait);
  stroke-width: 1;
}

.tb-axe {
  fill: var(--poudre);
  font-family: var(--texte);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.tb-zone {
  cursor: default;
  outline: none;
}

.tb-zone:hover,
.tb-zone:focus-visible {
  fill: rgba(244, 233, 225, 0.06);
}

.tb-bulle {
  position: absolute;
  z-index: 50;
  min-width: 140px;
  padding: 10px 12px;
  border: 1px solid var(--trait);
  border-radius: 10px;
  background: var(--nuit);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.tb-bulle p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--poudre);
}

.tb-bulle .tb-bulle-valeur {
  font-size: 1rem;
  font-weight: 650;
  color: var(--creme);
}

/* Entonnoir : barres horizontales, ordre naturel des étapes */
.tb-entonnoir {
  margin: 0;
  padding: 18px 20px;
  list-style: none;
  display: grid;
  gap: 12px;
  border: 1px solid var(--trait);
  border-radius: 16px;
  background: var(--velours);
}

.tb-etape {
  display: grid;
  grid-template-columns: minmax(150px, 230px) 1fr auto;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
}

.tb-etape-nom {
  color: var(--creme);
}

.tb-etape-piste {
  height: 18px;
}

.tb-etape-barre {
  display: block;
  height: 100%;
  border-radius: 0 4px 4px 0;
  background: #E8566A;
}

.tb-etape-valeur {
  min-width: 5.5em;
  text-align: right;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--creme);
}

.tb-etape-part {
  font-weight: 400;
  color: var(--poudre);
}

@media (max-width: 560px) {
  .tb-etape {
    grid-template-columns: 1fr auto;
  }

  .tb-etape-piste {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

/* Détail par jour */
.tb-detail summary {
  cursor: pointer;
  color: var(--poudre);
  font-weight: 600;
}

.tb-table-cadre {
  margin-top: 12px;
  overflow-x: auto;
}

.tb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.tb-table th,
.tb-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--trait);
  text-align: right;
  white-space: nowrap;
}

.tb-table thead th {
  color: var(--poudre);
  font-weight: 600;
}

.tb-table th:first-child {
  text-align: left;
}

@media (prefers-reduced-motion: reduce) {
  .hero-photo img,
  .vocal-point {
    animation: none;
  }

  .bulle-photo img {
    transition: none;
  }
}

/* ---------- Pages de texte : mentions légales, conditions, confidentialité, signalement ---------- */

.texte-legal {
  max-width: 46rem;
  padding-top: 32px;
  padding-bottom: 96px;
  margin-left: max(0px, calc((100vw - var(--largeur)) / 2));
  font-size: 17px;
  line-height: 1.68;
}

.texte-legal h1 {
  font-size: clamp(2.5rem, 7vw, 3.8rem);
  line-height: 1;
  margin-bottom: 14px;
}

.texte-legal .maj {
  color: var(--poudre);
  font-size: 0.95rem;
  margin-bottom: 36px;
}

.texte-legal .chapo {
  font-size: 1.15rem;
  line-height: 1.6;
  margin-bottom: 8px;
}

.texte-legal h2 {
  font-size: 1.75rem;
  line-height: 1.15;
  margin: 56px 0 14px;
  scroll-margin-top: 24px;
}

.texte-legal h3 {
  font-family: var(--texte);
  font-style: normal;
  font-size: 1.02rem;
  font-weight: 650;
  margin: 26px 0 6px;
}

.texte-legal ul {
  margin: 0 0 1em;
  padding-left: 1.2em;
}

.texte-legal li {
  margin-bottom: 0.5em;
}

.texte-legal li::marker {
  color: var(--braise-clair);
}

.texte-legal address {
  margin: 0 0 1em;
  font-style: normal;
}

/* Une catégorie de données : quoi, pourquoi, base, durée */
.donnee {
  margin: 0 0 14px;
  padding: 18px 20px 6px;
  border-left: 2px solid var(--braise);
  background: var(--velours);
  border-radius: 0 14px 14px 0;
}

.donnee h3 {
  margin: 0 0 10px;
}

.donnee dl {
  margin: 0;
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0 16px;
}

.donnee dt {
  color: var(--poudre);
  font-size: 0.9rem;
  padding-top: 2px;
}

.donnee dd {
  margin: 0 0 12px;
}

.urgence {
  margin: 32px 0 8px;
  padding: 18px 22px 8px;
  border: 1px solid var(--braise);
  border-radius: 14px;
}

.urgence h2 {
  margin: 0 0 10px;
  font-size: 1.4rem;
}

/* Formulaire de signalement (page publique et feuille de l'app) */
.form-signaler {
  display: grid;
  gap: 18px;
  justify-items: stretch;
  margin: 8px 0 24px;
}

.form-signaler .btn {
  justify-self: start;
}

.choix {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.choix legend {
  margin-bottom: 12px;
  padding: 0;
  color: var(--creme);
  font-weight: 650;
}

.champ textarea {
  width: 100%;
  min-height: 8em;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--trait);
  background: rgba(23, 16, 26, 0.85);
  color: var(--creme);
  font-family: var(--texte);
  font-size: 1.05rem;
  line-height: 1.5;
  resize: vertical;
}

.champ textarea:focus {
  outline: none;
  border-color: var(--braise-clair);
  box-shadow: 0 0 0 3px rgba(232, 86, 106, 0.25);
}

.case a {
  color: var(--creme);
}

.feuille-intro {
  margin: -12px 0 0;
  color: var(--poudre);
  font-size: 0.95rem;
}

/* Liens légaux : pied de la landing, accueil de l'app, réglages */
.pied-liens {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  flex-basis: 100%;
  order: 3;
}

.pied-liens a,
.app-liens a {
  color: var(--poudre);
  text-underline-offset: 3px;
}

.pied-liens a:hover,
.app-liens a:hover {
  color: var(--creme);
}

.app-liens {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 40px;
  font-size: 0.85rem;
}

.app-liens-feuille {
  margin-top: 0;
}

@media (max-width: 560px) {
  .texte-legal {
    font-size: 16px;
  }

  .donnee dl {
    grid-template-columns: 1fr;
  }

  .donnee dt {
    padding-top: 0;
  }

  .donnee dd {
    margin-bottom: 10px;
  }
}

/* ---------- Signalements (/tableau/signalements/) ---------- */

.champ select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--trait);
  background: rgba(23, 16, 26, 0.85);
  color: var(--creme);
  font-family: var(--texte);
  font-size: 1rem;
}

.mod-liste {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mod-carte {
  display: grid;
  gap: 10px;
}

.mod-tete {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.mod-numero {
  font-family: var(--texte);
  font-style: normal;
  font-size: 1.15rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.mod-statut {
  padding: 3px 10px;
  border: 1px solid var(--trait);
  border-radius: 999px;
  color: var(--poudre);
  font-size: 0.85rem;
  white-space: nowrap;
}

.mod-statut-nouveau {
  border-color: var(--braise-clair);
  color: var(--creme);
}

.mod-motif {
  margin: 0;
  font-weight: 650;
}

.mod-description {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.mod-details {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 4px 14px;
  margin: 0;
  font-size: 0.92rem;
}

.mod-details dt {
  color: var(--poudre);
}

.mod-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.mod-decision {
  margin: 0;
  padding-left: 12px;
  border-left: 2px solid var(--trait);
  color: var(--poudre);
  font-size: 0.9rem;
}

.mod-form {
  display: grid;
  gap: 12px;
  justify-items: stretch;
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--trait);
}

.mod-form .btn {
  justify-self: start;
}

.tb-signalements {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.tb-signalements.a-traiter {
  border-color: var(--braise-clair);
}

@media (max-width: 560px) {
  .mod-details {
    grid-template-columns: 1fr;
  }

  .mod-details dd {
    margin-bottom: 6px;
  }
}
