/* Reset léger */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body.app-body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #1E49C4;
  color: #f5f5f7;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* Layout */
.app-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #0b1020;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-header__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.app-logo {
  font-size: 1.4rem;
}

.app-title {
  font-weight: 600;
  font-size: 1rem;
}

.app-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.app-nav__link {
  font-size: 0.85rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
}

.app-nav__link--admin {
  border: 1px solid #facc15;
}

.app-nav__link--logout {
  border: 1px solid rgba(248, 113, 113, 0.7);
}

.app-main {
  padding: 1rem;
  max-width: 960px;
  margin: 0 auto;
}

.app-footer {
  padding: 1rem;
  text-align: center;
  font-size: 0.75rem;
  color: rgba(249,250,251,0.6);
}

/* Cartes & blocs */
.card {
  background: radial-gradient(circle at top left, #161869 0, #0E1046 55%);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.04);
}

.card--compact {
  padding: 0.75rem 0.9rem;
}

.card__title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card__subtitle {
  font-size: 0.8rem;
  color: rgba(249,250,251,0.7);
}

/* Grilles */
.grid {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .grid--2 {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  }
  .grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #f9fafb;
  font-size: 0.9rem;
  cursor: pointer;
}

.btn--ghost {
  background: transparent;
  border: 1px solid rgba(148,163,184,0.7);
}

.btn--full {
  width: 100%;
}

/* Listes de badges / succès */
.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.badge-pill {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: rgba(148,163,184,0.16);
  border: 1px solid rgba(148,163,184,0.5);
}

/* Avatar preview */
.avatar-preview {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto;
  border-radius: 24px;
  background: radial-gradient(circle at top, #1e293b, #020617);
  overflow: hidden;
}

.avatar-preview__layer {
  position: absolute;
  inset: 0;
  margin: auto;
}

/* Sections */
.section-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.section-text {
  font-size: 0.85rem;
  color: rgba(249,250,251,0.7);
}

/* Tables simples (validation, admin) */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.table th,
.table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid rgba(148,163,184,0.3);
}

.table th {
  text-align: left;
  font-weight: 500;
  color: rgba(209,213,219,0.9);
}

/* Messages */
.alert {
  padding: 0.6rem 0.8rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.alert--success {
  background: rgba(22,163,74,0.12);
  border: 1px solid rgba(22,163,74,0.5);
  color: #bbf7d0;
}

.alert--error {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.5);
  color: #fecaca;
}

.avatar-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 0.3rem;
}

.avatar-options__group {
  border-top: 1px solid rgba(148,163,184,0.3);
  padding-top: 0.6rem;
}

.avatar-options__group:first-child {
  border-top: none;
  padding-top: 0;
}

.avatar-options__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.avatar-option {
  border: 1px solid rgba(148,163,184,0.4);
  background: rgba(15,23,42,0.8);
  border-radius: 12px;
  padding: 0.35rem 0.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  min-width: 72px;
  max-width: 90px;
}

.avatar-option__thumb {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  overflow: hidden;
  background: #020617;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-option__name {
  font-size: 0.7rem;
  text-align: center;
  color: rgba(249,250,251,0.85);
}

/* État sélectionné (JS ajoutera une classe) */
.avatar-option--active {
  border-color: #eab308;
  box-shadow: 0 0 0 1px rgba(234,179,8,0.6);
}

/* Wrapper interne du header (logo + nav alignés) */
.app-header__inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo cliquable dans le header */
.app-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  color: inherit;
}

/* Menu admin sur la page /admin/index.php (si tu l'utilises) */
.admin-menu {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.admin-menu__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  font-size: 0.95rem;
  border: 1px solid rgba(255,255,255,0.08);
}

.admin-menu__item:hover {
  background: rgba(255,255,255,0.1);
}



.bg-swatch {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 2px solid rgba(15,23,42,0.9);
  background: #020617;
  cursor: pointer;
  padding: 0;
}

.bg-swatch:hover {
  transform: scale(1.05);
}

.bg-swatch:focus-visible {
  outline: 2px solid #e5e7eb;
}
