/* ==========================================================================
   QuizConcours — site vitrine
   Direction A : "App-first cohérent" — palette identique à l'app Flutter
   ========================================================================== */

/* ----- 1. Variables (palette extraite de lib/utils/app_colors.dart) ----- */
:root {
  /* Couleurs de marque */
  --primary:       #10B981;   /* émeraude vif (couleur principale de l'app) */
  --primary-dark:  #047857;   /* émeraude profond */
  --primary-light: #34D399;   /* émeraude clair */
  --accent:        #FB7185;   /* corail (CTA secondaires) */
  --sun:           #F59E0B;   /* ambre (badges, étoiles) */

  /* Surfaces */
  --bg:            #F6FBF9;   /* fond clair général */
  --surface:       #FFFFFF;   /* cards */
  --surface-alt:   #EAF6F2;   /* alternance subtile */
  --text:          #0F2A24;   /* texte principal */
  --text-secondary:#5B6B66;   /* texte secondaire */
  --divider:       #D8EAE4;   /* lignes / bordures */

  /* Effets */
  --shadow-sm: 0 2px 8px rgba(15, 42, 36, 0.06);
  --shadow-md: 0 4px 24px rgba(16, 185, 129, 0.12);
  --shadow-lg: 0 12px 48px rgba(15, 42, 36, 0.15);

  --gradient-hero: linear-gradient(160deg, #0F2A24 0%, #047857 45%, #10B981 100%);
  --gradient-cta: linear-gradient(135deg, #10B981 0%, #047857 100%);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --container: 1100px;
}

/* ----- 2. Reset minimal + base ----- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

h1, h2, h3, h4 {
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 0.5em;
  color: var(--text);
}

h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); margin-bottom: 0.6em; }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); }

p { margin: 0 0 1em; }

a {
  color: var(--primary-dark);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--primary); }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ----- 3. Boutons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 32px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-cta);
  color: #FFFFFF;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(16, 185, 129, 0.45);
  color: #FFFFFF;
}

.btn-secondary {
  background: var(--surface);
  color: var(--primary-dark);
  border: 2px solid var(--primary);
}
.btn-secondary:hover {
  background: var(--surface-alt);
  transform: translateY(-1px);
}

/* Badge officiel "Disponible sur Google Play"
   Image SVG fournie par Google (images/google-play-badge-fr.svg).
   On expose deux tailles : par défaut (hero/CTA) et --sm (header). */
.gp-badge {
  display: inline-block;
  line-height: 0;
  text-decoration: none;
  border-radius: 10px;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
}
.gp-badge img {
  display: block;
  height: 64px;
  width: auto;
  border-radius: 8px;
}
.gp-badge:hover {
  transform: translateY(-2px);
  opacity: 0.92;
}
.gp-badge:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 4px;
}

/* Variante petite (en-tête sticky) */
.gp-badge--sm img {
  height: 40px;
}

/* ----- 4. En-tête fixe (logo + nav minimale) ----- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--divider);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  padding-bottom: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--text);
  font-size: 1.05rem;
}
.brand img { width: 32px; height: 32px; }
.site-header nav { display: flex; gap: 22px; align-items: center; }
.site-header nav a {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
}
.site-header nav a:hover { color: var(--primary-dark); }

@media (max-width: 720px) {
  .site-header nav a:not(.gp-badge) { display: none; }
}

/* ----- 5. Hero ----- */
.hero {
  position: relative;
  background: var(--gradient-hero);
  color: #FFFFFF;
  overflow: hidden;
  padding: 80px 0 100px;
}

/* Motif de cercles décoratifs (clin d'œil aux quiz pages de l'app) */
.hero::before,
.hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.hero::before {
  width: 420px; height: 420px;
  background: rgba(52, 211, 153, 0.18);
  top: -180px; right: -120px;
}
.hero::after {
  width: 260px; height: 260px;
  background: rgba(16, 185, 129, 0.14);
  bottom: -80px; left: -80px;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-content h1 { color: #FFFFFF; margin-bottom: 20px; }
.hero-content .slogan {
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  font-weight: 600;
  color: #34D399;
  margin-bottom: 18px;
  letter-spacing: 0.01em;
}
.hero-content .lead {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 32px;
  max-width: 520px;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}
.hero-trust {
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.hero-trust .stars {
  color: var(--sun);
  font-size: 1.1rem;
  letter-spacing: 0.05em;
}
.hero-trust .trust-text {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.78);
}
.hero-trust .trust-text strong { color: #FFFFFF; }

/* Mockup de smartphone côté droit */
.phone-mockup {
  position: relative;
  width: 280px;
  height: 580px;
  margin: 0 auto;
  background: #1A1D24;
  border-radius: 38px;
  padding: 8px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    0 0 0 2px rgba(255, 255, 255, 0.08) inset;
}
.phone-mockup::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  z-index: 2;
}
.phone-screen {
  width: 100%;
  height: 100%;
  border-radius: 30px;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.phone-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.phone-screen.placeholder {
  background:
    radial-gradient(circle at 20% 20%, rgba(16, 185, 129, 0.18), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(251, 113, 133, 0.12), transparent 50%),
    var(--bg);
  flex-direction: column;
  padding: 30px 20px;
  text-align: center;
}
.phone-screen.placeholder img {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  object-fit: contain;
}
.phone-screen.placeholder strong {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.phone-screen.placeholder span {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

@media (max-width: 860px) {
  .hero { padding: 60px 0 80px; }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .hero-content { text-align: center; }
  .hero-cta { justify-content: center; }
  .hero-trust { justify-content: center; }
  .hero-content .lead { margin-left: auto; margin-right: auto; }
  .phone-mockup { width: 240px; height: 500px; }
}

/* ----- 6. Sections génériques ----- */
section { padding: 80px 0; }
section.alt { background: var(--surface); }

.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 56px;
}
.section-head h2::after {
  content: '';
  display: block;
  width: 56px;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
  margin: 14px auto 0;
}
.section-head p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-top: 14px;
}
.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary-dark);
  background: rgba(16, 185, 129, 0.10);
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
}

/* ----- 7. Cards "Pourquoi" ----- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
}
.feature {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  border: 1px solid var(--divider);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}
.feature:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.feature-icon svg { width: 24px; height: 24px; }
.feature h3 { margin-bottom: 8px; font-size: 1.15rem; }
.feature p { color: var(--text-secondary); font-size: 0.95rem; margin: 0; }

/* ----- 8. Galerie de screenshots ----- */
.screenshots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px;
  align-items: end;
}
.screenshot-item { text-align: center; }
.screenshot-item .phone-mockup {
  width: 100%;
  max-width: 240px;
  height: 480px;
  margin-bottom: 14px;
}
.screenshot-item .caption {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Placeholder coloré simulant un écran de l'app */
.screenshot-item .phone-screen.simulate-1 {
  background: var(--gradient-hero);
  display: flex;
  flex-direction: column;
  padding: 28px 18px;
  text-align: center;
  color: #FFFFFF;
  justify-content: space-between;
}
.screenshot-item .phone-screen.simulate-2 {
  background: linear-gradient(160deg, #FB7185 0%, #E11D48 100%);
}
.screenshot-item .phone-screen.simulate-3 {
  background: linear-gradient(160deg, #F59E0B 0%, #D97706 100%);
}
.screenshot-item .phone-screen.simulate-4 {
  background: linear-gradient(160deg, #34D399 0%, #047857 100%);
}
.screenshot-item .phone-screen .sim-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #FFFFFF;
  margin-top: 16px;
}
.screenshot-item .phone-screen .sim-sub {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 6px;
}
.screenshot-item .phone-screen .sim-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 60px auto 0;
}
.screenshot-item .phone-screen .sim-icon svg { width: 30px; height: 30px; color: #FFFFFF; }

/* ----- 9. Section confiance ----- */
.trust {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 48px 32px;
  text-align: center;
  border: 1px solid var(--divider);
  box-shadow: var(--shadow-md);
  max-width: 760px;
  margin: 0 auto;
}
.trust .rating {
  font-size: 3rem;
  font-weight: 900;
  color: var(--primary-dark);
  line-height: 1;
  letter-spacing: -0.04em;
}
.trust .stars-big {
  color: var(--sun);
  font-size: 1.6rem;
  margin: 8px 0;
  letter-spacing: 0.1em;
}
.trust .meta {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 28px;
}
.trust blockquote {
  margin: 0;
  padding: 24px 28px;
  background: var(--surface-alt);
  border-left: 4px solid var(--primary);
  border-radius: 12px;
  text-align: left;
  font-style: italic;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.6;
}
.trust blockquote footer {
  margin-top: 12px;
  font-style: normal;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ----- 10. "Comment ça marche" — étapes ----- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  counter-reset: step;
}
.step {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px;
  border: 1px solid var(--divider);
  position: relative;
  counter-increment: step;
}
.step::before {
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-cta);
  color: #FFFFFF;
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.step h3 { margin-bottom: 6px; font-size: 1.1rem; }
.step p { color: var(--text-secondary); font-size: 0.95rem; margin: 0; }

/* ----- 11. CTA final ----- */
.cta-final {
  background: var(--gradient-hero);
  color: #FFFFFF;
  text-align: center;
  border-radius: var(--radius-xl);
  padding: 64px 32px;
  position: relative;
  overflow: hidden;
}
.cta-final::before,
.cta-final::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.cta-final::before {
  width: 300px; height: 300px;
  background: rgba(52, 211, 153, 0.18);
  top: -120px; right: -100px;
}
.cta-final::after {
  width: 200px; height: 200px;
  background: rgba(16, 185, 129, 0.14);
  bottom: -80px; left: -60px;
}
.cta-final h2 {
  color: #FFFFFF;
  margin-bottom: 14px;
  position: relative;
}
.cta-final p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.05rem;
  margin-bottom: 28px;
  position: relative;
}
.cta-final .gp-badge { position: relative; }

/* ----- 12. Formulaire de contact ----- */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  border: 1px solid var(--divider);
  box-shadow: var(--shadow-md);
}
.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 0.95rem;
}
.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--divider);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}
.field textarea { resize: vertical; min-height: 130px; font-family: inherit; }
.field .error-msg {
  color: #DC2626;
  font-size: 0.85rem;
  margin-top: 6px;
  display: none;
}
.field.invalid input,
.field.invalid textarea { border-color: #DC2626; }
.field.invalid .error-msg { display: block; }

.honeypot { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }

.form-submit { display: flex; justify-content: center; }

.form-feedback {
  margin-top: 20px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-align: center;
  display: none;
}
.form-feedback.success {
  display: block;
  background: rgba(16, 185, 129, 0.12);
  color: var(--primary-dark);
  border: 1px solid var(--primary-light);
}
.form-feedback.error {
  display: block;
  background: rgba(220, 38, 38, 0.10);
  color: #B91C1C;
  border: 1px solid #FCA5A5;
}

/* ----- 13. Footer ----- */
.site-footer {
  background: var(--text);
  color: rgba(255, 255, 255, 0.72);
  padding: 48px 0 32px;
  margin-top: 80px;
}
.site-footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}
.site-footer .footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  color: #FFFFFF;
}
.site-footer .footer-brand img {
  width: 28px; height: 28px;
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  justify-content: center;
}
.site-footer nav a {
  color: var(--primary-light);
  font-weight: 500;
  font-size: 0.92rem;
}
.site-footer nav a:hover {
  color: #FFFFFF;
  text-decoration: underline;
}
.site-footer .copy {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.85rem;
}

/* ----- 14. Pages légales (mentions, politique) ----- */
.legal-page {
  padding: 60px 0 40px;
}
.legal-page h1 { margin-bottom: 8px; }
.legal-page .updated {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 32px;
}
.legal-page article {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  border: 1px solid var(--divider);
  box-shadow: var(--shadow-sm);
  max-width: 820px;
  margin: 0 auto;
}
.legal-page article h2 {
  font-size: 1.4rem;
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--primary-dark);
}
.legal-page article h2:first-of-type { margin-top: 0; }
.legal-page article ul { padding-left: 20px; }
.legal-page article ul li { margin-bottom: 6px; }
.legal-page article address {
  font-style: normal;
  background: var(--surface-alt);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin: 12px 0;
  border-left: 4px solid var(--primary);
}

/* ----- 15. Page 404 ----- */
.error-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px;
}
.error-page .error-code {
  font-size: 6rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  letter-spacing: -0.05em;
}
.error-page h1 { margin: 16px 0 12px; }
.error-page p { color: var(--text-secondary); margin-bottom: 28px; }

/* ----- 16. Animations légères ----- */
@media (prefers-reduced-motion: no-preference) {
  .feature, .step, .screenshot-item, .trust {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  }
  .feature.in-view, .step.in-view, .screenshot-item.in-view, .trust.in-view {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ----- 17. Accessibilité ----- */
:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 2px;
}

/* ----- 18. Responsive ajustements ----- */
@media (max-width: 600px) {
  section { padding: 60px 0; }
  .container { padding: 0 18px; }
  .feature, .step { padding: 22px 18px; }
  .contact-form { padding: 28px 22px; }
  .legal-page article { padding: 26px 20px; }
  .cta-final { padding: 48px 22px; }
  .trust { padding: 36px 22px; }
}
