/*
 * Page d'accueil du visiteur (refonte v2, phase 2, maquettes
 * `offre/AccueilMobile` et `offre/AccueilDesktop`) : la promesse et le champ
 * de code dans un panneau violet, le choix de la classe, le chapitre en
 * quatre etapes, l'encart des professeurs, puis « Et aussi ». Une colonne
 * sur mobile ; a partir de 960 px, la mise en page de la maquette ordinateur.
 */

.home {
  display: flex;
  flex-direction: column;
}

.home > .home-main {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  box-sizing: border-box;
  width: 100%;
  max-width: var(--content-max-width);
  margin-inline: auto;
  padding: var(--sp-2) var(--content-gutter) 0;
  /* Interligne des maquettes : celui de la police */
  line-height: normal;
}

/* Le pied de page suit « Et aussi » de pres (maquettes) */
.home > .site-foot {
  margin-top: var(--sp-1);
}

/* --- Titres de section ----------------------------------------------------- */
.home-section {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.home-section__head {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.home-section__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.75rem;
  line-height: 1;
}

.home-section__lead {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9375rem;
}

/* --- Promesse : panneau violet (degrade autorise, maquette offre/Accueil*) -- */
.home-hero {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--space-6) 18px 18px;
  border-radius: var(--r-2xl);
  background: linear-gradient(150deg, var(--violet), var(--hero-deep));
  box-shadow: var(--hero-hi), 0 var(--edge-lg) 0 var(--hero-edge);
  color: var(--on-accent);
}

.home-hero__row,
.home-hero__copy {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.home-hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  line-height: 1;
}

.home-hero__accent {
  color: var(--hero-accent);
}

.home-hero__lead {
  margin: 0;
  color: var(--on-violet-text);
  font-weight: 700;
  font-size: var(--fs-body);
  line-height: 1.4;
}

.home-hero__actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.home-hero__cta {
  min-height: 62px;
  padding: 0 var(--space-8);
  font-size: var(--fs-button);
}

.home-hero__perks {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--on-violet-text);
  font-weight: 800;
  font-size: 0.8125rem;
}

.home-hero__perks .site-icon {
  width: 16px;
  height: 16px;
}

.home-hero__perks li {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* « Sur mobile et ordinateur » : sur ordinateur seulement, comme la maquette */
.home-hero__perks .home-hero__perk--wide,
.home-preview {
  display: none;
}

/* --- Champ « Ton prof t'a donne un code ? » --------------------------------- */
.home-code {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: var(--sp-3);
  border: 2px solid var(--on-violet-line);
  border-radius: var(--r-lg);
  background: var(--hero-well);
}

.home-code__copy {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.home-code__label {
  color: var(--on-accent);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-body);
}

.home-code__hint {
  color: var(--on-violet-muted);
  font-weight: 800;
  font-size: var(--fs-tiny);
}

/* Sur mobile, le bouton mord sur la marge interieure du cadre (la maquette
   deborde du cadre : les six cases et REJOINDRE n'y tiennent pas). */
.home-code__entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-right: calc(-1 * var(--sp-2));
}

.home-code .code-entry__boxes > span {
  color: var(--text);
}

.home-code__submit {
  --button-edge-size: var(--edge-sm);
  --button-hi: var(--relief-none);
  min-height: 40px;
  padding: 0 var(--sp-3);
  border-radius: var(--r-sm);
  font-size: var(--fs-small);
  letter-spacing: 0;
}

.home-code__error {
  margin: 0;
}

.home-code__error:empty {
  display: none;
}

/* --- Choisis ta classe : grille commune `.class-grid` (components.css) ---- */
/* Sur l'accueil, des tuiles plus basses, la filiere sans sa voie en toutes lettres. */
#classes .filiere {
  justify-content: center;
  min-height: 72px;
}

#classes .class-grid__seconde {
  height: 80px;
}

/* --- Professeurs (vouvoiement) : aplat sombre dans les deux themes --------- */
.home-profs {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: var(--sp-5);
  border: 2px solid var(--profs-accent);
  border-radius: 28px;
  background: var(--profs-bg);
  color: var(--on-accent);
}

.home-profs__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.home-profs__chip {
  display: flex;
  align-items: center;
  height: 28px;
  margin: 0;
  padding: 0 var(--sp-3);
  border-radius: var(--r-pill);
  background: var(--profs-accent);
  color: var(--profs-bg);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.home-profs__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.625rem;
  line-height: 1.05;
}

.home-profs__list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-profs__list li {
  display: flex;
  flex: 1;
  align-items: flex-start;
  gap: var(--sp-3);
}

.home-profs__icon {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  background: var(--on-violet-soft);
}

.home-profs__icon .site-icon {
  width: 22px;
  height: 22px;
}

.home-more__card .site-icon {
  width: 34px;
  height: 34px;
}

.home-profs__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--on-violet-muted);
  font-weight: 700;
  font-size: var(--fs-small);
  line-height: 1.35;
}

.home-profs__text strong {
  color: var(--on-accent);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.125rem;
  line-height: 1.1;
}

.home-profs__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
}

.home-profs__more {
  --button-edge-size: 0px;
  --button-hi: var(--relief-none);
  padding: 0 22px;
  border: 2px solid var(--on-violet-line-strong);
  border-radius: var(--r-md);
  background: transparent;
  color: var(--on-accent);
  font-size: var(--fs-body);
}

/* --- Et aussi ---------------------------------------------------------------- */
.home-more__cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
}

.home-more__card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  min-height: 140px;
  padding: var(--sp-4);
  border-radius: var(--r-xl);
  text-decoration: none;
}

/* Violet (apprendre) : le jaune reste au defi du jour, seul aplat flamme. */
.home-more__card--french {
  background: var(--violet);
  box-shadow: var(--relief-hi), 0 var(--edge-md) 0 var(--violet-edge);
  color: var(--on-accent);
}

.home-more__card--exams {
  background: var(--soft);
  box-shadow: 0 var(--edge-md) 0 var(--surface);
  color: var(--text);
}

.home-more__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--sp-1);
}

.home-more__card .home-more__text {
  flex: 0 0 auto;
}

.home-more__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3125rem;
  line-height: 1;
}

.home-more__sub {
  font-weight: 800;
  font-size: 0.8125rem;
}

.home-more__card--exams .home-more__sub {
  color: var(--muted);
}

/* Defi du jour : aplat flamme (defier), mis en avant en tete de « Et aussi ». */
.home-daily {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-5);
  border-radius: var(--r-xl);
  background: var(--flame);
  box-shadow: var(--relief-hi), 0 var(--edge-lg) 0 var(--flame-edge);
  /* Le relief deborde sous la carte : l'ecart aux cartes suivantes le compte. */
  margin-bottom: var(--edge-lg);
  color: var(--on-flame);
  text-decoration: none;
}

.home-daily__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: var(--r-md);
  background: var(--on-flame);
}

.home-daily__icon .site-icon {
  width: 40px;
  height: 40px;
}

.home-daily__text {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  min-width: 0;
}

.home-daily__kicker {
  font-weight: 900;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Meme titre que la carte Battle School voisine. */
.home-daily__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1.05;
}

.home-daily__sub {
  font-weight: 700;
  font-size: var(--fs-small);
  line-height: 1.35;
}

.home-daily__play {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  border-radius: var(--r-md);
  background: var(--on-flame);
  box-shadow: 0 var(--edge-sm) 0 var(--flame-edge);
  color: var(--flame);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.375rem;
  letter-spacing: 0.04em;
}

/* Battle School : carte sombre au halo bordeaux, comme sur
   college-en-ligne.fr (logo, surtitre, titre, texte, bouton rouge). */
.home-battle {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  padding: var(--sp-5);
  border: 2px solid var(--battle-edge);
  border-radius: var(--r-xl);
  background: radial-gradient(120% 90% at 0% 0%, var(--battle-glow) 0%, var(--battle-deep) 70%);
  color: var(--on-battle);
}

.home-battle__brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.home-battle__logo {
  flex: none;
  width: 72px;
  height: auto;
}

.home-battle__kicker {
  margin: 0 0 var(--sp-1);
  color: var(--on-battle-soft);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.home-battle__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.05;
}

.home-battle__text {
  margin: 0;
  color: var(--on-battle-soft);
  font-weight: 700;
}

.home-battle__action {
  --button-edge: var(--battle-edge);
  --button-hi: var(--relief-hi-soft);
  margin-top: auto;
  background: var(--battle);
  color: var(--on-battle);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* --- Ordinateur --------------------------------------------------------------- */
@media (min-width: 960px) {
  .home > .home-main {
    gap: var(--sp-6);
    padding: var(--sp-4) var(--content-gutter) var(--space-8);
  }

  .home-section__title {
    font-size: 2.25rem;
  }

  .home-section__lead {
    font-size: 1.0625rem;
  }

  .home-hero {
    gap: var(--space-6);
    padding: 44px 48px var(--space-6);
  }

  .home-hero__row {
    flex-direction: row;
    align-items: center;
    gap: 48px;
  }

  .home-hero__copy {
    flex: 1;
    gap: 22px;
  }

  .home-hero__title {
    font-size: 3.5rem;
  }

  .home-hero__lead {
    font-size: 1.25rem;
  }

  .home-hero__actions {
    flex-direction: row;
    align-items: center;
    gap: var(--sp-5);
  }

  .home-hero__cta {
    flex-shrink: 0;
    min-height: 66px;
    white-space: nowrap;
  }

  .home-hero__perks .home-hero__perk--wide {
    display: flex;
  }

  /* Apercu du chapitre d'exemple, decoratif ; ombre floue de la maquette */
  .home-preview {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    gap: var(--sp-2);
    /* 360 px de contenu, plus marges et bordure (maquette) */
    width: 396px;
    padding: var(--sp-4);
    border: 2px solid var(--preview-line);
    border-radius: var(--r-xl);
    background: var(--bg);
    box-shadow: var(--preview-shadow);
    color: var(--text);
    transform: rotate(1.5deg);
  }

  .home-preview__kicker {
    color: var(--muted);
    font-weight: 800;
    font-size: var(--fs-tiny);
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .home-preview__title {
    margin-bottom: var(--sp-1);
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.625rem;
    line-height: 1;
  }

  .home-preview__steps {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .home-preview__step {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: 10px var(--sp-3);
    border-radius: 16px;
    background: var(--surface);
  }

  .home-preview .step-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .home-preview .step-icon .site-icon {
    width: 20px;
    height: 20px;
  }

  .home-preview__text {
    display: flex;
    flex-direction: column;
  }

  .home-preview__name {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: var(--fs-body);
    line-height: 1.1;
  }

  .home-preview__sub {
    color: var(--muted);
    font-weight: 800;
    font-size: var(--fs-tiny);
  }

  .home-code {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 14px var(--sp-4);
    flex-wrap: wrap;
  }

  .home-code__copy {
    flex: 1;
  }

  .home-code__label {
    font-size: 1.125rem;
  }

  .home-code__entry {
    gap: var(--sp-2);
    margin-right: 0;
  }

  .home-code__submit {
    min-height: 50px;
    padding: 0 18px;
    font-size: var(--fs-body);
  }

  .home-code__error {
    flex-basis: 100%;
  }

  #classes .filiere {
    min-height: 92px;
  }

  #classes .class-grid__seconde {
    justify-content: space-between;
    height: auto;
    min-height: 0;
  }

  .home-profs {
    padding: var(--space-8);
  }

  .home-profs__title {
    font-size: 2.25rem;
  }

  .home-profs__list {
    flex-direction: row;
    gap: var(--sp-6);
  }

  .home-profs__actions {
    flex-direction: row;
  }

  .home-profs__create {
    padding: 0 var(--sp-6);
  }

  .home-more {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-4);
  }

  /* Defi du jour et Battle School cote a cote : bouton sous le texte. */
  .home-daily {
    gap: var(--sp-5);
    padding: var(--sp-6);
  }

  .home-daily__icon {
    width: 88px;
    height: 88px;
    border-radius: var(--r-lg);
  }

  .home-daily__icon .site-icon {
    width: 52px;
    height: 52px;
  }

  .home-daily__sub { font-size: var(--fs-body); }

  .home-daily__play {
    height: 64px;
    font-size: 1.5rem;
  }

  .home-battle { margin-bottom: 0; }

  .home-more__cards {
    display: contents;
  }

  .home-more__card {
    min-height: 170px;
  }

  .home-more__name {
    font-size: 1.625rem;
  }
}

/* --- Reprendre (eleve qui revient) ------------------------------------------- */
/* Ajoutee par js/course-shortcuts.js quand un chapitre est commence. */
.home-resume {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-5);
  border: 2px solid var(--sel-border);
  border-radius: var(--radius-2xl);
  background: var(--sel-bg);
  color: var(--sel-text);
}

.home-resume[hidden] {
  display: none;
}

.home-resume__copy {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  min-width: 0;
}

.home-resume__eyebrow {
  margin: 0;
  font-weight: 800;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-resume__title {
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.75rem;
  line-height: 1.05;
}

.home-resume__chapter {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
}

.home-resume__chapter .subject-tile {
  border-bottom: var(--relief) solid var(--subject-edge);
}

.home-resume__chapter-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.home-resume__subject {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.8125rem;
}

.home-resume__name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.1;
}

.home-resume__progress {
  height: 8px;
}

.home-resume__actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.home-resume__continue {
  min-height: 64px;
  font-size: 1.375rem;
}

@media (min-width: 960px) {
  /* Sur ordinateur, les blocs de l'accueil n'ont pas d'espacement commun */
  .home-resume {
    margin-bottom: var(--space-6);
    flex-direction: row;
    align-items: center;
    padding: var(--space-6);
  }

  .home-resume__copy {
    flex: 1;
  }

  .home-resume__title {
    font-size: 2.5rem;
  }

  .home-resume__actions {
    flex: 0 0 260px;
  }
}
