/* ===== Palette YoGuten ===== */
:root {
  --rouge: #C81924;
  --blanc: #FFFFFF;
  --anthracite: #202020;
  /* Règle 60/30/10 : 60 % neutres (blanc, beige), 30 % anthracite, 10 % rouge pour les actions.
     Le jaune reste une touche rare (série de jours, badges). */
  --rose-pale: #F3EDE3; /* surface douce neutre (champs, encadrés) : n'est plus rose */
  --or: #FFCE00;

  --rouge-hover: #A8141E;
  --gris: #6B6B6B;
  --bordure: #E9E0D0;
  --gris-clair: #ECECEC;
  --vert: #15803D;
  --vert-pale: #E8F7EE;
  --beige: #F6F1E8; /* fond du contenu */
  --beige-fonce: #EDE4D4;
  --ligne: #E9E0D0; /* bordures sur fond beige */

  --font: 'Urbanist Variable', 'Urbanist', system-ui, sans-serif;
  --font-display: 'Urbanist Variable', 'Urbanist', system-ui, sans-serif;
  --radius: 16px;
  --radius-lg: 28px;
  --shadow: 0 12px 32px rgba(32, 32, 32, 0.08);
  --shadow-doux: 0 2px 10px rgba(32, 32, 32, 0.04);
  --sidebar-w: 264px;
  --bottom-nav-h: 68px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font);
  color: var(--anthracite);
  background: var(--blanc);
  line-height: 1.6;
  font-weight: 500; /* Urbanist est fine en 400 : plus lisible sur téléphone */
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

button {
  font-family: inherit;
}

/* Titres : police d'affichage */
h1, h2, h3, .logo, .greeting, .view-title, .section-title, .summary__title, .here__title, .exam-head h2,
.hero__title, .section__title, .modal__title, .profile-card__name, .lesson-card__title {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

/* Icônes Hugeicons (js/icons.js) */
.hi {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.hi * {
  stroke-width: 1.7;
}

svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:focus-visible {
  outline: 3px solid var(--or);
  outline-offset: 2px;
}

/* ===== Boutons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 11px 22px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--rouge);
  color: var(--blanc);
}

.btn--primary:hover {
  background: var(--rouge-hover);
}

.btn--ghost {
  background: transparent;
  color: var(--anthracite);
  border-color: var(--anthracite);
}

.btn--ghost:hover {
  background: var(--anthracite);
  color: var(--blanc);
}

.btn--link {
  background: none;
  border: none;
  padding: 0;
  color: var(--anthracite);
  font-size: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.btn--link:hover {
  text-decoration: underline;
}

.btn--lg {
  padding: 15px 28px;
  font-size: 1.05rem;
}

.btn--sm {
  padding: 7px 16px;
  font-size: 0.9rem;
}

.btn--block {
  width: 100%;
}

.icon-fill {
  fill: currentColor;
  stroke: none;
}

/* ===== Lecteur audio (dashboard + leçon) ===== */
.player {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.player__btn {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border: none;
  border-radius: 50%;
  background: var(--anthracite);
  color: var(--blanc);
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(32, 32, 32, 0.3);
  transition: transform 0.15s ease, background 0.15s ease;
}

.player__btn:hover {
  background: #000;
}

.player__btn:active {
  transform: scale(0.94);
}

.player__btn .icon-stop,
.player.is-playing .icon-play {
  display: none;
}

.player.is-playing .icon-stop {
  display: block;
}

.player__track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--rose-pale);
  overflow: hidden;
}

.player__track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--anthracite);
  transition: width 0.25s linear;
}

.player__time {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.9rem;
  min-width: 36px;
}

/* ===== Logo : carré rouge (Y + point jaune) puis « YoGuten » ===== */
.logo {
  display: inline-flex;
  align-items: center;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--rouge);
  text-decoration: none;
}

.logo::before {
  content: '';
  width: 1.3em;
  height: 1.3em;
  flex-shrink: 0;
  margin-right: 0.36em; /* pas de gap : « Yo » et « Guten » doivent rester collés */
  background: url(/logo.svg) center / contain no-repeat;
}

/* ===== Navigation ===== */
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--anthracite);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link.is-active {
  color: var(--anthracite);
}

/* Sidebar : masquée sur mobile */
.sidebar {
  display: none;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar__nav .nav-link {
  padding: 12px 14px;
  border-radius: 12px;
}

.sidebar__nav .nav-link:hover {
  background: var(--rose-pale);
}

.sidebar__nav .nav-link.is-active {
  background: var(--rose-pale);
}

.sidebar__footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  font-weight: 700;
}

.user-chip__avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--anthracite);
  color: var(--blanc);
  font-weight: 800;
}

/* Barre du haut (mobile) */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 16px;
  background: var(--blanc);
  border-bottom: 1px solid var(--bordure);
}

/* Bottom nav (mobile) */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--blanc);
  border-top: 1px solid var(--bordure);
}

.bottom-nav .nav-link {
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--gris);
}

.bottom-nav .nav-link.is-active {
  color: var(--anthracite);
}

/* ===== Contenu principal ===== */
.main {
  padding: 16px 16px calc(var(--bottom-nav-h) + 24px);
}

/* ===== Hero ===== */
.hero {
  display: grid;
  gap: 40px;
  background: var(--rose-pale);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  overflow: hidden;
}

.hero__tag {
  display: inline-block;
  background: var(--blanc);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.hero__title {
  font-size: clamp(2.2rem, 7vw, 3.9rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin-bottom: 16px;
}

.hero__title span {
  color: var(--rouge);
}

.hero__subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  font-weight: 500;
  margin-bottom: 32px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin-bottom: 40px;
}

.hero__welcome {
  font-size: 1.1rem;
}

.stats {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 0;
  font-weight: 600;
  color: var(--gris);
}

.stats li {
  white-space: nowrap;
}

.stats li + li::before {
  content: '·';
  margin: 0 clamp(8px, 2vw, 14px);
  color: var(--rouge);
  font-weight: 800;
}

.stats strong {
  color: var(--anthracite);
  font-size: clamp(1.2rem, 4vw, 1.5rem);
  font-weight: 800;
  margin-right: 4px;
}

/* Aperçu d'un module */
.hero__visual {
  position: relative;
  max-width: 380px;
  width: 100%;
  justify-self: center;
}

.preview {
  background: var(--blanc);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow);
  transform: rotate(-2deg);
}

.preview__head {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 700;
}

.preview__module {
  color: var(--rouge);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.preview__time {
  color: var(--gris);
}

.preview__title {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 4px 0 14px;
}

.preview__bar {
  height: 10px;
  background: var(--rose-pale);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 18px;
}

.preview__bar span {
  display: block;
  height: 100%;
  background: var(--or);
  border-radius: inherit;
}

.preview__lessons {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-weight: 600;
}

.preview__lessons li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
}

.preview__lessons .dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--bordure);
}

.preview__lessons .is-done .dot {
  background: var(--rouge);
  border-color: var(--rouge);
  box-shadow: inset 0 0 0 4px var(--blanc);
}

.preview__lessons .is-current {
  background: var(--rose-pale);
  color: var(--rouge);
}

.preview__lessons .is-current .dot {
  border-color: var(--rouge);
}

.preview__chip {
  position: absolute;
  right: -8px;
  bottom: -16px;
  background: var(--anthracite);
  color: var(--or);
  font-weight: 800;
  padding: 10px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  transform: rotate(3deg);
}

/* ===== Sections ===== */
.section {
  padding: 64px 8px 0;
}

.section__title {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section__lead {
  color: var(--gris);
  font-size: 1.1rem;
  margin: 6px 0 28px;
  max-width: 560px;
}

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.step {
  border: 2px solid var(--rose-pale);
  border-radius: var(--radius);
  padding: 24px;
}

.step__num {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--rouge);
  color: var(--blanc);
  font-weight: 800;
  margin-bottom: 16px;
}

.step h3 {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  max-width: 760px;
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 2px solid var(--rose-pale);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.plan--featured {
  border-color: var(--rouge);
  background: var(--rose-pale);
}

.plan__badge {
  position: absolute;
  top: -14px;
  left: 28px;
  background: var(--or);
  font-size: 0.8rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
}

.plan__name {
  font-size: 1.2rem;
  font-weight: 800;
}

.plan__price {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 4px 0 16px;
}

.plan__price small {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gris);
}

.plan__features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
  flex: 1;
}

.plan__features li::before {
  content: '✓';
  color: var(--rouge);
  font-weight: 800;
  margin-right: 10px;
}

.footer {
  margin-top: 64px;
  padding: 24px 8px;
  border-top: 1px solid var(--bordure);
  color: var(--gris);
  font-size: 0.95rem;
}

/* ===== Modales ===== */
.modal {
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  width: min(460px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  box-shadow: var(--shadow);
  color: var(--anthracite);
}

.modal::backdrop {
  background: rgba(32, 32, 32, 0.55);
}

.modal__form {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 32px 28px 28px;
}

.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--rose-pale);
  color: var(--anthracite);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.modal__close:hover {
  background: var(--bordure);
}

.modal__title {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.modal__subtitle {
  color: var(--gris);
  margin-top: -12px;
}

.modal__switch {
  text-align: center;
  color: var(--gris);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: none;
  font-weight: 600;
}

.field legend {
  margin-bottom: 6px;
}

.field input[type='text'],
.field input[type='email'],
.field input[type='password'] {
  font-family: inherit;
  font-size: 1rem;
  padding: 12px 14px;
  border: 2px solid var(--rose-pale);
  border-radius: 12px;
  background: var(--rose-pale);
  color: var(--anthracite);
}

.field input:focus {
  outline: none;
  border-color: var(--anthracite);
  background: var(--blanc);
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pills--grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pill span {
  display: block;
  text-align: center;
  padding: 10px 16px;
  border: 2px solid var(--bordure);
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.pill span:hover {
  border-color: var(--anthracite);
}

.pill input:checked + span {
  border-color: var(--anthracite);
  background: var(--rose-pale);
  color: var(--anthracite);
}

.pill input:focus-visible + span {
  outline: 3px solid var(--or);
  outline-offset: 2px;
}

.form-error {
  color: var(--rouge);
  font-weight: 600;
}

.form-error:empty {
  display: none;
}

/* ===== Desktop : sidebar gauche ===== */
@media (min-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    gap: 36px;
    padding: 28px 20px;
    background: var(--blanc);
    border-right: 1px solid var(--bordure);
  }

  .sidebar .logo {
    padding: 0 14px;
  }

  .sidebar .btn {
    padding-inline: 12px;
    font-size: 0.95rem;
    white-space: nowrap;
  }

  .topbar,
  .bottom-nav {
    display: none;
  }

  html {
    scroll-padding-top: 24px;
  }

  .main {
    margin-left: var(--sidebar-w);
    padding: 24px 40px 0;
    max-width: calc(1200px + var(--sidebar-w));
  }

  .hero {
    padding: 64px 56px;
  }
}

@media (min-width: 1180px) {
  .hero {
    grid-template-columns: 1.3fr 1fr;
    align-items: center;
    min-height: calc(100vh - 48px);
  }
}

/* ===== Bouton « écouter » (séances, quiz, révisions, parcours) ===== */
.speak-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: none;
  border-radius: 50%;
  background: var(--rose-pale);
  color: var(--anthracite);
  cursor: pointer;
}

.speak-btn:hover {
  background: var(--bordure);
}

.speak-btn svg {
  width: 18px;
  height: 18px;
}

.speak-btn--lg {
  width: 64px;
  height: 64px;
  background: var(--anthracite);
  color: var(--blanc);
  box-shadow: 0 8px 20px rgba(32, 32, 32, 0.25);
}

.speak-btn--lg:hover {
  background: #000;
}

.speak-btn--lg svg {
  width: 26px;
  height: 26px;
}

/* Titres en medium sur tout le site, jamais en gras (choix de marque) */
h1, h2, h3,
.greeting, .logo, .section-title, .summary__title, .here__title,
.auth-card__title, .step-card__title, .test-q__prompt, .exam-intro h1, .res-hero h1 {
  font-weight: 500 !important;
}
