/* =========================================================
   components.css : éléments réutilisés sur plusieurs pages
   (formulaires, messages, cartes de parcours, boutons
   d'action, pages simples...). Chargé après style.css.
   ========================================================= */


/* =========================================================
   1. MESSAGES ET BANDEAUX
   ========================================================= */
.flashes { padding-top: 16px; }
.flash { border-radius: 10px; padding: 12px 16px; font-size: 13.5px; margin-bottom: 8px; line-height: 1.5; }
.flash-success { background: #E3F1E6; color: #245B36; }
.flash-info    { background: var(--sage-light); color: var(--sage-text); }
.flash-warning { background: #FFF1D6; color: #7A5200; }
.flash-error   { background: var(--terracotta-light); color: var(--terracotta-text); }

/* Bandeau "email à confirmer" */
.verify-banner { background: var(--terracotta-light); color: var(--terracotta-text); font-size: 13px; padding: 10px 0; }
.verify-banner .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.verify-resend { background: none; border: 0; padding: 0; margin: 0; font: inherit; cursor: pointer; text-decoration: underline; font-weight: 500; color: var(--terracotta-text); white-space: nowrap; }
.verify-resend:hover { color: var(--terracotta); }
.verify-banner form { margin: 0; }


/* =========================================================
   2. FORMULAIRES (champs, erreurs, boutons d'envoi)
   ========================================================= */
.field-group { margin-bottom: 16px; }
.field-row { display: flex; gap: 14px; }
.field-row .field-group { flex: 1; min-width: 0; }
.field-group label, .field-label {
  font-size: 12px; color: var(--text-body); display: block; margin-bottom: 6px; font-weight: 500;
}
.field-group .optional { color: var(--text-muted); font-weight: 400; }

/* Tous les champs texte (pas les cases et boutons radio) */
.field-group input:not([type=radio]):not([type=checkbox]),
.field-group select,
.field-group textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13.5px;
  font-family: 'Inter', sans-serif;
  color: var(--text-dark);
  background: var(--white);
}
.field-group textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus { outline: none; border-color: var(--terracotta); }

.field-hint { font-size: 11px; color: var(--text-muted); margin-top: 5px; }
.field-error { font-size: 12px; color: var(--terracotta-text); margin-top: 5px; }
.has-error input:not([type=radio]):not([type=checkbox]),
.has-error select,
.has-error textarea { border-color: var(--terracotta); }

.form-errors { background: var(--terracotta-light); color: var(--terracotta-text); border-radius: 10px; padding: 12px 14px; font-size: 13px; margin-bottom: 18px; }

/* Boutons radio présentés comme des pastilles */
.choices { display: flex; flex-wrap: wrap; gap: 10px; }
.choice {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--white);
  padding: 10px 14px; font-size: 13px; color: var(--text-dark); cursor: pointer;
  margin-bottom: 0;
}
.choice input { accent-color: var(--terracotta); margin: 0 2px 0 0; }
.choice:has(input:checked) { border-color: var(--terracotta); background: var(--terracotta-light); }

/* Champ piège anti-robots : sorti de l'écran, invisible pour les humains */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Bouton d'envoi principal */
.btn-submit {
  background: var(--terracotta);
  color: var(--white);
  font-size: 14px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  padding: 13px 28px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  margin-top: 4px;
  transition: transform 0.2s ease;
}
.btn-submit:hover { transform: translateY(-2px); }
.btn-inline { display: inline-block; width: auto; }
.btn-danger { background: var(--terracotta-text); }
.cancel-link { font-size: 13px; color: var(--text-muted); }
.cancel-link:hover { color: var(--terracotta); }


/* =========================================================
   3. PAGES SIMPLES : une carte centrée (mot de passe, erreurs...)
   ========================================================= */
.simple-page { padding: 56px 16px; }
.simple-card {
  max-width: 480px; margin: 0 auto;
  background: var(--white); border: 0.5px solid var(--border); border-radius: 18px; padding: 34px;
}
.simple-card h1 { font-family: 'Poppins', sans-serif; font-size: 26px; font-weight: 600; color: var(--deep); margin-bottom: 10px; }
.simple-lead { font-size: 14px; color: var(--text-body); line-height: 1.6; margin-bottom: 22px; }
.simple-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-top: 8px; }
.simple-card.centered { text-align: center; }
.big-code { font-family: 'Poppins', sans-serif; font-size: 64px; color: var(--terracotta); line-height: 1; margin-bottom: 10px; }


/* =========================================================
   4. BANDEAUX COMMUNS
   ========================================================= */
.page-hero { background: var(--deep); color: var(--white); padding: 60px 0; text-align: center; }
.page-hero h1 {
  font-family: 'Poppins', sans-serif; font-size: 38px; font-weight: 600;
  margin-bottom: 14px; letter-spacing: -0.5px;
}
.page-hero p { font-size: 15px; color: #A9B7D4; max-width: 520px; margin: 0 auto; line-height: 1.6; }

.cta-band { background: var(--terracotta); padding: 56px 0; text-align: center; color: var(--white); }
.cta-band h2 { font-family: 'Poppins', sans-serif; font-size: 28px; font-weight: 600; margin-bottom: 12px; }
.cta-band p { font-size: 14px; color: var(--terracotta-light); margin-bottom: 24px; }


/* =========================================================
   5. CARTES DE PARCOURS (accueil et page Découvrir)
   ========================================================= */
.card {
  background: var(--white); border-radius: 14px; padding: 22px; border: 0.5px solid var(--border);
  display: block;
}
.avatar {
  width: 46px; height: 46px; border-radius: 10px; flex-shrink: 0; display: flex;
  align-items: center; justify-content: center; color: var(--white); font-weight: 600; font-size: 16px;
}
.avatar-small { width: 34px; height: 34px; font-size: 13px; border-radius: 8px; }
/* Une couleur d'avatar par auteur ; "Anonyme" est en gris */
.avatar-sage { background: var(--sage); }
.avatar-terracotta { background: var(--terracotta); }
.avatar-muted { background: var(--text-muted); }
.avatar-sage-text { background: var(--sage-text); }
.avatar-deep { background: var(--deep-2); }

.card-body { min-width: 0; }
/* En-tête : photo + nom à gauche, badge à droite ; le texte en dessous prend toute la largeur de la carte. */
.card-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.card-id-text { min-width: 0; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-name { font-size: 14.5px; font-weight: 600; color: var(--deep); }
.card-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

.badge { font-size: 9.5px; font-weight: 500; padding: 4px 11px; border-radius: 12px; white-space: nowrap; }
.badge.carriere { background: var(--terracotta-light); color: var(--terracotta-text); }
.badge.etudes { background: var(--sage-light); color: var(--sage-text); }

.card-title { font-family: 'Poppins', sans-serif; font-size: 16.5px; color: var(--deep); margin: 4px 0 8px; }
.card-title a:hover { color: var(--terracotta-text); }
.card-excerpt { font-size: 13px; color: var(--text-body); line-height: 1.6; margin-bottom: 14px; }

.card-actions {
  display: flex; align-items: center; gap: 22px; color: var(--text-muted); font-size: 12px;
  border-top: 0.5px solid #F1EFE8; padding-top: 12px;
}
.card-actions a { transition: color .2s ease; }
.card-actions a:hover { color: var(--terracotta); }
.card-actions .icon { margin-right: 4px; }

/* Bouton "j'aime" (cœur + compteur), utilisé aussi sur la page d'un parcours */
.like-form { display: inline; }
.like-btn {
  background: none; border: none; padding: 0; cursor: pointer;
  font: inherit; color: inherit;
  display: inline-flex; align-items: center; gap: 0;
  transition: color .2s ease;
}
.like-btn .icon { margin-right: 4px; }
.like-btn:hover, .like-btn.liked { color: var(--terracotta); }
.like-btn.liked { font-weight: 600; }

.empty-state {
  background: var(--white); border: 0.5px dashed var(--border); border-radius: 14px;
  padding: 36px 24px; text-align: center; font-size: 13.5px; color: var(--text-body);
}
.empty-state .empty-title { font-family: 'Poppins', sans-serif; font-size: 18px; color: var(--deep); margin-bottom: 6px; }
.empty-state .btn-primary { margin-top: 16px; }


/* =========================================================
   6. CARTES LATÉRALES (accueil et Découvrir)
   ========================================================= */
.side-card { background: var(--white); border-radius: 14px; padding: 20px; border: 0.5px solid var(--border); }
.side-card .label { font-size: 11.5px; color: var(--text-muted); letter-spacing: 0.4px; margin-bottom: 12px; }


/* =========================================================
   7. RESPONSIVE (sous 860px)
   ========================================================= */
@media (max-width: 860px) {
  .page-hero h1 { font-size: 30px; }
  .field-row { flex-direction: column; gap: 0; }
  .card { padding: 18px; gap: 12px; }
  .avatar { width: 40px; height: 40px; }
}
@media (max-width: 480px) {
  .simple-card { padding: 24px 20px; }
  .card-actions { gap: 16px; flex-wrap: wrap; }
}


/* =========================================================
   8. AJOUTS V1.1 : avatars photo, pagination, notifications,
      bandeau cookies, boutons secondaires
   ========================================================= */
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
mark { background: #FFE7A8; color: inherit; border-radius: 3px; padding: 0 2px; }
.card-name a:hover { color: var(--terracotta-text); }

.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 28px; flex-wrap: wrap; }
.page-num { min-width: 36px; height: 36px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--white); border: 1px solid var(--border); font-size: 13px; color: var(--text-dark); }
a.page-num:hover { border-color: var(--terracotta); }
.page-num.active { background: var(--deep); color: var(--white); border-color: var(--deep); }

.btn-ghost { font-size: 13px; padding: 10px 22px; border-radius: 24px; border: 1px solid var(--deep); color: var(--deep); display: inline-block; transition: transform .2s ease; }
.btn-ghost:hover { transform: translateY(-2px); }

.btn-small { padding: 8px 18px; font-size: 12.5px; margin-top: 8px; }
.btn-ghost-dark { font: inherit; font-size: 12.5px; background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 9px 16px; color: var(--text-dark); cursor: pointer; white-space: nowrap; display: inline-block; transition: border-color .2s; }
.btn-ghost-dark:hover { border-color: var(--terracotta); }
.btn-ghost-dark.danger { color: var(--terracotta-text); }
.btn-ghost-white { font-size: 13px; padding: 10px 20px; border-radius: 24px; background: var(--white); border: 1px solid var(--border); color: var(--text-dark); white-space: nowrap; }

/* ---- Notifications : cloche + panneau + liste ---- */
.notif-wrap { position: relative; }
.notif-bell { position: relative; background: none; border: none; cursor: pointer; font-size: 18px; padding: 4px 6px; }
.notif-dot { position: absolute; top: 2px; right: 3px; width: 9px; height: 9px; border-radius: 50%; background: var(--terracotta); border: 2px solid var(--white); }
.notif-panel { position: absolute; right: -60px; top: calc(100% + 14px); width: 360px; max-width: 92vw; background: var(--white); border: 0.5px solid var(--border); border-radius: 16px; box-shadow: 0 16px 40px rgba(27,42,74,.16); z-index: 60; overflow: hidden; }
.notif-panel[hidden] { display: none; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 0.5px solid var(--border); font-size: 15px; color: var(--deep); }
.notif-readall { font-size: 12px; color: var(--terracotta-text); }
.notif-item { display: flex; gap: 12px; padding: 13px 18px; border-bottom: 0.5px solid #F1EFE8; align-items: flex-start; font-size: 13px; color: var(--text-body); line-height: 1.45; }
.notif-item.unread { background: #FBF7F1; }
.notif-item:hover { background: var(--cream); }
.notif-item strong { color: var(--deep); }
.notif-item small { display: block; font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }
.notif-icon { width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--white); background: var(--sage); }
.notif-icon.notif-like { background: var(--terracotta); }
.notif-icon.notif-systeme { background: var(--deep); }
.notif-empty { padding: 22px 18px; font-size: 13px; color: var(--text-muted); }
.notif-all { display: block; text-align: center; padding: 14px; font-size: 13px; color: var(--terracotta-text); }
.nav-avatar .avatar { width: 34px; height: 34px; font-size: 13px; border-radius: 9px; }
.menu-count { background: var(--terracotta); color: var(--white); font-size: 11px; border-radius: 10px; padding: 1px 8px; margin-left: 6px; }

/* ---- Bandeau cookies ---- */
.cookie-banner { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 760px; margin: 0 auto; background: var(--deep); color: #D5DCEC; border-radius: 16px; padding: 16px 20px; display: flex; gap: 18px; align-items: center; justify-content: space-between; z-index: 200; box-shadow: 0 12px 40px rgba(0,0,0,.25); font-size: 13px; line-height: 1.5; }
.cookie-banner[hidden] { display: none; }
.cookie-banner a { text-decoration: underline; color: var(--white); }
.cookie-banner .btn-primary { background: var(--terracotta); white-space: nowrap; }
@media (max-width: 560px) { .cookie-banner { flex-direction: column; align-items: stretch; text-align: center; } }

/* Carte « appel à l'action » des colonnes latérales */
.side-card-cta { background: var(--sage-light); border: none; }
.side-card-cta-title { font-family: 'Poppins', sans-serif; font-size: 14.5px; color: var(--deep); margin-bottom: 6px; }
.side-card-cta-text { font-size: 12px; color: var(--sage-text); margin-bottom: 14px; }
.side-card-cta-link { font-size: 12.5px; color: var(--deep); font-weight: 500; }
.side-card-cta-link:hover { color: var(--terracotta-text); }

/* Bouton d'envoi + lien « Annuler » : toujours bien séparés, sur toutes les pages */
.form-actions { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin-top: 8px; }
.simple-actions { gap: 24px; }
.badge.metier { background: #FFF1D3; color: #8A5A00; }
.field-row[hidden] { display: none; }
