/* ============================================================
   TITIRAINA — feuille de style principale
   Palette (cahier des charges) : dégradé rose, mauve, bleu
   Police : Arial (cahier des charges)
   ============================================================ */

:root {
  --rose: #f27fb2;
  --mauve: #a678d8;
  --bleu: #5a7bd8;
  --rose-pale: #fdeaf3;
  --mauve-pale: #f1e9fa;
  --bleu-pale: #e6edfb;
  --encre: #2b2440;
  --encre-douce: #5c5470;
  --blanc: #ffffff;
  --or-vip: #f5b301;
  --ok: #2e9e5b;
  --attention: #d95d39;
  --rayon: 14px;
  --ombre: 0 6px 24px rgba(43, 36, 64, 0.12);
  --degrade: linear-gradient(120deg, var(--rose) 0%, var(--mauve) 50%, var(--bleu) 100%);
  --degrade-doux: linear-gradient(160deg, var(--rose-pale) 0%, var(--mauve-pale) 45%, var(--bleu-pale) 100%);
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--encre);
  background: var(--degrade-doux);
  min-height: 100vh;
  line-height: 1.55;
}

img, svg { max-width: 100%; display: block; }

a { color: var(--bleu); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--bleu);
  outline-offset: 2px;
}

.conteneur {
  width: min(1120px, 100% - 2rem);
  margin-inline: auto;
}

/* ---------- En-tête ---------- */
.entete {
  background: var(--blanc);
  box-shadow: 0 2px 12px rgba(43, 36, 64, 0.08);
  position: sticky;
  top: 0;
  z-index: 50;
}

.entete-barre {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 0;
  flex-wrap: wrap;
}

/* Bouton « Par ici » (menu déroulant, symbole livres) */
.menu-bouton {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 2px solid var(--mauve);
  background: var(--blanc);
  color: var(--encre);
  font: inherit;
  font-weight: bold;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
}
.menu-bouton:hover { background: var(--mauve-pale); }
.menu-bouton svg { width: 26px; height: 26px; }

.marque {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--encre);
}
.marque svg, .marque img { width: 40px; height: 40px; }
.marque-nom {
  font-size: 1.45rem;
  font-weight: bold;
  letter-spacing: 0.06em;
  background: var(--degrade);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.entete-droite {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

/* Barre de recherche */
.recherche {
  display: flex;
  align-items: center;
  background: var(--bleu-pale);
  border-radius: 999px;
  padding: 0.2rem 0.2rem 0.2rem 0.9rem;
  min-width: 240px;
}
.recherche input {
  border: none;
  background: transparent;
  font: inherit;
  padding: 0.35rem 0.3rem;
  width: 100%;
  color: var(--encre);
}
.recherche input:focus { outline: none; }
.recherche button {
  border: none;
  background: var(--bleu);
  color: var(--blanc);
  border-radius: 999px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: none;
}

.lien-avance {
  display: block;
  font-size: 0.82rem;
  text-align: right;
  margin-top: 0.2rem;
  color: var(--mauve);
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
}

/* Icône connexion (comme FUN MOOC : silhouette) */
.connexion-lien {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  text-decoration: none;
  color: var(--encre);
  font-size: 0.75rem;
}
.connexion-lien svg { width: 30px; height: 30px; }
.connexion-lien:hover { color: var(--bleu); }

/* Menu déroulant */
.menu-panneau {
  position: absolute;
  top: calc(100% + 4px);
  left: max(1rem, calc((100% - 1120px) / 2));
  background: var(--blanc);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 0.6rem;
  min-width: 260px;
  display: none;
  z-index: 60;
}
.menu-panneau.ouvert { display: block; }
.menu-panneau a {
  display: block;
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--encre);
  font-weight: bold;
}
.menu-panneau a small {
  display: block;
  font-weight: normal;
  color: var(--encre-douce);
  font-size: 0.78rem;
}
.menu-panneau a:hover { background: var(--mauve-pale); }

/* Recherche avancée */
.avance-panneau {
  background: var(--blanc);
  border-top: 1px solid var(--mauve-pale);
  display: none;
  padding: 0.9rem 0;
}
.avance-panneau.ouvert { display: block; }
.avance-grille {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8rem;
  align-items: end;
}
.avance-grille label {
  font-size: 0.8rem;
  font-weight: bold;
  display: block;
  margin-bottom: 0.25rem;
}
.avance-grille select, .avance-grille input {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid #d8d2e6;
  border-radius: 8px;
  font: inherit;
  background: var(--blanc);
}

/* ---------- Boutons ---------- */
.bouton {
  display: inline-block;
  background: var(--degrade);
  color: var(--blanc);
  border: none;
  font: inherit;
  font-weight: bold;
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.bouton:hover { filter: brightness(1.06); }
.bouton-secondaire {
  background: var(--blanc);
  color: var(--mauve);
  border: 2px solid var(--mauve);
}

/* ---------- Héro (image principale) ---------- */
.hero {
  padding-top: 1.2rem; /* petite marge demandée au-dessus de l'image */
}
.hero-cadre {
  border-radius: var(--rayon);
  overflow: hidden;
  box-shadow: var(--ombre);
}
.hero-cadre svg { width: 100%; height: auto; }

/* Accroche */
.accroche {
  text-align: center;
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-style: italic;
  font-size: clamp(1.5rem, 3.5vw, 2.3rem);
  margin: 1.6rem 0 0.4rem;
}
.accroche em {
  font-style: italic;
  background: var(--degrade);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sous-accroche {
  text-align: center;
  color: var(--encre-douce);
  margin-bottom: 1.6rem;
}

/* ---------- Banderole VIP ---------- */
.vip-bande {
  background: var(--degrade);
  border-radius: var(--rayon);
  padding: 1.1rem 1.2rem 1.3rem;
  color: var(--blanc);
  box-shadow: var(--ombre);
}
.vip-titre {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
  letter-spacing: 0.12em;
  margin-bottom: 0.9rem;
}
.vip-titre svg { width: 22px; height: 22px; flex: none; }
.vip-defile {
  display: flex;
  gap: 0.9rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  scrollbar-width: thin;
}
.vip-carte {
  flex: 0 0 150px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--encre);
  border-radius: 12px;
  padding: 0.8rem 0.7rem;
  text-align: center;
  text-decoration: none;
  border-top: 4px solid var(--or-vip);
}
.vip-carte:hover { transform: translateY(-3px); transition: transform 0.15s; }
.vip-carte .avatar { width: 64px; height: 64px; margin: 0 auto 0.5rem; }
.vip-carte strong { display: block; font-size: 0.9rem; }
.vip-carte span { font-size: 0.78rem; color: var(--encre-douce); }

/* ---------- Cartes profils ---------- */
.section-titre {
  font-size: 1.35rem;
  margin: 2.2rem 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.section-titre::after {
  content: "";
  flex: 1;
  height: 3px;
  border-radius: 3px;
  background: var(--degrade);
  opacity: 0.35;
}

.grille-profils {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.carte-prof {
  background: var(--blanc);
  border-radius: var(--rayon);
  padding: 1.1rem;
  box-shadow: var(--ombre);
  text-decoration: none;
  color: var(--encre);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  position: relative;
}
.carte-prof:hover { transform: translateY(-3px); transition: transform 0.15s; }
.carte-prof .avatar { width: 70px; height: 70px; }
.carte-prof h3 { font-size: 1.05rem; }
.carte-prof .matieres { font-weight: bold; color: var(--mauve); font-size: 0.9rem; }
.carte-prof .infos { font-size: 0.84rem; color: var(--encre-douce); }
.badge-vip {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  background: var(--or-vip);
  color: var(--encre);
  font-size: 0.7rem;
  font-weight: bold;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  letter-spacing: 0.08em;
}
.badge-exemple {
  display: inline-block;
  background: var(--bleu-pale);
  color: var(--bleu);
  font-size: 0.7rem;
  font-weight: bold;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  width: fit-content;
}

.avatar {
  border-radius: 50%;
  background: var(--degrade-doux);
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid var(--blanc);
  box-shadow: 0 2px 8px rgba(43, 36, 64, 0.15);
}
.avatar svg { width: 60%; height: 60%; }

/* ---------- Sections page ---------- */
.page-principale { padding-bottom: 3.5rem; }
.bloc {
  background: var(--blanc);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 1.6rem;
}
.bloc + .bloc { margin-top: 1.2rem; }

.entete-page {
  padding: 2.2rem 0 0.5rem;
}
.entete-page h1 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); }
.entete-page p { color: var(--encre-douce); max-width: 60ch; margin-top: 0.4rem; }

/* ---------- Filtres annuaire ---------- */
.filtres {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.8rem;
  background: var(--blanc);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 1rem;
  margin-bottom: 1.4rem;
}
.filtres label { font-size: 0.8rem; font-weight: bold; display: block; margin-bottom: 0.25rem; }
.filtres select, .filtres input {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid #d8d2e6;
  border-radius: 8px;
  font: inherit;
  background: var(--blanc);
}
.compteur-resultats { color: var(--encre-douce); font-size: 0.9rem; margin-bottom: 0.8rem; }

/* ---------- Tableau des cours ---------- */
.table-conteneur { overflow-x: auto; }
table.cours {
  width: 100%;
  border-collapse: collapse;
  background: var(--blanc);
  border-radius: var(--rayon);
  overflow: hidden;
  box-shadow: var(--ombre);
}
table.cours th {
  background: var(--degrade);
  color: var(--blanc);
  text-align: left;
  padding: 0.7rem 0.9rem;
  font-size: 0.9rem;
}
table.cours td {
  padding: 0.65rem 0.9rem;
  border-top: 1px solid var(--mauve-pale);
  font-size: 0.92rem;
}
table.cours tr:hover td { background: var(--rose-pale); }
table.cours a { font-weight: bold; }

/* ---------- Formulaires (fenêtres blanches sur fond dégradé) ---------- */
.formulaire {
  background: var(--blanc);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 1.8rem;
  max-width: 780px;
  margin-inline: auto;
}
.champ { margin-bottom: 1.1rem; }
.champ label {
  display: block;
  font-weight: bold;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}
.champ .aide-champ {
  font-weight: normal;
  color: var(--encre-douce);
  font-size: 0.8rem;
}
.champ input, .champ select, .champ textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid #d8d2e6;
  border-radius: 8px;
  font: inherit;
  background: var(--blanc);
  color: var(--encre);
}
.champ textarea { min-height: 110px; resize: vertical; }
.champ-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}
@media (max-width: 560px) { .champ-duo { grid-template-columns: 1fr; } }

fieldset.groupe {
  border: 1px solid var(--mauve-pale);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1.1rem;
}
fieldset.groupe legend {
  font-weight: bold;
  color: var(--mauve);
  padding: 0 0.4rem;
  font-size: 0.95rem;
}

.note-info {
  background: var(--bleu-pale);
  border-left: 4px solid var(--bleu);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  font-size: 0.88rem;
  margin: 1rem 0;
}
.note-securite {
  background: var(--rose-pale);
  border-left: 4px solid var(--rose);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  font-size: 0.88rem;
  margin: 1rem 0;
}

/* ---------- Page profil ---------- */
.profil-entete {
  display: flex;
  gap: 1.4rem;
  align-items: center;
  flex-wrap: wrap;
}
.profil-entete .avatar { width: 110px; height: 110px; flex: none; }
.profil-entete h1 { font-size: 1.6rem; }
.etiquettes { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.4rem; }
.etiquette {
  background: var(--mauve-pale);
  color: var(--mauve);
  font-size: 0.78rem;
  font-weight: bold;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.profil-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.4rem;
}
.detail-carte {
  background: var(--degrade-doux);
  border-radius: 10px;
  padding: 0.9rem 1rem;
}
.detail-carte h3 {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--encre-douce);
  margin-bottom: 0.3rem;
}

.coordonnees-masquees {
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
}

.statut-abonnement { font-weight: bold; }
.statut-abonnement.regle { color: var(--ok); }
.statut-abonnement.echeance { color: var(--attention); }

/* ---------- Pied de page ---------- */
.pied {
  background: var(--encre);
  color: #cfc9de;
  margin-top: 3rem;
  padding: 2.2rem 0 1.4rem;
  font-size: 0.88rem;
}
.pied-grille {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.4rem;
}
.pied h3 { color: var(--blanc); font-size: 0.95rem; margin-bottom: 0.6rem; }
.pied a { color: #cfc9de; text-decoration: none; display: block; padding: 0.15rem 0; }
.pied a:hover { color: var(--blanc); text-decoration: underline; }
.pied-bas {
  border-top: 1px solid #453c60;
  margin-top: 1.6rem;
  padding-top: 1rem;
  text-align: center;
  font-size: 0.8rem;
}

/* ---------- Divers ---------- */
.centre { text-align: center; }
.masque { display: none !important; }
.texte-doux { color: var(--encre-douce); }
.marge-haut { margin-top: 1.2rem; }

@media (max-width: 760px) {
  .entete-barre { gap: 0.6rem; }
  .recherche { min-width: 150px; flex: 1; }
  .entete-droite { width: 100%; justify-content: flex-end; }
}
