/* ===== little-pan : interface générale (inspirée de TB-ABDL-FR) ===== */
:root {
  --violet: #7034f4;
  --violet-fonce: #5a22d8;
  --violet-clair: #efe8ff;
  --fond: #f1f1f5;
  --carte: #ffffff;
  --texte: #23232b;
  --gris: #6b6b78;
  --gris-btn: #e6e6ec;
  --ligne: #e3e3ea;
  --rouge: #e5392f;
  --rouge-fond: #fde9e7;
  --vert: #15925a;
  --vert-fond: #e3f6ec;
  --rayon: 16px;
  --ombre: 0 6px 30px rgba(40, 20, 90, 0.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Nunito', system-ui, sans-serif;
  color: var(--texte);
  background: var(--fond);
  min-height: 100vh;
  display: flex; flex-direction: column;
}
body.app {
  /* Halo pastel + feuilles en fond, comme sur la capture */
  background:
    radial-gradient(900px 420px at 25% -5%, rgba(255, 196, 225, .55), transparent 70%),
    radial-gradient(800px 420px at 70% 0%, rgba(196, 210, 255, .55), transparent 70%),
    url("/static/feuilles.svg") left -60px bottom -40px / 360px no-repeat,
    url("/static/feuilles.svg") right -80px bottom -60px / 420px no-repeat,
    var(--fond);
  background-attachment: fixed;
}
a { color: var(--violet); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: 'Poppins', sans-serif; letter-spacing: -0.02em; margin: 0 0 .6em; }
img { max-width: 100%; }

/* ---------- Barre du haut ---------- */
.topbar { position: sticky; top: 0; z-index: 10; backdrop-filter: blur(10px); background: rgba(255,255,255,.55); }
.topbar-in { max-width: 1060px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; gap: 18px; }
.logo { display: flex; align-items: center; gap: 8px; color: var(--texte); font-family: 'Poppins'; font-weight: 600; letter-spacing: .06em; font-size: 15px; }
.logo:hover { text-decoration: none; }
.topnav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.topnav a { color: var(--gris); padding: 7px 12px; border-radius: 999px; font-weight: 700; font-size: 14px; }
.topnav a:hover, .topnav a.on { background: var(--violet-clair); color: var(--violet); text-decoration: none; }
.topright { display: flex; gap: 8px; align-items: center; }
.topright form { margin: 0; }
.pastille { background: var(--rouge); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 12px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: 600 15px 'Poppins', sans-serif; border: 0; border-radius: 999px;
  padding: 11px 24px; cursor: pointer; color: var(--texte); background: var(--gris-btn);
  transition: transform .08s, background .15s, box-shadow .15s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--violet); color: #fff; box-shadow: 0 4px 14px rgba(112, 52, 244, .3); }
.btn-primary:hover { background: var(--violet-fonce); }
.btn-gris:hover { background: #dadae2; }
.btn-ghost { background: transparent; color: var(--gris); }
.btn-danger { background: var(--rouge-fond); color: var(--rouge); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-large { width: 100%; padding: 14px; font-size: 15px; }

/* ---------- Cartes et formulaires ---------- */
.carte { background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 24px; margin-bottom: 18px; }
.carte h3 { font-size: 16px; }
.carte.vide { text-align: center; color: var(--gris); padding: 40px 24px; }
.champ { display: block; margin-bottom: 18px; }
.champ > span, .champ-titre { display: block; font-size: 13px; color: var(--gris); margin-bottom: 6px; font-weight: 600; }
.champ input:not([type=file]), .champ textarea, .recherche input, .recherche select, .sky-form textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--texte);
  background: #f3f3f7; border: 0; border-bottom: 2px solid #c9c9d4; border-radius: 6px 6px 0 0;
  padding: 13px 14px; outline: none; transition: border-color .15s, background .15s;
}
.champ input:focus, .champ textarea:focus, .recherche input:focus { border-bottom-color: var(--violet); background: #f6f2ff; }
.champ textarea { resize: vertical; min-height: 90px; }
.coche { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: -4px 0 18px; cursor: pointer; }
.coche input { width: 17px; height: 17px; accent-color: var(--violet); }
.alerte { background: var(--rouge-fond); color: var(--rouge); padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-weight: 600; }
.petit { font-size: 13px; color: var(--gris); }
.lien { font-weight: 700; }

/* ---------- Flash ---------- */
.flash { max-width: 1060px; margin: 8px auto 0; padding: 12px 18px; border-radius: 12px; font-weight: 700; width: calc(100% - 32px); }
.flash-ok { background: var(--vert-fond); color: var(--vert); }
.flash-erreur { background: var(--rouge-fond); color: var(--rouge); }
.flash-info { background: var(--violet-clair); color: var(--violet); }

/* ---------- Accueil (non connecté) ---------- */
.hero {
  max-width: 1060px; margin: 0 auto; padding: 60px 16px 80px; flex: 1;
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 60px; align-items: center;
}
.hero h1 { font-size: clamp(32px, 5vw, 46px); font-weight: 800; line-height: 1.1; }
.grad { background: linear-gradient(90deg, var(--violet), #e0479e); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 20px; line-height: 1.5; color: #3a3a46; max-width: 34ch; }
.hero-stats { display: flex; gap: 24px; list-style: none; padding: 0; margin: 28px 0; }
.hero-stats li { background: #fff; padding: 12px 20px; border-radius: 14px; box-shadow: var(--ombre); color: var(--gris); }
.hero-stats b { font-family: 'Poppins'; font-size: 22px; color: var(--violet); display: block; }
.login { padding: 28px; }
.login .btn + .btn, .login .erreur-login + .btn { margin-top: 18px; }

/* Erreur de mot de passe sous le bouton Connexion */
.erreur-login {
  margin-top: 10px; padding: 14px 16px; border-radius: 12px;
  background: var(--rouge-fond); color: var(--rouge);
  text-align: center; font-weight: 600; font-size: 15px;
  animation: secoue .35s;
}
@keyframes secoue { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.centre { flex: 1; display: grid; place-items: center; padding: 40px 16px; }
.inscr { width: 100%; max-width: 440px; }
.inscr h1 { font-size: 26px; margin-bottom: 4px; }
.sous { color: var(--gris); margin: 0 0 22px; }

/* ---------- Pages internes ---------- */
.page { max-width: 1060px; width: 100%; margin: 0 auto; padding: 28px 16px 60px; flex: 1; }
.page.etroit { max-width: 760px; }
.grille { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.entete-page { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.entete-page h1 { margin: 0; font-size: 26px; }
.actions { display: flex; gap: 8px; }
.titre-section { font-size: 18px; color: var(--gris); margin: 6px 0 14px; }

.av { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; }
.av-s { width: 32px; height: 32px; }
.av-l { width: 72px; height: 72px; }
.av-vide { display: inline-grid; place-items: center; background: linear-gradient(135deg, var(--violet), #e0479e); color: #fff; font-family: 'Poppins'; font-weight: 700; }
.av-l.av-vide { font-size: 28px; }

.post-mini { background: #fff; border-radius: var(--rayon); box-shadow: var(--ombre); margin-bottom: 16px; overflow: hidden; }
.post-auteur { display: flex; align-items: center; gap: 10px; padding: 16px 20px 0; color: var(--texte); }
.post-auteur span { display: flex; flex-direction: column; line-height: 1.2; }
.post-auteur small { color: var(--gris); }
.post-corps { display: block; padding: 12px 20px; color: var(--texte); }
.post-corps:hover { text-decoration: none; }
.post-corps h3 { margin: 0 0 8px; font-size: 18px; }
.post-corps p { margin: 0; color: #4a4a56; line-height: 1.5; }
.post-img { width: 100%; max-height: 340px; object-fit: cover; border-radius: 12px; margin-bottom: 10px; }
.post-pied { display: flex; gap: 18px; padding: 10px 20px 16px; color: var(--gris); font-size: 14px; font-weight: 700; }

.liste-blogs { list-style: none; padding: 0; margin: 0; }
.liste-blogs li a { display: flex; align-items: center; gap: 10px; padding: 7px 0; color: var(--texte); }
.liste-blogs span { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.liste-blogs small { color: var(--gris); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.recherche { display: flex; gap: 8px; flex: 1; max-width: 560px; }
.recherche input { border-radius: 12px; border: 0; }
.recherche select { width: auto; border: 0; border-radius: 12px; }
.mur-blogs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.vignette { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 22px 14px; border-radius: var(--rayon); box-shadow: var(--ombre); color: #222; transition: transform .15s; }
.vignette:hover { transform: translateY(-3px); text-decoration: none; }
.vt-titre { font-family: 'Poppins'; font-size: 15px; line-height: 1.2; word-break: break-word; }
.vt-pseudo { font-weight: 700; opacity: .7; }
.vignette small { opacity: .7; }

/* Aperçu des thèmes (vignettes et sélecteur) */
.vt-rose { background: linear-gradient(135deg, #ffd1ec, #ff8ecb); }
.vt-nuit { background: linear-gradient(135deg, #1c2a6b, #0b1033); color: #fff; }
.vt-fluo { background: linear-gradient(135deg, #d8ff5c, #4dff9b); }
.vt-emo { background: linear-gradient(135deg, #111, #3a0b25); color: #ff4fae; }
.vt-soleil { background: linear-gradient(135deg, #ffe169, #ff8a3d); }
.vt-ocean { background: linear-gradient(135deg, #8ff0ff, #2b8bd6); }
.vt-violet { background: linear-gradient(135deg, #7b3ff2, #2a0c63); color: #fff; }
.vt-classic { background: #fff; border: 1px solid var(--ligne); }

.themes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px; }
.theme-choix { position: relative; border-radius: 10px; padding: 10px; font-size: 12px; font-weight: 700; cursor: pointer; border: 3px solid transparent; }
.theme-choix input { position: absolute; opacity: 0; }
.theme-choix:has(input:checked) { border-color: var(--violet); box-shadow: 0 0 0 2px #fff inset; }
.avatar-edit { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; }
.avatar-edit .champ { flex: 1; margin: 0; }
details.carte summary { cursor: pointer; list-style: none; }
details.carte summary h3 { display: inline; }
details.carte[open] summary { margin-bottom: 14px; }

.tableau { width: 100%; border-collapse: collapse; }
.tableau td { padding: 12px 0; border-top: 1px solid var(--ligne); vertical-align: middle; }
.tableau small { color: var(--gris); }
.droite { text-align: right; white-space: nowrap; }
.droite form { display: inline; }
.ligne-ami { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; gap: 8px; }
.ligne-ami form { display: flex; gap: 6px; margin: 0; }

.barre-bb { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.barre-bb button { font: 600 13px 'Nunito'; border: 1px solid var(--ligne); background: #fff; border-radius: 8px; padding: 5px 10px; cursor: pointer; }
.barre-bb button:hover { background: var(--violet-clair); }
.img-actuelle { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.img-actuelle img { width: 120px; border-radius: 10px; }
.signalement .apercu { background: #f6f6f9; padding: 10px; border-radius: 10px; }
.texte { line-height: 1.65; }

/* ---------- Pied de page + cookies ---------- */
.pied { text-align: center; padding: 24px 16px; color: var(--gris); font-size: 14px; }
.pied a { color: var(--gris); }
.cookies { position: fixed; left: 16px; bottom: 16px; z-index: 50; max-width: 360px; background: #23292b; color: #fff; border-radius: 4px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.cookies p { margin: 0; padding: 22px 26px; line-height: 1.45; }
.cookies button { display: block; width: 100%; border: 0; background: #3268d6; color: #fff; font: 700 15px 'Nunito'; padding: 12px; cursor: pointer; }
.cookies button:hover { background: #2756b8; }

.inline { display: inline; margin: 0; }

/* BBCode */
.bb-center { text-align: center; }
.bb-blink { animation: clignote 1s steps(2, start) infinite; }
@keyframes clignote { to { visibility: hidden; } }
.bb-rainbow { background: linear-gradient(90deg, #ff2a2a, #ff9a00, #ffe600, #2bd62b, #2b9bff, #8a2bff, #ff2aa8); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; }

@media (prefers-reduced-motion: reduce) { .bb-blink, .erreur-login { animation: none; } }

/* ---------- Calendrier ---------- */
.cal { padding: 18px; }
.cal-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cal-nav h2 { margin: 0; font-size: 22px; min-width: 190px; text-align: center; }
.cal-nav .btn { padding: 6px 14px; font-size: 18px; line-height: 1; }
.cal-auj { margin-left: auto; font-weight: 700; font-size: 14px; }
.cal-grille { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-jour-nom { text-align: center; font: 600 12px 'Poppins'; color: var(--gris); text-transform: uppercase; padding: 4px 0; }
.cal-case { min-height: 104px; background: #f7f7fa; border-radius: 10px; padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-case.hors { background: transparent; opacity: .45; }
.cal-case.passe:not(.hors) .cal-num { color: #a3a3ad; }
.cal-case.auj { background: var(--violet-clair); box-shadow: inset 0 0 0 2px var(--violet); }
.cal-case.auj .cal-num { background: var(--violet); color: #fff; }
.cal-case-tete { display: flex; justify-content: space-between; align-items: center; }
.cal-num { font: 700 13px 'Poppins'; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal-plus { opacity: 0; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--violet); color: #fff; font-weight: 800; }
.cal-plus:hover { text-decoration: none; }
.cal-case:hover .cal-plus, .cal-plus:focus { opacity: 1; }
.cal-evt {
  display: block; font-size: 12px; line-height: 1.25; padding: 3px 6px; border-radius: 6px;
  background: color-mix(in srgb, var(--c) 14%, #fff); color: color-mix(in srgb, var(--c) 80%, #000);
  border-left: 3px solid var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-evt:hover { text-decoration: none; background: color-mix(in srgb, var(--c) 24%, #fff); }
.cal-encore { font-size: 11px; font-weight: 700; color: var(--gris); padding-left: 4px; }

.liste-evts { list-style: none; padding: 0; margin: 0 0 6px; }
.liste-evts a { display: flex; gap: 12px; align-items: center; padding: 8px 0; color: var(--texte); }
.liste-evts a:hover { text-decoration: none; }
.liste-evts a:hover b { color: var(--violet); }
.evt-date { flex: none; width: 46px; height: 50px; border-radius: 10px; background: var(--c); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.evt-date b { font: 700 19px 'Poppins'; }
.evt-date small { font-size: 11px; text-transform: uppercase; margin-top: 2px; }
.evt-infos { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.evt-infos b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evt-infos small { color: var(--gris); }
.petit-lien { font-size: 14px; }

.evt-carte { margin-top: 12px; overflow: hidden; padding: 0; }
.evt-bandeau { display: flex; gap: 18px; align-items: center; padding: 24px; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 60%, #000)); color: #fff; }
.evt-bandeau h1 { margin: 0; font-size: clamp(22px, 4vw, 30px); word-break: break-word; }
.evt-gros-date { flex: none; width: 74px; height: 80px; background: #fff; color: var(--c); border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.evt-gros-date b { font: 800 32px 'Poppins'; }
.evt-gros-date span { font-size: 12px; font-weight: 700; text-transform: uppercase; margin-top: 4px; }
.evt-tag { display: inline-block; margin-top: 8px; background: rgba(255,255,255,.25); padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.evt-details { list-style: none; margin: 0; padding: 20px 24px 6px; }
.evt-details li { display: flex; gap: 12px; padding: 6px 0; font-size: 16px; }
.evt-details li span:first-child { width: 22px; text-align: center; }
.evt-desc { padding: 6px 24px 10px; line-height: 1.6; overflow-wrap: anywhere; }
.evt-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 16px 24px 22px; border-top: 1px solid var(--ligne); margin-top: 10px; }
.evt-actions-droite { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.evt-actions .sky-lien-btn { background: none; border: 0; color: var(--gris); cursor: pointer; font-size: 15px; }
.evt-participants { display: flex; flex-wrap: wrap; gap: 14px; }
.evt-participants a { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 64px; color: var(--texte); font-size: 12px; text-align: center; }
.evt-participants small { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.champs-ligne { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 12px; }
.couleurs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.pastille-couleur { cursor: pointer; }
.pastille-couleur input { position: absolute; opacity: 0; }
.pastille-couleur span { display: inline-block; padding: 7px 14px; border-radius: 999px; background: color-mix(in srgb, var(--c) 15%, #fff); color: var(--c); font-weight: 700; font-size: 14px; text-transform: capitalize; border: 2px solid transparent; }
.pastille-couleur input:checked + span { background: var(--c); color: #fff; }
.pastille-couleur input:focus-visible + span { border-color: var(--texte); }

@media (max-width: 640px) {
  .cal { padding: 10px; }
  .cal-grille { gap: 2px; }
  .cal-case { min-height: 62px; padding: 3px; border-radius: 6px; }
  .cal-num { width: 20px; height: 20px; font-size: 11px; }
  .cal-plus { display: none; }
  .cal-evt { font-size: 0; height: 9px; padding: 0; border: 0; background: var(--c); border-radius: 3px; }
  .cal-evt b { display: none; }
  .cal-encore { font-size: 10px; }
  .cal-nav h2 { font-size: 17px; min-width: 0; flex: 1; }
  .champs-ligne { grid-template-columns: 1fr 1fr; }
  .champs-ligne .champ:first-child { grid-column: 1 / -1; }
  .evt-actions-droite { margin-left: 0; }
}

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 30px; }
  .grille { grid-template-columns: 1fr; }
  .topbar-in { flex-wrap: wrap; gap: 10px; }
  .topnav { order: 3; flex: 0 0 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .topnav a { white-space: nowrap; }
  .topright { margin-left: auto; }
}
