/* « Comment ça marche » en 3 scènes animées — reprise de la version de mai (site-v2/src/styles/how-it-works.css) */
/* ============================================================
   How It Works — 3 scenes vectorielles animees
   Style cohérent avec gp-map (HUD glass) — fond clair, premium.
   ============================================================ */

.hiw-section {
  position: relative;
  padding: 120px 0 130px;
  background: #F8F9FA;
  overflow: hidden;
}

/* Grid pattern subtil en background — coherent avec le HUD de la carte */
.hiw-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(26, 59, 107, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 59, 107, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 0%, transparent 70%);
  pointer-events: none;
}

.hiw-section .container {
  position: relative;
  z-index: 1;
}

/* ===== Head ===== */
.hiw-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 72px;
}

.hiw-eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #FF6B00;
  background: rgba(255, 107, 0, 0.08);
  padding: 8px 16px;
  border-radius: 999px;
  margin-bottom: 24px;
}

.hiw-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5.6vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: #1A3B6B;
  margin-bottom: 20px;
}

.hiw-title-accent {
  color: #2E7BB5;
  font-style: italic;
  font-weight: 700;
}

.hiw-lede {
  font-family: var(--font-body);
  font-size: clamp(1rem, 2vw, 1.12rem);
  line-height: 1.65;
  color: #5A6478;
}

/* ===== Grid ===== */
.hiw-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  align-items: stretch;
}

@media (max-width: 980px) {
  .hiw-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    max-width: 480px;
    margin: 0 auto;
  }
}

/* ===== Card ===== */
.hiw-card {
  position: relative;
  background: #FFFFFF;
  border: 1px solid rgba(26, 59, 107, 0.08);
  border-radius: 24px;
  padding: 28px 26px 30px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 12px 30px -12px rgba(26, 59, 107, 0.12),
    0 2px 6px rgba(26, 59, 107, 0.04);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.35s ease;
}

@media (hover: hover) {
  .hiw-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 107, 0, 0.25);
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.8) inset,
      0 24px 50px -18px rgba(26, 59, 107, 0.22),
      0 4px 12px rgba(26, 59, 107, 0.06);
  }
}

/* ===== Stage (zone scene SVG) ===== */
.hiw-card-stage {
  position: relative;
  width: 100%;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #F4F7FB 0%, #EAF1F8 100%);
  border-radius: 16px;
  overflow: hidden;
  isolation: isolate;
}

.hiw-card-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(91, 164, 217, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 70% 80%, rgba(255, 107, 0, 0.06) 0%, transparent 60%);
  pointer-events: none;
}

.hiw-scene {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hiw-scene svg {
  width: auto;
  height: 100%;
  max-width: 100%;
  display: block;
}

/* ===== Card meta (texte sous la scene) ===== */
.hiw-card-num-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.hiw-card-num {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: #FFFFFF;
  background: #1A3B6B;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.02em;
  box-shadow: 0 4px 12px -4px rgba(26, 59, 107, 0.5);
}

.hiw-card-eyebrow {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #FF6B00;
}

.hiw-card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: #1A1A2E;
  margin-bottom: 8px;
}

.hiw-card-desc {
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.6;
  color: #5A6478;
}

/* ===== CTA row ===== */
.hiw-cta-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 64px;
}

.hiw-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: #FF6B00;
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border-radius: 999px;
  text-decoration: none;
  box-shadow:
    0 8px 30px rgba(255, 107, 0, 0.35),
    0 0 0 1px rgba(255, 107, 0, 0.5);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.hiw-cta-btn:hover {
  background: #FF8533;
  transform: translateY(-2px);
  box-shadow:
    0 12px 40px rgba(255, 107, 0, 0.5),
    0 0 0 1px rgba(255, 107, 0, 0.6);
}

.hiw-cta-btn svg {
  transition: transform 0.2s ease;
}

.hiw-cta-btn:hover svg {
  transform: translateX(3px);
}

.hiw-cta-link {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: #5A6478;
  text-decoration: none;
  border-bottom: 1px dashed rgba(26, 59, 107, 0.25);
  padding-bottom: 1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.hiw-cta-link:hover {
  color: #1A3B6B;
  border-color: rgba(26, 59, 107, 0.6);
}

/* ============================================================
   SCENE 1 — Smartphone
   ============================================================ */
.hiw-scene-phone svg {
  height: 92%;
}

.hiw-phone-bezel {
  fill: #1A1A2E;
}

.hiw-phone-screen {
  fill: #FFFFFF;
}

.hiw-phone-notch {
  fill: #1A1A2E;
}

.hiw-phone-time {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  fill: #1A1A2E;
}

.hiw-phone-icons rect {
  fill: #1A1A2E;
  opacity: 0.5;
}

.hiw-phone-app-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  fill: #1A3B6B;
  letter-spacing: -0.02em;
}

.hiw-phone-app-sub {
  font-family: var(--font-body);
  font-size: 9px;
  fill: #8A95A8;
}

.hiw-phone-label {
  font-family: var(--font-body);
  font-size: 8px;
  font-weight: 600;
  fill: #5A6478;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.hiw-phone-input {
  fill: #F4F7FB;
  stroke: rgba(26, 59, 107, 0.1);
  stroke-width: 1;
}

.hiw-phone-input-text {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  fill: #1A1A2E;
}

.hiw-phone-checkbox {
  fill: #FFFFFF;
  stroke: #C5CDDA;
  stroke-width: 1.2;
}

.hiw-phone-checkmark {
  fill: none;
  stroke: #FFFFFF;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.hiw-phone-checkbox-label {
  font-family: var(--font-body);
  font-size: 9px;
  fill: #5A6478;
}

.hiw-phone-price-bg {
  fill: #1A3B6B;
}

.hiw-phone-price-eyebrow {
  font-family: var(--font-body);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  fill: rgba(255, 255, 255, 0.6);
}

.hiw-phone-price-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  fill: #FFFFFF;
  letter-spacing: -0.03em;
}

.hiw-phone-price-currency {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  fill: #FF6B00;
  letter-spacing: -0.01em;
}

.hiw-phone-price-note {
  font-family: var(--font-body);
  font-size: 8px;
  fill: rgba(255, 255, 255, 0.55);
}

.hiw-cursor {
  fill: #1A3B6B;
  stroke: #FFFFFF;
  stroke-width: 0.8;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* ============================================================
   SCENE 2 — Carte + camion
   ============================================================ */
.hiw-scene-map svg {
  height: 92%;
  border-radius: 12px;
}

.hiw-map-bg {
  fill: #1A3B6B;
}

.hiw-grid-line {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 1;
}

.hiw-map-island path {
  fill: rgba(255, 255, 255, 0.1);
  stroke: rgba(255, 255, 255, 0.35);
  stroke-width: 1.2;
  stroke-linejoin: round;
}

.hiw-route {
  stroke: #FF6B00;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  filter: drop-shadow(0 0 4px rgba(255, 107, 0, 0.6));
}

.hiw-pin-halo {
  opacity: 0.5;
  animation: hiw-pulse 2.4s ease-out infinite;
  transform-origin: center;
  transform-box: fill-box;
}

.hiw-pin-depart-halo {
  fill: rgba(91, 164, 217, 0.45);
}

.hiw-pin-arrivee-halo {
  fill: rgba(255, 107, 0, 0.45);
}

.hiw-pin-dot {
  stroke: #FFFFFF;
  stroke-width: 1.5;
}

.hiw-pin-depart {
  fill: #5BA4D9;
}

.hiw-pin-arrivee {
  fill: #FF6B00;
  filter: drop-shadow(0 0 6px rgba(255, 107, 0, 0.7));
}

.hiw-pin-label {
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 700;
  fill: #FFFFFF;
  letter-spacing: 0.01em;
}

@keyframes hiw-pulse {
  0% { transform: scale(0.7); opacity: 0.65; }
  70% { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Truck */
.hiw-truck-cabin {
  fill: #FF6B00;
}

.hiw-truck-window {
  fill: #FFD9BD;
  opacity: 0.85;
}

.hiw-truck-box {
  fill: #FFFFFF;
  stroke: #1A3B6B;
  stroke-width: 0.6;
}

.hiw-truck-wheel {
  fill: #1A1A2E;
  stroke: #FFFFFF;
  stroke-width: 0.4;
}

.hiw-truck {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

/* ============================================================
   SCENE 3 — Notification WhatsApp / lockscreen
   ============================================================ */
.hiw-scene-notif {
  padding: 18px;
}

.hiw-lockscreen {
  position: relative;
  width: 100%;
  max-width: 260px;
  height: 92%;
  border-radius: 28px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(91, 164, 217, 0.35) 0%, transparent 55%),
    linear-gradient(180deg, #0F2849 0%, #1A3B6B 100%);
  padding: 28px 16px 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hiw-lock-time {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 200;
  color: #FFFFFF;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 4px;
}

.hiw-lock-date {
  font-family: var(--font-body);
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.04em;
  margin-bottom: 28px;
}

.hiw-waves {
  position: absolute;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  height: 80px;
  pointer-events: none;
}

.hiw-waves span {
  position: absolute;
  top: 0;
  left: 50%;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 107, 0, 0.4);
  transform: translateX(-50%) scale(0);
  opacity: 0;
  animation: hiw-wave 2.8s ease-out infinite;
}

.hiw-waves span:nth-child(2) {
  animation-delay: 0.9s;
}

.hiw-waves span:nth-child(3) {
  animation-delay: 1.8s;
}

@keyframes hiw-wave {
  0% { transform: translateX(-50%) scale(0.4); opacity: 0.7; }
  100% { transform: translateX(-50%) scale(2.4); opacity: 0; }
}

.hiw-notif {
  position: relative;
  z-index: 2;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 12px 12px 12px 12px;
  box-shadow:
    0 10px 30px -8px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.3) inset;
}

.hiw-notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.hiw-notif-app {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hiw-notif-app-icon {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: #1A3B6B;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hiw-notif-app-name {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  color: #1A1A2E;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.hiw-notif-time {
  font-family: var(--font-body);
  font-size: 0.65rem;
  color: #8A95A8;
  font-weight: 500;
}

.hiw-notif-body {
  display: flex;
  gap: 10px;
  align-items: center;
}

.hiw-notif-text {
  flex: 1;
  min-width: 0;
}

.hiw-notif-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  color: #1A1A2E;
  letter-spacing: -0.015em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.2;
  margin-bottom: 2px;
}

.hiw-notif-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hiw-notif-msg {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: #5A6478;
  line-height: 1.35;
}

.hiw-notif-photo {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.hiw-notif-photo svg {
  width: 100%;
  height: 100%;
}

.hiw-photo-bg {
  fill: #C8D5E1;
}

.hiw-photo-door {
  fill: #5A6478;
}

.hiw-photo-handle {
  fill: #FFD9BD;
}

.hiw-photo-box {
  fill: #C68A5C;
}

.hiw-photo-tape {
  fill: none;
  stroke: #8A5A3A;
  stroke-width: 0.6;
}

/* ============================================================
   Mobile tweaks
   ============================================================ */
@media (max-width: 980px) {
  .hiw-section {
    padding: 80px 0 90px;
  }
  .hiw-head {
    margin-bottom: 48px;
  }
  .hiw-card-stage {
    height: 280px;
  }
}

@media (max-width: 540px) {
  .hiw-card {
    padding: 22px 20px 24px;
  }
  .hiw-card-stage {
    height: 260px;
  }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  .hiw-pin-halo,
  .hiw-waves span {
    animation: none;
  }
  .hiw-card,
  .hiw-cta-btn {
    transition: none;
  }
}

/* ===== Bouton global pause/play des 3 scènes (positionné au-dessus du CTA) ===== */
.hiw-pause-row {
  display: flex;
  justify-content: center;
  margin-top: 32px;
  margin-bottom: 16px;
}

.hiw-pause-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: rgba(26, 59, 107, 0.06);
  color: var(--color-primary);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid rgba(26, 59, 107, 0.18);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease,
    transform 0.2s ease;
}

.hiw-pause-btn:hover {
  background: rgba(255, 107, 0, 0.08);
  border-color: rgba(255, 107, 0, 0.4);
  color: var(--color-accent);
  transform: translateY(-1px);
}

.hiw-pause-btn:active {
  transform: translateY(0);
}

.hiw-pause-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.hiw-pause-btn.is-paused {
  background: rgba(255, 107, 0, 0.1);
  border-color: rgba(255, 107, 0, 0.5);
  color: var(--color-accent);
}

.hiw-pause-btn svg {
  flex-shrink: 0;
}

/* Apparition en cascade (remplace framer-motion de la version de mai) */
.hiw-reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1); }
.hiw-reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .hiw-reveal { opacity: 1; transform: none; transition: none; } }
