/* ============================================================================
   HAPPYN Web — Feuille de style unique
   ----------------------------------------------------------------------------
   Les couleurs sont reprises à l'identique de lib/core/theme/app_colors.dart
   pour que le site et l'app soient visiblement la même marque. Si une couleur
   change côté Flutter, elle change ici.
   ========================================================================== */

:root {
  --background: #0a0817;
  --background-secondary: #120f24;
  --card: #1a1535;
  --primary: #7b6ef6;
  --pink: #e94fad;
  --orange: #ff8c42;
  --text-primary: #ffffff;
  --text-secondary: #b0a8d4;
  --text-muted: #6b6280;
  --border: #2a2448;

  --gradient: linear-gradient(135deg, #7b6ef6 0%, #e94fad 100%);
  --max-width: 1120px;
  --radius: 20px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ── En-tête ──────────────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 8, 23, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
}

/* Le logo est un SVG détouré : pas de border-radius, il n'y a pas de tuile. */
.brand img {
  width: 34px;
  height: 34px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 0.94rem;
  color: var(--text-secondary);
}

.site-nav a:hover {
  color: var(--text-primary);
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  overflow: hidden;
  padding: 96px 0 80px;
}

/* Halo décoratif : deux taches floues aux couleurs de la marque. */
.hero::before {
  content: '';
  position: absolute;
  top: -220px;
  left: 50%;
  transform: translateX(-50%);
  width: 780px;
  height: 520px;
  background: radial-gradient(
      circle at 30% 40%,
      rgba(123, 110, 246, 0.32),
      transparent 62%
    ),
    radial-gradient(circle at 70% 55%, rgba(233, 79, 173, 0.26), transparent 60%);
  filter: blur(24px);
  pointer-events: none;
}

.hero .container {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(26, 21, 53, 0.7);
  color: var(--text-secondary);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hero h1 {
  margin: 0 0 20px;
  font-size: clamp(2.4rem, 5.2vw, 3.7rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.hero p.lead {
  margin: 0 0 34px;
  font-size: 1.12rem;
  color: var(--text-secondary);
  max-width: 30em;
}

/* ── Badges stores ────────────────────────────────────────────────────────── */

.store-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.store-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.store-badge:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.store-badge.disabled {
  opacity: 0.62;
  cursor: default;
}

.store-badge.disabled:hover {
  transform: none;
  border-color: var(--border);
}

.store-badge .badge-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.store-badge .badge-store {
  display: block;
  font-size: 1rem;
  font-weight: 600;
}

.store-badge svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
  flex-shrink: 0;
}

/* ── Maquette téléphone ───────────────────────────────────────────────────── */

.phone-mockup {
  justify-self: center;
  width: 268px;
  aspect-ratio: 9 / 19;
  border-radius: 40px;
  border: 1px solid var(--border);
  background: linear-gradient(160deg, var(--card), var(--background-secondary));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

/* Remplacer par une vraie capture : voir web/README.md § Captures d'écran. */
.phone-mockup .screenshot-slot {
  width: 100%;
  height: 100%;
  border-radius: 28px;
  background: repeating-linear-gradient(
    135deg,
    rgba(123, 110, 246, 0.07),
    rgba(123, 110, 246, 0.07) 12px,
    transparent 12px,
    transparent 24px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 20px;
}

.phone-mockup img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 28px;
}

/* ── Sections génériques ──────────────────────────────────────────────────── */

section {
  padding: 80px 0;
}

.section-head {
  max-width: 44em;
  margin-bottom: 48px;
}

.section-head h2 {
  margin: 0 0 14px;
  font-size: clamp(1.8rem, 3.4vw, 2.4rem);
  letter-spacing: -0.015em;
}

.section-head p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.band {
  background: var(--background-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* ── Grille de features ───────────────────────────────────────────────────── */

/* 2 × 2 sur grand écran : à trois colonnes, la 4e carte reste orpheline. */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.feature-card {
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
}

.feature-card .icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 1.35rem;
}

.feature-card h3 {
  margin: 0 0 10px;
  font-size: 1.16rem;
}

.feature-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.96rem;
}

/* ── Bandeau organisateurs ────────────────────────────────────────────────── */

.organizer-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px 48px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.organizer-list li {
  padding-left: 30px;
  position: relative;
  color: var(--text-secondary);
}

.organizer-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--gradient);
}

.organizer-list strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ── Contact ──────────────────────────────────────────────────────────────── */

.contact-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  padding: 44px;
  text-align: center;
}

.contact-card h2 {
  margin: 0 0 12px;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
}

.contact-card p {
  margin: 0 auto 28px;
  color: var(--text-secondary);
  max-width: 34em;
}

.button-primary {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 999px;
  background: var(--gradient);
  color: #fff;
  font-weight: 600;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.button-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(123, 110, 246, 0.35);
}

/* ── Pied de page ─────────────────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 56px 0 40px;
  background: var(--background-secondary);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-grid h4 {
  margin: 0 0 16px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.footer-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-grid a {
  color: var(--text-secondary);
  font-size: 0.94rem;
}

.footer-grid a:hover {
  color: var(--text-primary);
}

.footer-about p {
  color: var(--text-secondary);
  font-size: 0.94rem;
  margin: 12px 0 0;
  max-width: 26em;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.86rem;
}

/* ── Pages légales ────────────────────────────────────────────────────────── */

.legal-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 56px;
  padding: 64px 0 96px;
  align-items: start;
}

.legal-sidebar {
  position: sticky;
  top: 96px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  padding: 24px;
}

.legal-sidebar h4 {
  margin: 0 0 16px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.legal-sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.legal-sidebar a {
  display: block;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.legal-sidebar a:hover {
  background: rgba(123, 110, 246, 0.12);
  color: var(--text-primary);
}

.legal-sidebar a.active {
  background: var(--gradient);
  color: #fff;
  font-weight: 600;
}

.legal-content h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 4vw, 2.7rem);
  letter-spacing: -0.02em;
}

.legal-meta {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 0 0 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.legal-section {
  margin-bottom: 32px;
}

.legal-section h2 {
  font-size: 1.2rem;
  margin: 0 0 12px;
  color: var(--text-primary);
}

.legal-section p {
  margin: 0 0 12px;
  color: var(--text-secondary);
}

.legal-section ul {
  margin: 0;
  padding-left: 22px;
  color: var(--text-secondary);
}

.legal-section li {
  margin-bottom: 8px;
}

.legal-index {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.legal-index a {
  display: block;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.legal-index a:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
}

.legal-index strong {
  display: block;
  margin-bottom: 6px;
}

.legal-index span {
  color: var(--text-muted);
  font-size: 0.86rem;
}

/* États de chargement et d'erreur des pages légales. */
.state-message {
  padding: 40px 0;
  color: var(--text-secondary);
}

.state-message.error {
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  padding: 28px;
}

.state-message.error strong {
  color: var(--text-primary);
  display: block;
  margin-bottom: 8px;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .hero .container,
  .legal-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 64px 0 56px;
    text-align: center;
  }

  .hero p.lead {
    margin-left: auto;
    margin-right: auto;
  }

  .store-badges {
    justify-content: center;
  }

  .phone-mockup {
    order: -1;
    width: 220px;
  }

  .legal-sidebar {
    position: static;
  }

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

@media (max-width: 620px) {
  .site-nav {
    display: none;
  }

  .feature-grid,
  .organizer-list {
    grid-template-columns: 1fr;
  }

  section {
    padding: 56px 0;
  }

  .contact-card {
    padding: 32px 24px;
  }

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

/* Respecte le réglage système « réduire les animations ». */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ============================================================================
   Réinitialisation du mot de passe (reset.html)
   ========================================================================== */

.reset-wrap {
  display: flex;
  justify-content: center;
  padding: 72px 20px 96px;
}

.reset-card {
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.reset-card h1 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.25;
}

.reset-card .muted {
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 20px;
}

.reset-card label {
  display: block;
  margin: 18px 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.reset-card input {
  width: 100%;
  padding: 13px 14px;
  font-size: 16px; /* < 16px ferait zoomer Safari iOS au focus */
  color: var(--text-primary);
  background: var(--background-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.reset-card input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.reset-card .hint {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.reset-card .form-error {
  margin: 14px 0 0;
  padding: 11px 13px;
  font-size: 14px;
  line-height: 1.45;
  color: #ffd2e4;
  background: rgba(233, 79, 173, 0.12);
  border: 1px solid rgba(233, 79, 173, 0.35);
  border-radius: 12px;
}

.reset-card .btn-primary {
  width: 100%;
  margin-top: 22px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: var(--gradient);
  border: 0;
  border-radius: 14px;
  cursor: pointer;
}

.reset-card .btn-primary:disabled {
  opacity: 0.6;
  cursor: default;
}

.reset-card a {
  color: var(--primary);
}
