/* ==========================================================================
   Carte de visite — Stan Santini, AKTYRAD Conseil
   Direction artistique « Émeraude & Cacao », reprise d'aktyrad.fr
   (tailwind.config.js + src/styles/global.css).

   PENSÉE POUR LE TÉLÉPHONE, ET RIEN D'AUTRE. Cette page se partage par
   message : elle s'ouvre sur un écran de 5 pouces, souvent dans le
   navigateur d'Instagram ou de WhatsApp. Tout est dessiné à 375 px d'abord ;
   au-delà de 480 px la carte se contente d'être centrée sur le sable.
   ========================================================================== */

:root {
  /* Fonds et surfaces */
  --sand: #f2efe9;
  --cream: #fcfaf7;
  --linen: #e9e4dc;
  --border: #d9d2c7;

  /* Encres — valeurs du site après la passe de contraste du 15/09/2026 */
  --espresso: #221e1b;
  --bark: #453b35;
  --clay: #5e5750;
  --taupe: #6d655c;

  /* Accents */
  --olive: #0e6a47;
  --olive-deep: #0a4a31;
  --pistache: #83cda8;
  --pistache-soft: #d3ebdf;

  /* L'iris (global.css) : la profondeur du vert, pour la variante émeraude */
  --iris-foyer: #16855e;
  --iris-corps: #0e6a47;
  --iris-fond: #0a4a31;
  --iris-anneau: #06301f;

  --rayon: 1rem;
  --gouttiere: 1.25rem;
}

/* --------------------------------------------------------------- les fontes
   Hébergées ici, jamais chez Google : aucun appel tiers, aucun cookie.
   `swap` : le texte s'affiche tout de suite dans la fonte système, puis
   bascule — sur un réseau mobile, attendre la fonte c'est attendre la page. */
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

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

html {
  -webkit-text-size-adjust: 100%; /* iPhone en paysage : pas d'agrandissement */
  background: var(--sand);
}

body {
  margin: 0;
  background: var(--sand);
  color: var(--espresso);
  font-family: "Instrument Sans", system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  letter-spacing: 0.002em;
  min-height: 100svh; /* svh, pas vh : la barre d'adresse ne fait plus sauter la page */
}

h1,
h2,
h3 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.08;
  margin: 0;
  font-variant-numeric: lining-nums;
}

p {
  margin: 0;
}

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

/* Pas de flash gris au toucher, pas de délai d'activation : le retour visuel
   vient des états `:active`. */
a,
button,
summary,
label,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

:focus-visible {
  outline: 2px solid var(--olive);
  outline-offset: 3px;
  border-radius: 4px;
}

.horsecran {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------- la carte
   Une colonne unique, calée sur la largeur du pouce. Au-delà de 480 px on ne
   l'étire pas : une carte de visite reste une carte de visite. */
.carte {
  max-width: 480px;
  margin: 0 auto;
  background: var(--sand);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

@media (min-width: 560px) {
  body {
    background: var(--linen);
    padding: 2.5rem 1rem;
  }
  .carte {
    min-height: 0;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow:
      0 2px 4px rgba(34, 30, 27, 0.05),
      0 24px 60px rgba(34, 30, 27, 0.16);
  }
}

/* ----------------------------------------------------------------- l'en-tête
   Le fond est un calque à part, découpé en biais : l'avatar doit pouvoir
   déborder sous la coupe, et un `clip-path` sur l'en-tête l'aurait rogné. */
.entete {
  position: relative;
  padding: calc(1.25rem + env(safe-area-inset-top)) var(--gouttiere) 4.5rem;
  color: var(--sand);
  isolation: isolate;
}

.entete__fond {
  position: absolute;
  inset: 0;
  z-index: -1;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 2.75rem), 0 100%);
  /* Bande sombre cacao du site : dégradé #1e1b19 → #332c28.
     Contrastes sur l'extrémité LA PLUS CLAIRE (#332c28), la moins favorable :
     sable 11,95 · pistache 7,35. */
  background: linear-gradient(168deg, #1e1b19 0%, #221e1b 46%, #332c28 100%);
}

/* Variante émeraude : le traitement `.iris` de global.css.
   Le foyer lumineux est ramené EN HAUT À DROITE, derrière le bouton QR :
   au centre, le sable n'y tiendrait que 4,02 sur #16855e, sous le seuil.
   Sous le nom, le fond descend à #0a4a31 et #06301f — sable 8,98 puis 12,62. */
.entete[data-variante="emeraude"] .entete__fond {
  background-color: var(--iris-fond);
  background-image:
    repeating-conic-gradient(
      from 0deg at 78% 14%,
      rgba(255, 255, 255, 0.028) 0deg 0.35deg,
      transparent 0.35deg 1.3deg
    ),
    repeating-conic-gradient(
      from 37deg at 78% 14%,
      rgba(0, 0, 0, 0.045) 0deg 0.5deg,
      transparent 0.5deg 2.1deg
    ),
    radial-gradient(
      circle at 78% 14%,
      var(--iris-foyer) 0%,
      var(--iris-corps) 16%,
      var(--iris-fond) 44%,
      var(--iris-anneau) 84%
    );
}

.entete__haut {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.entete__logo {
  height: 2.25rem;
  width: auto;
}

/* 48 px de côté : la cible tactile recommandée, même si l'icône fait 22 px. */
.bouton-qr {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(242, 239, 233, 0.28);
  background: rgba(242, 239, 233, 0.08);
  color: var(--pistache);
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.bouton-qr:active {
  transform: scale(0.96);
}

.entete__identite {
  margin-top: 2.25rem;
  max-width: 15em;
}

.entete__nom {
  font-size: 2.25rem;
  line-height: 1.02;
  color: var(--sand);
}
.entete__nom span {
  display: block;
}
.entete__nom .nom-famille {
  color: var(--pistache);
}

.entete__poste {
  margin-top: 0.75rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--sand);
}

.entete__societe {
  margin-top: 0.125rem;
  font-size: 0.875rem;
  color: rgba(242, 239, 233, 0.72); /* 6,67 sur le cacao le plus clair */
}

/* L'avatar chevauche la coupe : moitié dans le sombre, moitié dans le sable. */
.avatar {
  position: absolute;
  right: var(--gouttiere);
  bottom: -2.25rem;
  width: 6.5rem;
  height: 6.5rem;
  border-radius: 50%;
  background: var(--pistache-soft);
  border: 4px solid var(--sand);
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(34, 30, 27, 0.18);
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.avatar__initiales {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--olive-deep); /* 8,21 sur pistache-soft */
  letter-spacing: 0.02em;
}

/* --------------------------------------------------------------- le contenu */
.contenu {
  padding: 0 var(--gouttiere) calc(1.5rem + env(safe-area-inset-bottom));
  flex: 1;
}

/* Deux boutons côte à côte. Ils gardent leur ligne même à 320 px : le libellé
   rétrécit avant que la colonne ne casse. */
.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
  margin-top: 3.25rem;
}

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.75rem 0.875rem;
  border-radius: 0.875rem;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}
.bouton:active {
  transform: scale(0.98);
}
.bouton svg {
  flex-shrink: 0;
}

.bouton--plein {
  background: var(--olive-deep);
  color: #f8f6f2;
  border-color: var(--olive-deep);
}
.bouton--contour {
  background: var(--cream);
  color: var(--espresso);
  border-color: var(--border);
}

/* ------------------------------------------------------------- les liens */
.liens {
  list-style: none;
  margin: 1.75rem 0 0;
  padding: 0;
  border-top: 1px solid var(--border);
}
.liens li {
  border-bottom: 1px solid var(--border);
}
.liens a,
.liens .ligne-texte {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  min-height: 3.25rem;
  padding: 0.6875rem 0.25rem;
  color: var(--olive-deep); /* 9,90 sur le sable */
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  word-break: break-word;
}
.liens .ligne-texte {
  color: var(--espresso);
  font-weight: 400;
}
.liens .icone {
  flex-shrink: 0;
  color: var(--taupe); /* icône grise, 5,50 sur le sable */
}
.liens a:active {
  background: var(--linen);
}

/* -------------------------------------------------- le grand bouton Wallet */
.bouton-wallet {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  min-height: 3.5rem;
  margin-top: 1.75rem;
  padding: 1rem 1.25rem;
  border: 0;
  border-radius: 999px;
  background: var(--pistache-soft);
  color: var(--olive-deep); /* 8,21 — le duo indiqué par la DA */
  font-family: inherit;
  font-size: 1.0625rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.bouton-wallet:active {
  transform: scale(0.99);
}

.pied {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--taupe);
}
.pied a {
  color: var(--taupe);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ================================================================ fenêtres
   `<dialog>` natif : le piège à focus et la touche Échap sont donnés par le
   navigateur, sans une ligne de JavaScript à maintenir.

   Sur téléphone, la fenêtre monte du bas comme une feuille : c'est le geste
   attendu, et le contenu reste sous le pouce. Pas de `backdrop-blur` : un
   voile sombre plein, moins coûteux et plus net. */
dialog {
  padding: 0;
  border: 0;
  background: transparent;
  margin: 0;
  position: fixed;
  inset: 0;
  /* `width` ET `height` explicites : la feuille de style du navigateur impose
     `fit-content` aux deux, et la hauteur tombait à zéro puisque la feuille
     est en position absolue — la fenêtre se dessinait au-dessus de l'écran. */
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  overflow: visible;
}
dialog::backdrop {
  background: rgba(24, 21, 19, 0.72);
}

.feuille {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 92svh;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  border-radius: 1.5rem 1.5rem 0 0;
  box-shadow: 0 -12px 40px rgba(24, 21, 19, 0.28);
  animation: monte 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes monte {
  from {
    transform: translateY(6%);
    opacity: 0.6;
  }
}
@media (prefers-reduced-motion: reduce) {
  .feuille {
    animation: none;
  }
}

@media (min-width: 560px) {
  /* `dialog[open]`, et surtout pas `dialog` : un dialogue fermé est en
     `display: none` par la feuille de style du navigateur, et un `display`
     posé sans condition l'écrase — les deux fenêtres s'affichaient d'emblée
     au-dessus de la carte, dès 560 px de large. */
  dialog[open] {
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
  }
  .feuille {
    position: static;
    width: 100%;
    max-width: 30rem;
    border-radius: 1.5rem;
    max-height: 88svh;
    animation: none;
  }
}

.feuille__haut {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem var(--gouttiere) 0.75rem;
}
.feuille__titre {
  font-size: 1.375rem;
  line-height: 1.15;
}
.feuille__corps {
  padding: 0 var(--gouttiere) calc(1.5rem + env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.croix {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  margin: -0.5rem -0.5rem 0 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: var(--linen);
  color: var(--espresso);
  cursor: pointer;
}
.croix:active {
  transform: scale(0.94);
}

/* ---------------------------------------------------------- le formulaire */
.champ {
  margin-top: 1rem;
}
.champ label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--bark);
  margin-bottom: 0.375rem;
}
.champ .requis {
  color: var(--olive);
}
.champ input,
.champ textarea {
  width: 100%;
  /* 16 px MINIMUM : en dessous, iOS agrandit la page à la mise au point du
     champ et ne la réduit jamais. C'est le défaut le plus visible d'un
     formulaire mobile mal réglé. */
  font-size: 1rem;
  font-family: inherit;
  color: var(--espresso);
  background: var(--sand);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.8125rem 0.875rem;
  min-height: 3rem;
}
.champ textarea {
  min-height: 5.5rem;
  resize: vertical;
}

/* La case d'acquittement. Elle casse le gabarit des autres champs : l'intitulé
   passe à DROITE, et la case ne prend pas toute la largeur — d'où une règle à
   part plutôt qu'une exception glissée dans `.champ input`.
   La cible tactile fait 44 px de haut malgré une case de 22 : c'est le bloc
   entier qui se touche, pas le carré. */
.champ--case {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 1.25rem;
  min-height: 2.75rem;
}
.champ--case input[type="checkbox"] {
  width: 1.375rem;
  height: 1.375rem;
  min-height: 0;
  flex: 0 0 auto;
  margin: 0.0625rem 0 0;
  padding: 0;
  border-radius: 0.375rem;
  accent-color: var(--olive);
}
.champ--case label {
  margin: 0;
  font-weight: 400;
  color: var(--clay);
  line-height: 1.5;
  /* Le libellé fait partie de la cible : on le touche pour cocher. */
  cursor: pointer;
}
.champ input:focus,
.champ textarea:focus {
  outline: 2px solid var(--olive);
  outline-offset: 1px;
  border-color: transparent;
}
.champ input::placeholder,
.champ textarea::placeholder {
  color: var(--taupe);
}

/* Le piège à robots : invisible à l'œil, hors du parcours clavier, et jamais
   `display:none` — certains robots ignorent les champs masqués ainsi. */
.piege {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.envoyer {
  width: 100%;
  min-height: 3.25rem;
  margin-top: 1.5rem;
  border: 0;
  border-radius: 0.875rem;
  background: var(--olive-deep);
  color: #f8f6f2;
  font-family: inherit;
  font-size: 1.0625rem;
  font-weight: 600;
  cursor: pointer;
}
.envoyer:active {
  transform: scale(0.99);
}
.envoyer[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.erreur {
  margin-top: 1rem;
  padding: 0.75rem 0.875rem;
  border-radius: 0.75rem;
  background: #fdeceb;
  border: 1px solid #f0c8c4;
  color: #7a231c; /* 8,3 sur #fdeceb */
  font-size: 0.875rem;
}

.mentions {
  margin-top: 1.25rem;
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--taupe);
}
.mentions a {
  color: var(--olive-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ------------------------------------------------------------- écran merci */
.merci {
  text-align: center;
  padding-top: 0.5rem;
}
.merci__coche {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1rem;
  border-radius: 999px;
  background: var(--pistache-soft);
  color: var(--olive-deep);
  display: grid;
  place-items: center;
}
.merci p {
  color: var(--clay);
  margin-top: 0.5rem;
}
.merci__action {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
}

/* Emplacement des badges officiels Apple / Google. Ils ne se redessinent
   jamais : tant que les fichiers ne sont pas là, on montre un repère. */
.badge img {
  height: 3rem;
  width: auto;
}
.badge--attente {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  border: 1px dashed var(--border);
  border-radius: 0.75rem;
  color: var(--taupe);
  font-size: 0.8125rem;
  text-align: center;
}

.qr-cadre {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem;
  width: 15rem;
  max-width: 100%;
  margin: 0 auto;
}
.qr-cadre img,
.qr-cadre svg {
  width: 100%;
  height: auto;
}

/* --------------------------------------------------- survols : écrans seuls
   Sur un écran tactile, `:hover` reste collé après le toucher : le bouton
   resterait allumé une fois le doigt parti. */
@media (hover: hover) {
  .bouton--plein:hover {
    background: #083c28;
  }
  .bouton--contour:hover {
    border-color: var(--clay);
  }
  .bouton-wallet:hover {
    background: #c3e4d3;
  }
  .liens a:hover {
    background: var(--linen);
  }
  .bouton-qr:hover {
    background: rgba(242, 239, 233, 0.16);
  }
  .croix:hover {
    background: var(--border);
  }
}

/* Deux utilitaires, et pas un style en ligne. La CSP de production interdit
   `style-src 'unsafe-inline'` : un attribut `style=""` posé par le script
   serait purement ignoré, et les boutons de l'écran de fin ne feraient pas
   toute la largeur. */
.pleine-largeur {
  width: 100%;
}
.centre {
  text-align: center;
}
.badge--attente.plein {
  border-style: solid;
}

/* =========================================================== pages de texte
   Mentions légales et confidentialité. Même colonne étroite que la carte :
   on les ouvre depuis un téléphone, jamais autrement. */
.page-texte {
  padding: calc(1.5rem + env(safe-area-inset-top)) var(--gouttiere)
    calc(2.5rem + env(safe-area-inset-bottom));
  background: var(--sand);
}
.page-texte .retour {
  display: inline-block;
  min-height: 2.75rem;
  line-height: 2.75rem;
  color: var(--clay);
  font-size: 0.9375rem;
  text-decoration: none;
}
.page-texte h1 {
  font-size: 1.875rem;
  margin: 0.5rem 0 0;
}
.page-texte h2 {
  font-size: 1.1875rem;
  margin: 2rem 0 0.5rem;
}
.page-texte p,
.page-texte li {
  color: var(--clay);
  font-size: 0.9375rem;
  line-height: 1.65;
}
.page-texte .chapo {
  margin-top: 1rem;
  color: var(--bark);
}
.page-texte ul {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
}
.page-texte li {
  margin-top: 0.5rem;
}
.page-texte dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.page-texte dt {
  font-size: 0.8125rem;
  color: var(--taupe);
  margin-top: 0.875rem;
}
.page-texte dd {
  margin: 0.125rem 0 0;
  color: var(--espresso);
  font-size: 0.9375rem;
}
.page-texte a {
  color: var(--olive-deep);
  text-underline-offset: 3px;
}
/* Une mention absente se voit : elle ne se remplace jamais par une valeur
   vraisemblable (CLAUDE.md § 1). */
.a-completer {
  font-style: normal;
  color: #8a5a1f;
  background: #fbf0dd;
  border-radius: 0.375rem;
  padding: 0.05rem 0.4rem;
  font-size: 0.875rem;
}
.pied-texte {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
}
