/* =================================================================
   app.css - Club Crise et Resilience (specifique au projet)
   Tout en variables du socle Neo-Tactile, zero valeur en dur.
   ================================================================= */

/* L'attribut hidden doit TOUJOURS l'emporter (sinon les regles display
   des ecrans/formulaires l'ecrasent et tout s'affiche en meme temps). */
[hidden] { display: none !important; }

/* ===== Ecran auth (centre) ===== */
#auth-view.auth-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gap-xl);
  overflow: auto;
}
.auth-card { width: 100%; max-width: 380px; }

.auth-brand {
  display: flex;
  align-items: center;
  gap: var(--gap-md);
  margin-bottom: var(--gap-lg);
}
.auth-logo {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--bg-base);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
  flex-shrink: 0;
}
.auth-brand strong { display: block; color: var(--accent); font-size: 16px; line-height: 1.2; }
.auth-brand small { color: var(--text-muted); font-size: 11px; }

.auth-tabs {
  display: flex; gap: var(--gap-sm);
  margin-bottom: var(--gap-lg);
  border-bottom: 1px solid var(--border);
}
.auth-tab {
  padding: 8px 14px;
  color: var(--text-muted);
  font-weight: 600; font-size: 13px;
  border-bottom: 2px solid transparent;
  transition: var(--transition-norm);
}
.auth-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.auth-form { display: flex; flex-direction: column; }
.auth-error { color: var(--error-text); font-size: 12px; min-height: 16px; margin-bottom: var(--gap-sm); }
.auth-foot { margin-top: var(--gap-lg); font-size: 11px; color: var(--text-muted); text-align: center; }

/* ===== Barre de recherche annuaire (a droite du titre, meme ligne) ===== */
.annuaire-search { max-width: 320px; width: 100%; }

/* ===== Annuaire (grille de membres) ===== */
.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--gap-lg);
}
.member-card { display: flex; flex-direction: column; gap: var(--gap-sm); }
.member-top { display: flex; align-items: center; gap: var(--gap-sm); }
.member-avatar {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: var(--accent-alpha);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; text-transform: uppercase;
  flex-shrink: 0;
  overflow: hidden;
}
.member-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Photo de profil (champ d'edition) */
.profil-avatar-row { display: flex; align-items: center; gap: var(--gap-md); }
.profil-avatar {
  width: 64px; height: 64px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--accent-alpha);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 20px; text-transform: uppercase;
  flex-shrink: 0;
}
.profil-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profil-form input[type="file"] { padding: 8px; color: var(--text-dim); font-size: 12px; }
.member-id strong { display: block; font-size: 14px; color: var(--text); }
.member-id small { color: var(--text-muted); font-size: 11px; }
.member-comp .badge { white-space: normal; line-height: 1.4; }
.member-presentation { font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.member-linkedin {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600; color: var(--accent);
  align-self: flex-start;
}
.member-linkedin:hover { color: var(--accent-hover); text-decoration: underline; }
.member-actions { margin-top: auto; padding-top: var(--gap-sm); }
.member-actions .member-btn { width: 100%; }

/* ===== Demandes / contacts ===== */
.req-card {
  display: flex; flex-direction: column; gap: var(--gap-md);
  margin-bottom: var(--gap-md);
  max-width: 480px;
}
.req-actions { display: flex; gap: var(--gap-sm); }
.member-contact { font-size: 13px; color: var(--text-dim); }

/* ===== Mes contacts : cartes flip (socle card-flip) ===== */
/* Grille alignee a gauche, cartes carrees de taille fixe (pas centree) */
#con-list .cards-grid,
#annuaire-grid.cards-grid {
  margin: 0;
  max-width: none;
  grid-template-columns: repeat(auto-fill, 220px);
  justify-content: start;
}
.ct-icon { width: 64px; height: 64px; overflow: hidden; }
.ct-icon img { width: 100%; height: 100%; object-fit: cover; }
.ct-back {
  justify-content: flex-start !important;
  align-items: stretch !important;
  text-align: left;
  overflow-y: auto;
  gap: 10px !important;
  padding: 14px !important;
}
.ct-desc { font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.ct-force { font-size: 12px; color: var(--text); line-height: 1.5; }
.ct-label { font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.ct-links { display: flex; flex-direction: column; gap: 6px; margin-top: auto; font-size: 12px; }
.ct-links a { color: var(--accent); word-break: break-word; }
.ct-action { display: flex; flex-direction: column; gap: 8px; margin-top: auto; padding-top: 8px; }
.ct-action .member-btn { width: 100%; }
.ct-state { font-size: 11px; color: var(--text-muted); text-align: center; padding: 6px; }

/* ===== Profil ===== */
.profil-form { max-width: 480px; display: flex; flex-direction: column; }
.profil-form input,
.profil-form textarea { padding: 10px 12px; }
.profil-form textarea { min-height: 120px; resize: vertical; }

/* ===== Logout ===== */
.sidebar-foot #btn-logout { margin-top: var(--gap-sm); }

/* ===== Responsive (mobile) ===== */
@media (max-width: 640px) {
  #app-view.has-sidebar { flex-direction: column; }
  .sidebar { width: 100% !important; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar-item { width: auto; flex: 1; min-width: 120px; }
}
