/* ===== Fonts ===== */
@font-face {
  font-family: "Poppins";
  src: url("fonts/poppins-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("fonts/poppins-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("fonts/poppins-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

/* ===== Tokens ===== */
:root {
  --cream: #FAF6EF;
  --paper: #F3EADB;
  --red: #E01E1E;
  --red-deep: #B31414;
  --espresso: #4A2E1E;
  --caramel: #C8895A;
  --star: #F5B301;
  --ink: #2B2018;
  --ink-soft: #6B5D52;
}

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

[hidden] { display: none !important; }

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

body {
  font-family: "Poppins", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: linear-gradient(165deg, var(--cream) 0%, var(--paper) 100%);
  min-height: 100dvh;
}

/* ===== Layout accueil ===== */
.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero {
  width: 100%;
  line-height: 0;
  position: relative;
}
.hero img {
  width: 100%;
  height: clamp(140px, 23vh, 260px);
  object-fit: cover;
  object-position: center 38%;
  display: block;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 46px;
  background: linear-gradient(to bottom, rgba(250, 246, 239, 0), var(--cream));
}

.card {
  width: 100%;
  max-width: 440px;
  padding: 4px 22px 16px;
  text-align: center;
  flex: 1;
}

.logo {
  width: min(240px, 62%);
  height: auto;
  display: block;
  margin: 4px auto 12px;
}

h1 {
  font-weight: 700;
  font-size: clamp(21px, 5.6vw, 26px);
  line-height: 1.22;
  margin-bottom: 8px;
}

.offer {
  font-size: 15px;
  color: var(--ink-soft);
  margin-bottom: 16px;
}

/* ===== Étapes ===== */
.steps {
  list-style: none;
  text-align: left;
  display: grid;
  gap: 9px;
  margin-bottom: 18px;
}
.steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(74, 46, 30, 0.08);
  border-radius: 16px;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 14px;
}
.step-num {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--red);
  color: var(--cream);
  font-weight: 700;
  font-size: 14px;
  display: grid;
  place-items: center;
}

/* ===== Bouton principal ===== */
.cta {
  width: 100%;
  min-height: 56px;
  border: none;
  border-radius: 20px;
  background: var(--red);
  color: #fff;
  text-decoration: none;
  font-family: inherit;
  font-weight: 600;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(224, 30, 30, 0.32);
  animation: breathe 2.6s ease-in-out infinite;
  transition: background 0.2s;
}
.cta:active { background: var(--red-deep); transform: scale(0.98); }
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.02); }
}

.note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-soft);
}

footer {
  padding: 10px;
  font-size: 11px;
  color: var(--ink-soft);
  opacity: 0.7;
}

/* ===== Toggle langue ===== */
.lang-toggle {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: 14px;
  display: flex;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(74, 46, 30, 0.12);
  border-radius: 999px;
  padding: 3px;
  z-index: 10;
}
.lang-toggle button {
  border: none;
  background: transparent;
  font-family: inherit;
  font-weight: 600;
  font-size: 12px;
  color: var(--ink-soft);
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
}
.lang-toggle button[aria-pressed="true"] {
  background: var(--red);
  color: #fff;
}

/* ===== Écran merci ===== */
.thanks {
  justify-content: center;
  text-align: center;
  padding: 24px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.thanks.visible { opacity: 1; transform: none; }

.thanks-inner { max-width: 420px; }

.thanks-emoji {
  font-size: 72px;
  line-height: 1;
  margin-bottom: 18px;
  animation: pop 0.6s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
@keyframes pop {
  from { transform: scale(0.2); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.thanks h2 {
  font-weight: 700;
  font-size: clamp(26px, 7vw, 34px);
  margin-bottom: 14px;
}
.thanks p {
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.reward {
  margin: 28px auto 0;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  font-size: 44px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(74, 46, 30, 0.1);
  border-radius: 24px;
  padding: 14px 26px;
}
.reward-or {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-soft);
}

.thanks-brand {
  margin-top: 26px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 700;
}

/* ===== Vue ?qr (récupération du QR code) ===== */
.qr-view {
  justify-content: center;
  align-items: center;
  background: #fff;
  padding: 24px;
  text-align: center;
}
.qr-img {
  width: min(80vw, 440px);
  height: auto;
}
.qr-caption {
  margin-top: 12px;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}

/* ===== Desktop : même carte, centrée ===== */
@media (min-width: 600px) {
  body { display: grid; place-items: center; }
  #home {
    min-height: auto;
    margin: 40px 0;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(74, 46, 30, 0.08);
    border-radius: 28px;
    box-shadow: 0 24px 60px rgba(74, 46, 30, 0.16);
    overflow: hidden;
    position: relative;
  }
}
@media (max-width: 599.98px) {
  #home { position: relative; }
}

/* ===== Accessibilité ===== */
@media (prefers-reduced-motion: reduce) {
  .cta, .thanks-emoji { animation: none; }
  .thanks { transition: none; }
}
