/* ===== Couleurs : changez-les ici pour adapter la palette ===== */
:root {
  --nuit: #050b18;
  --nuit-2: #0b1a3a;
  --bleu: #3b82f6;
  --bleu-clair: #93c5fd;
  --or: #fbbf24;
  --texte: #f3f7ff;
  --texte-2: #c3d0e6;
  --texte-3: #93a6c4;
  --verre: rgba(255, 255, 255, 0.07);
  --verre-fort: rgba(255, 255, 255, 0.12);
  --bord: rgba(255, 255, 255, 0.16);
}

@font-face {
  font-family: "Bricolage";
  src: url("/fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

* {
  box-sizing: border-box;
  margin: 0;
}

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

body {
  min-height: 100svh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--texte);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

/* ===== Décor ===== */
.ciel {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(180deg, var(--nuit) 0%, var(--nuit-2) 60%, #0e2552 100%);
}

.aurore {
  position: absolute;
  width: 80vmax;
  height: 80vmax;
  border-radius: 50%;
  will-change: transform;
  animation: derive 22s ease-in-out infinite alternate;
}

.aurore-1 {
  top: -42vmax;
  left: -30vmax;
  background: radial-gradient(closest-side, rgba(59, 130, 246, 0.55), transparent);
}

.aurore-2 {
  top: -8vmax;
  right: -46vmax;
  background: radial-gradient(closest-side, rgba(34, 211, 238, 0.28), transparent);
  animation-duration: 28s;
  animation-direction: alternate-reverse;
}

.aurore-3 {
  bottom: -40vmax;
  left: -10vmax;
  background: radial-gradient(closest-side, rgba(129, 140, 248, 0.38), transparent);
  animation-duration: 34s;
}

@keyframes derive {
  to {
    transform: translate3d(9vmax, 7vmax, 0) scale(1.12);
  }
}

.etoiles-fond {
  position: absolute;
  inset: 0 0 25% 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320'%3E%3Cg fill='%23fff'%3E%3Ccircle cx='12' cy='18' r='.9'/%3E%3Ccircle cx='64' cy='42' r='.6'/%3E%3Ccircle cx='118' cy='12' r='1.1'/%3E%3Ccircle cx='170' cy='60' r='.7'/%3E%3Ccircle cx='226' cy='24' r='.9'/%3E%3Ccircle cx='290' cy='52' r='.6'/%3E%3Ccircle cx='30' cy='96' r='.7'/%3E%3Ccircle cx='92' cy='120' r='1'/%3E%3Ccircle cx='150' cy='104' r='.5'/%3E%3Ccircle cx='204' cy='138' r='.8'/%3E%3Ccircle cx='262' cy='110' r='1.1'/%3E%3Ccircle cx='310' cy='150' r='.6'/%3E%3Ccircle cx='44' cy='176' r='.6'/%3E%3Ccircle cx='108' cy='196' r='.9'/%3E%3Ccircle cx='176' cy='184' r='.6'/%3E%3Ccircle cx='238' cy='206' r='.7'/%3E%3Ccircle cx='296' cy='226' r='.9'/%3E%3Ccircle cx='16' cy='250' r='1'/%3E%3Ccircle cx='76' cy='270' r='.5'/%3E%3Ccircle cx='136' cy='252' r='.8'/%3E%3Ccircle cx='190' cy='290' r='1'/%3E%3Ccircle cx='252' cy='268' r='.6'/%3E%3Ccircle cx='304' cy='300' r='.7'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 320px 320px;
  opacity: 0.55;
  mask-image: linear-gradient(180deg, #000 30%, transparent);
}

.etoiles-fond.scintille {
  background-size: 470px 470px;
  background-position: 80px 40px;
  animation: scintille 5s ease-in-out infinite alternate;
}

@keyframes scintille {
  from {
    opacity: 0.15;
  }
  to {
    opacity: 0.7;
  }
}

.montagnes {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 34vh;
  min-height: 190px;
}

/* ===== Fond photo ou vidéo (réglé dans config.js) ===== */
.avec-fond .ciel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--fond) center / cover no-repeat;
}

.fond-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.4s ease;
}

.fond-video.lance {
  opacity: 1;
}

/* Voile bleu nuit par-dessus la photo : garantit la lisibilité */
.avec-fond .ciel::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 11, 24, 0.62) 0%, rgba(5, 11, 24, 0.3) 32%, rgba(5, 11, 24, 0.55) 62%, rgba(5, 11, 24, 0.9) 100%),
    linear-gradient(180deg, rgba(29, 78, 216, 0.22), rgba(29, 78, 216, 0.08));
}

.avec-fond .aurore {
  opacity: 0.45;
}

.avec-fond .etoiles-fond,
.avec-fond .montagnes {
  display: none;
}

/* ===== Verre dépoli ===== */
.verre {
  background: linear-gradient(145deg, var(--verre-fort), var(--verre));
  border: 1px solid var(--bord);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 24px 48px -24px rgba(2, 6, 23, 0.8);
}

/* ===== Mise en page ===== */
.page {
  width: min(100%, 460px);
  min-height: 100svh;
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 18px max(26px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.entete {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 10px;
}

.logo {
  width: 92px;
  height: 78px;
  border-radius: 26px;
  display: grid;
  place-items: center;
}

.logo img {
  width: 62px;
  height: auto;
}

.nom {
  margin-top: 16px;
  font-family: "Bricolage", system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.activite {
  margin-top: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--texte-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.merci {
  position: relative;
  border-radius: 28px;
  padding: 26px 22px 24px;
  text-align: center;
  overflow: hidden;
}

/* Reflet sur la vitre */
.merci::before {
  content: "";
  position: absolute;
  inset: -60% 30% 40% -40%;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.16), transparent 60%);
  transform: rotate(10deg);
  pointer-events: none;
}

.etoiles {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.etoiles svg {
  width: 26px;
  height: 26px;
  fill: var(--or);
  filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.55));
}

.merci h1 {
  margin-top: 16px;
  font-family: "Bricolage", system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 9vw, 2.5rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, #fff 30%, #bfd6ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-wrap: balance;
}

.merci p {
  margin: 12px auto 0;
  max-width: 30ch;
  color: var(--texte-2);
  font-size: 1.02rem;
  line-height: 1.5;
  text-wrap: pretty;
}

/* ===== Boutons ===== */
.actions {
  display: grid;
  gap: 12px;
}

.bouton {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 14px 16px 14px 14px;
  border-radius: 24px;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.2s ease;
}

.bouton:active {
  transform: scale(0.98);
}

.bouton .libelle {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.bouton strong {
  font-family: "Bricolage", system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -0.01em;
}

.bouton small {
  font-size: 0.85rem;
  color: var(--texte-2);
}

.pastille {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: var(--bleu-clair);
  background: rgba(147, 197, 253, 0.12);
  border: 1px solid rgba(147, 197, 253, 0.22);
}

.pastille svg {
  width: 24px;
  height: 24px;
}

.fleche {
  width: 22px;
  height: 22px;
  margin-left: auto;
  flex-shrink: 0;
  color: var(--texte-3);
}

/* Bouton principal : verre clair et liseré lumineux animé */
.bouton-avis {
  position: relative;
  min-height: 92px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.07));
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 18px 50px -14px rgba(251, 191, 36, 0.45),
    0 10px 40px -20px rgba(59, 130, 246, 0.9);
}

/* Le liseré : un dégradé qui tourne, découpé pour ne garder que le contour */
.bouton-avis::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1.5px;
  border-radius: inherit;
  background: conic-gradient(from var(--angle), #fbbf24, #60a5fa, #a78bfa, #22d3ee, #fbbf24);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  animation: tourne 6s linear infinite;
}

.bouton-avis strong {
  font-size: clamp(1.05rem, 4.7vw, 1.22rem);
}

.bouton-avis small {
  color: #e7eefc;
}

.bouton-avis .fleche {
  color: var(--or);
}

@keyframes tourne {
  to {
    --angle: 360deg;
  }
}

.pastille-or {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  color: #3b2a00;
  background: linear-gradient(145deg, #fde68a, var(--or));
  border: 0;
  box-shadow: 0 8px 24px -8px rgba(251, 191, 36, 0.8);
}

.pastille-or svg {
  fill: currentColor;
  width: 26px;
  height: 26px;
}

.verre.bouton:hover,
.bouton-avis:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

:focus-visible {
  outline: 3px solid var(--or);
  outline-offset: 3px;
  border-radius: 12px;
}

.bouton:focus-visible {
  border-radius: 24px;
}

/* ===== Pied de page ===== */
.pied {
  margin-top: auto;
  padding: 18px 8px 4px;
  text-align: center;
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--texte-3);
}

.pied-nom {
  color: var(--texte-2);
  font-weight: 600;
}

.pied a {
  text-decoration: none;
  border-bottom: 1px solid rgba(147, 166, 196, 0.4);
}

.sans-js {
  position: fixed;
  inset: auto 16px 16px;
  padding: 12px;
  border-radius: 12px;
  background: #fff;
  color: #000;
}

/* ===== Animations d'arrivée ===== */
.apparait {
  animation: monte 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.merci.apparait {
  animation-delay: 0.08s;
}

.actions .apparait:nth-child(1) {
  animation-delay: 0.16s;
}

.actions .apparait:nth-child(2) {
  animation-delay: 0.22s;
}

.actions .apparait:nth-child(3) {
  animation-delay: 0.28s;
}

.pied.apparait {
  animation-delay: 0.34s;
}

@keyframes monte {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html:not(.forcer-mouvement) *,
  html:not(.forcer-mouvement) *::before,
  html:not(.forcer-mouvement) *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Grands écrans : un peu plus d'air */
@media (min-height: 820px) {
  .page {
    gap: 22px;
    padding-top: 48px;
  }
}
