/* ═══════════════════════════════════════════════════════════════════
   QueFaire — How It Works Page Styles
   ═══════════════════════════════════════════════════════════════════ */

/* ── Hero ──────────────────────────────────────────────────────────── */
.hiw-hero {
  position: relative;
  padding: 160px 0 80px;
  text-align: center;
  overflow: hidden;
}
.hiw-hero__content {
  margin-bottom: 48px;
}
.hiw-hero__title {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 16px;
  margin-top: 16px;
}
.hiw-hero__subtitle {
  font-size: 1.1rem;
  color: #6b6b80;
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── Table des matières ────────────────────────────────────────────── */
.hiw-toc {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 800px;
  margin: 0 auto;
}
.hiw-toc__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  transition: all 0.3s ease;
}
.hiw-toc__item:hover {
  background: rgba(74, 144, 217, 0.08);
  border-color: rgba(74, 144, 217, 0.3);
  transform: translateY(-2px);
}
.hiw-toc__num {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 800;
  font-size: 0.75rem;
  color: #4a90d9;
  background: rgba(74, 144, 217, 0.12);
  padding: 4px 8px;
  border-radius: 8px;
}
.hiw-toc__label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #6b6b80;
}

/* ── Sections ──────────────────────────────────────────────────────── */
.hiw-section {
  padding: 80px 0;
}
.hiw-section--alt {
  background: rgba(0, 0, 0, 0.015);
  border-top: 1px solid rgba(0, 0, 0, 0.04);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.hiw-step {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}
.hiw-step__badge {
  display: inline-block;
  padding: 6px 18px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(74, 144, 217, 0.12);
  color: #4a90d9;
  margin-bottom: 16px;
}
.hiw-step__title {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
}
.hiw-step__desc {
  font-size: 1.05rem;
  color: #6b6b80;
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto 40px;
}

/* ── Profil cards ──────────────────────────────────────────────────── */
.hiw-profiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 700px;
  margin: 0 auto;
}
.hiw-profile-card {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 24px;
  padding: 36px 28px;
  text-align: center;
  transition: all 0.4s;
}
.hiw-profile-card:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
  transform: translateY(-4px);
}
.hiw-profile-card__icon {
  font-size: 3rem;
  margin-bottom: 16px;
}
.hiw-profile-card__title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 10px;
}
.hiw-profile-card__desc {
  font-size: 0.9rem;
  color: #8888a8;
  line-height: 1.6;
  margin-bottom: 18px;
}
.hiw-profile-card__examples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.hiw-profile-card__examples span {
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(74, 144, 217, 0.06);
  color: #8888a8;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

/* ── Category cards ────────────────────────────────────────────────── */
.hiw-categories {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.hiw-cat-card {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 24px;
  padding: 32px 24px;
  text-align: center;
  transition: all 0.4s;
  position: relative;
  overflow: hidden;
}
.hiw-cat-card::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--cat-color);
  opacity: 0;
  transition: opacity 0.4s;
}
.hiw-cat-card:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: var(--cat-color);
  transform: translateY(-4px);
}
.hiw-cat-card:hover::after {
  opacity: 1;
}
.hiw-cat-card__emoji {
  font-size: 3rem;
  margin-bottom: 14px;
}
.hiw-cat-card__title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--cat-color);
}
.hiw-cat-card__desc {
  font-size: 0.88rem;
  color: #8888a8;
  line-height: 1.6;
  margin-bottom: 18px;
}
.hiw-cat-card__sample {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hiw-cat-card__sample span {
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.02);
  color: #8888a8;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

/* ── Mood cards ────────────────────────────────────────────────────── */
.hiw-mood-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}
.hiw-mood-card {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 24px;
  padding: 28px 20px;
  text-align: center;
  transition: all 0.4s;
  position: relative;
  overflow: hidden;
}
.hiw-mood-card::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--mood-color);
  opacity: 0;
  transition: opacity 0.4s;
}
.hiw-mood-card:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: var(--mood-color);
  transform: translateY(-4px);
}
.hiw-mood-card:hover::after {
  opacity: 1;
}
.hiw-mood-card__emoji {
  font-size: 2.8rem;
  margin-bottom: 12px;
}
.hiw-mood-card__name {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.hiw-mood-card__hint {
  font-size: 0.8rem;
  color: var(--mood-color);
  font-weight: 600;
  margin-bottom: 14px;
}
.hiw-mood-card__detail {
  font-size: 0.78rem;
  color: #8888a8;
  line-height: 1.7;
  text-align: left;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.hiw-mood-card__detail strong {
  color: #444455;
}

/* ── Algo box ──────────────────────────────────────────────────────── */
.hiw-algo-box {
  background: linear-gradient(
    135deg,
    rgba(74, 144, 217, 0.08),
    rgba(255, 140, 66, 0.06)
  );
  border: 1px solid rgba(255, 140, 66, 0.15);
  border-radius: 20px;
  padding: 28px 32px;
  text-align: left;
  max-width: 700px;
  margin: 0 auto;
}
.hiw-algo-box__title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.hiw-algo-box__text {
  font-size: 0.9rem;
  color: #6b6b80;
  line-height: 1.7;
}
.hiw-algo-box__text strong {
  color: #2d2d3f;
}

/* ── Action choices ────────────────────────────────────────────────── */
.hiw-action-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 600px;
  margin: 0 auto 32px;
}
.hiw-action-choice {
  background: rgba(92, 184, 92, 0.06);
  border: 1px solid rgba(92, 184, 92, 0.15);
  border-radius: 24px;
  padding: 32px 24px;
  text-align: center;
  transition: all 0.4s;
}
.hiw-action-choice:hover {
  transform: translateY(-4px);
  background: rgba(92, 184, 92, 0.1);
}
.hiw-action-choice--skip {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
}
.hiw-action-choice--skip:hover {
  background: rgba(0, 0, 0, 0.04);
}
.hiw-action-choice__icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}
.hiw-action-choice__title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.hiw-action-choice__desc {
  font-size: 0.88rem;
  color: #8888a8;
  line-height: 1.6;
}

/* ── Timer box ─────────────────────────────────────────────────────── */
.hiw-timer-box {
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(240, 165, 0, 0.06);
  border: 1px solid rgba(240, 165, 0, 0.15);
  border-radius: 20px;
  padding: 24px 28px;
  text-align: left;
  max-width: 600px;
  margin: 0 auto;
}
.hiw-timer-box__icon {
  font-size: 2.2rem;
  flex-shrink: 0;
}
.hiw-timer-box__content h4 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.hiw-timer-box__content p {
  font-size: 0.88rem;
  color: #6b6b80;
  line-height: 1.6;
}

/* ── XP Levels ─────────────────────────────────────────────────────── */
.hiw-levels {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 600px;
  margin: 0 auto 40px;
}
.hiw-level {
  display: grid;
  grid-template-columns: 40px 1fr 140px;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 14px;
  transition: all 0.3s;
}
.hiw-level:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: var(--lvl-color);
}
.hiw-level__emoji {
  font-size: 1.4rem;
}
.hiw-level__info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.hiw-level__name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--lvl-color);
}
.hiw-level__xp {
  font-size: 0.78rem;
  color: #7878a0;
  font-weight: 500;
}
.hiw-level__bar {
  height: 8px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 8px;
  overflow: hidden;
}
.hiw-level__bar div {
  height: 100%;
  background: var(--lvl-color);
  border-radius: 8px;
  transition: width 1s ease-out;
}

/* ── Streak ────────────────────────────────────────────────────────── */
.hiw-streak {
  display: flex;
  align-items: center;
  gap: 24px;
  background: rgba(240, 165, 0, 0.06);
  border: 1px solid rgba(240, 165, 0, 0.15);
  border-radius: 20px;
  padding: 28px 32px;
  max-width: 600px;
  margin: 0 auto;
  text-align: left;
}
.hiw-streak__visual {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.hiw-streak__visual span:first-child {
  font-size: 2.5rem;
}
.hiw-streak__count {
  font-family: "Space Grotesk", sans-serif;
  font-size: 2.5rem;
  font-weight: 900;
  color: #f0a500;
}
.hiw-streak__content h4 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.hiw-streak__content p {
  font-size: 0.88rem;
  color: #6b6b80;
  line-height: 1.6;
}

/* ── Extras grid ───────────────────────────────────────────────────── */
.hiw-extras-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.hiw-extra-card {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 24px;
  padding: 32px 24px;
  text-align: center;
  transition: all 0.4s;
}
.hiw-extra-card:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
  transform: translateY(-4px);
}
.hiw-extra-card__icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}
.hiw-extra-card h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.hiw-extra-card p {
  font-size: 0.88rem;
  color: #8888a8;
  line-height: 1.6;
}

/* ── CTA final ─────────────────────────────────────────────────────── */
.hiw-cta {
  padding: 80px 0;
}
.hiw-cta__card {
  position: relative;
  border-radius: 32px;
  overflow: hidden;
  background: linear-gradient(135deg, #f5f5f7, #eef0f4);
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 80px 40px;
  text-align: center;
}
.hiw-cta__content {
  position: relative;
  z-index: 1;
}
.hiw-cta__title {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900;
  margin-bottom: 16px;
}
.hiw-cta__desc {
  font-size: 1.05rem;
  color: #6b6b80;
  max-width: 500px;
  margin: 0 auto 32px;
  line-height: 1.7;
}
.hiw-cta__buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Nav active link ───────────────────────────────────────────────── */
.nav__links a.active {
  color: #1a1a2e;
}
.nav__links a.active::after {
  width: 100%;
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .hiw-categories {
    grid-template-columns: 1fr;
    max-width: 440px;
    margin: 0 auto;
  }
  .hiw-mood-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hiw-extras-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hiw-hero {
    padding: 120px 0 60px;
  }
  .hiw-toc {
    gap: 8px;
  }
  .hiw-toc__item {
    padding: 10px 14px;
  }
  .hiw-section {
    padding: 60px 0;
  }
  .hiw-profiles {
    grid-template-columns: 1fr;
    max-width: 380px;
  }
  .hiw-action-choices {
    grid-template-columns: 1fr;
    max-width: 380px;
  }
  .hiw-level {
    grid-template-columns: 36px 1fr;
    gap: 10px;
  }
  .hiw-level__bar {
    grid-column: 1 / -1;
  }
  .hiw-streak {
    flex-direction: column;
    text-align: center;
  }
  .hiw-extras-grid {
    grid-template-columns: 1fr;
    max-width: 440px;
    margin: 0 auto;
  }
  .hiw-cta__card {
    padding: 60px 24px;
  }
}

@media (max-width: 480px) {
  .hiw-mood-grid {
    grid-template-columns: 1fr;
  }
  .hiw-toc__item {
    padding: 8px 12px;
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }
}
