/* Portail Famille Rizzo — feuille de style commune
   Tokens issus de la maquette (canevas « Rizzo — portail de la famille »). */

@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&display=swap");

:root {
  /* Couleurs de base */
  --fond: #F6F6F4;
  --surface: #FFFFFF;
  --surface-douce: #FAFAF9;
  --survol: #F1F1EF;
  --encre: #18181B;
  --texte-2: #3F4150;
  --texte-3: #5F6170;
  --bordure: #E4E4E7;
  --bordure-forte: #D4D4D8;
  --pointilles: #A1A1AA;

  /* Couleur principale (personnalisable depuis l'admin) */
  --primaire: #2F5BD3;
  --primaire-fonce: #1E3F9E;
  --primaire-pale: #E8EEFC;
  --sur-primaire: #FFFFFF;

  /* Accent (badges, pastilles non lues) */
  --accent: #F2785A;
  --sur-accent: #18181B;

  /* Teintes pâles (vignettes, avatars) : fond / texte */
  --t-bleu: #E8EEFC;   --t-bleu-txt: #1E3F9E;
  --t-corail: #FDE6DF; --t-corail-txt: #8A2E17;
  --t-vert: #E3F4EC;   --t-vert-txt: #1F5F43;
  --t-jaune: #FBF1D6;  --t-jaune-txt: #7A5A0E;
  --t-violet: #EEE8FB; --t-violet-txt: #4A2FC7;

  /* Typo */
  --f-titre: "Space Grotesk", system-ui, sans-serif;
  --f-texte: "Inter", system-ui, sans-serif;

  /* Rayons */
  --r-s: 10px; --r-m: 12px; --r-l: 16px; --r-xl: 18px; --r-2xl: 20px;

  --largeur: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--f-texte); color: var(--encre); background: var(--fond); line-height: 1.5; }
h1, h2, h3 { font-family: var(--f-titre); margin: 0; letter-spacing: -0.02em; line-height: 1.1; }
p { margin: 0; }
a { color: var(--primaire); }
a:hover { color: var(--primaire-fonce); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--encre); outline-offset: 3px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--primaire); outline-offset: 1px; }
img { max-width: 100%; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--texte-3); }

/* ---------- Marque ---------- */
.marque { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.marque__logo { width: 38px; height: 38px; border-radius: 9px; object-fit: contain; }
.marque__logo--vide { border: 1.5px dashed var(--pointilles); background: var(--surface); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; color: var(--texte-3); }
.marque__nom { font-family: var(--f-titre); font-weight: 600; font-size: 20px; letter-spacing: -0.02em; }
.marque--grande .marque__logo { width: 46px; height: 46px; border-radius: 11px; }
.marque--grande .marque__nom { font-size: 24px; }

/* ---------- Boutons ---------- */
.btn { min-height: 44px; padding: 0 18px; border-radius: var(--r-m); border: 1px solid transparent; font: 600 15px/1 var(--f-texte); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn--primaire { background: var(--primaire); color: var(--sur-primaire); }
.btn--primaire:hover { background: var(--primaire-fonce); color: var(--sur-primaire); }
.btn--secondaire { background: var(--surface); color: var(--encre); border-color: var(--bordure-forte); font-weight: 500; }
.btn--secondaire:hover { background: var(--survol); color: var(--encre); }
.btn--grand { min-height: 50px; font-size: 16px; }
.btn--icone { width: 44px; padding: 0; }
.btn svg { flex-shrink: 0; }

/* ---------- Champs ---------- */
.champ { display: flex; flex-direction: column; gap: 8px; }
.champ label { font-weight: 500; font-size: 14px; color: var(--texte-2); }
.input { height: 48px; width: 100%; border: 1px solid var(--bordure-forte); border-radius: var(--r-m); padding: 0 14px; font: 16px var(--f-texte); color: var(--encre); background: var(--surface); }
.input--compact { height: 44px; font-size: 15px; }

/* ---------- Badges & avatars ---------- */
.badge { height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; }
.badge--accent { background: var(--accent); color: var(--sur-accent); }
.badge--neutre { background: var(--survol); color: var(--texte-2); }
.pastille { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--sur-accent); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; flex-shrink: 0; }
.avatar--l { width: 44px; height: 44px; font-size: 16px; }
.t-bleu { background: var(--t-bleu); color: var(--t-bleu-txt); }
.t-corail { background: var(--t-corail); color: var(--t-corail-txt); }
.t-vert { background: var(--t-vert); color: var(--t-vert-txt); }
.t-jaune { background: var(--t-jaune); color: var(--t-jaune-txt); }
.t-violet { background: var(--t-violet); color: var(--t-violet-txt); }

/* ---------- Cartes ---------- */
.carte { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--r-xl); }

/* ---------- En-tête du portail ---------- */
.entete { background: var(--surface); border-bottom: 1px solid var(--bordure); }
.entete__inner { max-width: var(--largeur); margin: 0 auto; padding: 14px 32px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.entete__gauche { display: flex; align-items: center; gap: 36px; flex-wrap: wrap; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; }
.nav a { min-height: 44px; padding: 0 14px; border-radius: var(--r-s); color: var(--texte-2); font-weight: 500; font-size: 15px; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.nav a:hover { background: var(--survol); color: var(--encre); }
.nav a[aria-current="page"] { background: var(--survol); color: var(--encre); font-weight: 600; }
.utilisateur { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.utilisateur__nom { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 15px; color: var(--texte-2); }

.page { max-width: var(--largeur); margin: 0 auto; padding: 48px 32px 72px; display: flex; flex-direction: column; gap: 56px; }
.titre-section { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.titre-section h2 { font-weight: 600; font-size: 26px; }
.titre-section a { font-weight: 600; font-size: 15px; text-decoration: none; }
.pied { text-align: center; font-size: 14px; color: var(--texte-3); }

/* ---------- Connexion ---------- */
.connexion { min-height: 100vh; display: flex; flex-wrap: wrap; }
.connexion__intro { flex: 1 1 460px; min-width: 0; padding: 56px 64px; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; }
.connexion__intro h1 { font-weight: 700; font-size: clamp(40px, 5vw, 60px); line-height: 1.02; letter-spacing: -0.03em; }
.connexion__accroche { max-width: 520px; display: flex; flex-direction: column; gap: 20px; }
.connexion__accroche p { font-size: 18px; line-height: 1.6; color: var(--texte-3); }
.etiquettes { display: flex; flex-wrap: wrap; gap: 10px; }
.etiquettes span { height: 34px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 600; display: flex; align-items: center; }
.connexion__form-zone { flex: 1 1 460px; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 56px 32px; }
.connexion__form { width: 100%; max-width: 420px; padding: 40px; border-radius: var(--r-2xl); display: flex; flex-direction: column; gap: 22px; }
.connexion__form h2 { font-weight: 600; font-size: 30px; }
.erreur { background: var(--t-corail); color: var(--t-corail-txt); border-radius: var(--r-m); padding: 12px 14px; font-size: 14px; font-weight: 500; }
.separateur { height: 1px; background: var(--bordure); }
@media (max-width: 600px) { .connexion__intro { padding: 32px 24px; gap: 32px; } .connexion__form { padding: 28px 22px; } }

/* ---------- Accueil ---------- */
.accueil-hero h1 { font-weight: 700; font-size: clamp(36px, 5vw, 52px); letter-spacing: -0.03em; }
.accueil-hero p { margin-top: 12px; font-size: 18px; color: var(--texte-3); }
.deux-colonnes { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.col-principale { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.col-laterale { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }

.nouvelle { overflow: hidden; display: flex; flex-direction: column; }
.nouvelle__image { height: 240px; background: var(--t-bleu); object-fit: cover; width: 100%; }
.nouvelle__corps { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 10px; }
.nouvelle__meta { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.nouvelle__meta strong { font-weight: 600; }
.nouvelle__meta .badge { margin-left: auto; }
.nouvelle h3 { font-weight: 600; font-size: 20px; }
.nouvelle--une h3 { font-size: 24px; }
.nouvelle__extrait { font-size: 15px; line-height: 1.6; color: var(--texte-2); }

.mini-chat { padding: 18px; border-radius: var(--r-l); display: flex; flex-direction: column; gap: 14px; }
.mini-chat__msg { display: flex; gap: 10px; align-items: flex-start; }
.mini-chat__msg > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mini-chat__bulle { background: var(--survol); border-radius: 4px 14px 14px 14px; padding: 9px 12px; font-size: 15px; line-height: 1.45; }
.ligne-envoi { display: flex; gap: 8px; }
.ligne-envoi .input { flex: 1 1 auto; min-width: 0; }

.rubrique { padding: 18px; border-radius: var(--r-l); text-decoration: none; color: var(--encre); display: flex; align-items: center; gap: 14px; }
.rubrique:hover { border-color: var(--bordure-forte); color: var(--encre); }
.rubrique__icone { width: 48px; height: 48px; border-radius: var(--r-m); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rubrique__texte { display: flex; flex-direction: column; gap: 2px; }
.rubrique__texte strong { font-weight: 600; font-size: 16px; }
.rubrique__texte span { font-size: 14px; color: var(--texte-3); }

.grille-jeux { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.jeu { border-radius: var(--r-l); overflow: hidden; display: flex; flex-direction: column; }
.jeu__vignette { height: 120px; display: flex; align-items: center; justify-content: center; }
.jeu__vignette img { width: 100%; height: 100%; object-fit: cover; }
.jeu__corps { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex-grow: 1; }
.jeu__corps h3 { font-weight: 600; font-size: 18px; }
.jeu__corps p { font-size: 14px; color: var(--texte-3); flex-grow: 1; margin-bottom: 6px; }
.jeu .btn { align-self: flex-start; }

/* ---------- Discussion ---------- */
.discussion { min-height: 100vh; display: flex; flex-direction: column; }
.discussion__main { flex-grow: 1; width: 100%; max-width: var(--largeur); margin: 0 auto; padding: 28px 32px; display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch; }
.conversations { flex: 1 1 280px; min-width: 0; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.conversations__tete { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 12px; }
.conversations__tete h1 { font-weight: 600; font-size: 22px; }
.conversation { padding: 12px; border-radius: var(--r-m); text-decoration: none; color: var(--encre); display: flex; align-items: center; gap: 12px; }
.conversation:hover { background: var(--survol); color: var(--encre); }
.conversation[aria-current="true"] { background: var(--primaire-pale); }
.conversation__texte { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex-grow: 1; }
.conversation__texte strong { font-weight: 600; font-size: 15px; }
.conversation__texte span { font-size: 14px; color: var(--texte-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.groupe-icone { width: 44px; height: 44px; border-radius: var(--r-m); background: var(--primaire); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.fil { flex: 999 1 560px; min-width: 0; min-height: 70vh; display: flex; flex-direction: column; overflow: hidden; }
.fil__tete { padding: 16px 22px; border-bottom: 1px solid var(--bordure); display: flex; align-items: center; gap: 12px; }
.fil__tete h2 { font-weight: 600; font-size: 19px; }
.fil__messages { flex-grow: 1; overflow-y: auto; padding: 24px 22px; display: flex; flex-direction: column; gap: 18px; background: var(--surface-douce); }
.jour { align-self: center; font-size: 12px; font-weight: 600; color: var(--texte-3); background: var(--survol); border-radius: 999px; padding: 5px 12px; }
.msg { display: flex; gap: 10px; align-items: flex-end; max-width: 70%; }
.msg__contenu { display: flex; flex-direction: column; gap: 4px; }
.msg__meta { font-size: 13px; color: var(--texte-3); }
.msg__meta strong { color: var(--encre); font-weight: 600; }
.msg__bulle { background: var(--surface); border: 1px solid var(--bordure); border-radius: 16px 16px 16px 4px; padding: 10px 14px; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.msg__photo { width: 220px; max-width: 100%; border-radius: 14px; }
.msg--moi { align-self: flex-end; flex-direction: column; align-items: flex-end; gap: 4px; }
.msg--moi .msg__bulle { background: var(--primaire); color: var(--sur-primaire); border-color: var(--primaire); border-radius: 16px 16px 4px 16px; }
.composeur { padding: 14px 16px; border-top: 1px solid var(--bordure); display: flex; gap: 10px; align-items: center; }
.composeur .input { flex: 1 1 auto; min-width: 0; }
@media (max-width: 700px) { .msg { max-width: 88%; } .discussion__main { padding: 16px; } }

/* ---------- Administration ---------- */
.admin { min-height: 100vh; display: flex; flex-wrap: wrap; }
.admin__menu { flex: 1 1 260px; max-width: 100%; background: var(--surface); border-right: 1px solid var(--bordure); padding: 22px 16px; display: flex; flex-direction: column; gap: 22px; }
.admin__sous-titre { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--t-corail-txt); }
.admin__nav { display: flex; flex-direction: column; gap: 2px; }
.admin__nav a { min-height: 44px; padding: 0 12px; border-radius: var(--r-s); color: var(--texte-2); font-weight: 500; font-size: 15px; text-decoration: none; display: flex; align-items: center; gap: 12px; }
.admin__nav a:hover { background: var(--survol); color: var(--encre); }
.admin__nav a[aria-current="page"] { background: var(--primaire-pale); color: var(--primaire-fonce); font-weight: 600; }
.admin__retour { margin-top: auto; }
.admin__contenu { flex: 999 1 640px; min-width: 0; padding: 36px 40px 56px; display: flex; flex-direction: column; gap: 28px; }
.admin__tete { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.admin__tete h1 { font-weight: 700; font-size: 38px; letter-spacing: -0.03em; }
.admin__tete p { margin-top: 6px; font-size: 16px; color: var(--texte-3); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.stat { padding: 18px 20px; border-radius: var(--r-l); display: flex; flex-direction: column; gap: 6px; }
.stat span { font-size: 14px; color: var(--texte-3); }
.stat strong { font-family: var(--f-titre); font-weight: 700; font-size: 30px; }
.stat--alerte strong { color: var(--t-corail-txt); }
.tableau-zone { overflow: hidden; }
.tableau-zone__barre { padding: 16px 20px; border-bottom: 1px solid var(--bordure); display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.tableau-zone__barre .input { flex: 0 1 320px; min-width: 0; }
.defilement-x { overflow-x: auto; }
table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 15px; }
th { text-align: left; padding: 12px 20px; font-size: 13px; font-weight: 600; color: var(--texte-3); background: var(--surface-douce); border-bottom: 1px solid var(--bordure); }
td { padding: 14px 20px; border-bottom: 1px solid var(--survol); }
tr:last-child td { border-bottom: 0; }
.cellule-membre { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.role--admin { background: var(--t-corail); color: var(--t-corail-txt); }
.role--membre { background: var(--survol); color: var(--texte-2); }
.role--enfant { background: var(--t-bleu); color: var(--t-bleu-txt); }
.perso { padding: 24px; display: flex; flex-direction: column; gap: 22px; }
.perso__champs { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.perso__logo { display: flex; align-items: center; gap: 14px; }
.perso__logo .marque__logo { width: 72px; height: 72px; border-radius: var(--r-l); font-size: 12px; }
.nuancier { border: 0; margin: 0; padding: 0; }
.nuancier legend { font-size: 14px; font-weight: 500; color: var(--texte-2); padding: 0; margin-bottom: 10px; }
.nuancier__choix { display: flex; gap: 10px; }
.nuancier input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.nuancier label { width: 44px; height: 44px; border-radius: 50%; cursor: pointer; display: block; }
.nuancier input:checked + label { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--encre); }
.nuancier input:focus-visible + label { outline: 2px solid var(--encre); outline-offset: 6px; }
@media (max-width: 700px) { .admin__contenu { padding: 24px 16px 40px; } .admin__menu { border-right: 0; border-bottom: 1px solid var(--bordure); } }
