@charset "UTF-8";
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #f8fafc;
  font-family: 'Segoe UI', Arial, sans-serif;
}

nav {
  background: #1e293b;
  border-bottom: 1px solid #334155;
  padding: 0 2rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.25rem;
  text-decoration: none;
  color: #f8fafc;
}

.nav-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 50%;
  filter: drop-shadow(0 0 6px rgba(13,148,136,0.5));
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-email {
  font-size: 0.82rem;
  color: #f1f5f9;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-logout {
  padding: 0.35rem 0.9rem;
  background: transparent;
  color: #f1f5f9;
  border: 1px solid #334155;
  border-radius: 0.375rem;
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-logout:hover { border-color: #64748b; color: #e2e8f0; }

/* -- Carte profil -- */
.profile-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 1rem;
  margin-bottom: 2rem;
  overflow: hidden;
}

/* Header cliquable */
.profile-header {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; background: none; border: none; cursor: pointer;
  color: #f8fafc; transition: background 0.15s;
}
.profile-header:hover { background: rgba(255,255,255,0.04); }
.profile-header-left { display: flex; align-items: center; gap: 0.875rem; }

/* Avatar initiales */
.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #0d9488 0%, #0369a1 100%);
  color: #fff; font-weight: 800; font-size: 0.95rem; letter-spacing: -0.01em;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 3px rgba(13,148,136,0.2), 0 2px 8px rgba(0,0,0,0.3);
  transition: box-shadow 0.2s;
}
.profile-header:hover .avatar { box-shadow: 0 0 0 3px rgba(13,148,136,0.35), 0 2px 8px rgba(0,0,0,0.3); }

/* Nom + email dans le header */
.profile-header-info { display: flex; flex-direction: column; gap: 0.1rem; text-align: left; }
.profile-header-name { font-size: 0.9rem; font-weight: 700; color: #f1f5f9; line-height: 1.2; }
.profile-header-meta { font-size: 0.72rem; color: #f1f5f9; }

/* Chevron SVG */
.profile-chevron { width: 18px; height: 18px; color: #f1f5f9; flex-shrink: 0; transition: transform 0.2s; }
.profile-chevron.open { transform: rotate(180deg); }

/* Corps du formulaire */
.profile-body { padding: 0 1.25rem 1.5rem; }
.profile-divider { border: none; border-top: 1px solid #334155; margin: 1.5rem 0; }

/* Étiquette de groupe dans le formulaire */
.pf-label {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: #2dd4bf; margin-bottom: 0.875rem;
}

/* Champs */
.profile-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.profile-field { display: flex; flex-direction: column; gap: 0.35rem; flex: 1; min-width: 150px; }
.profile-field label { font-size: 0.78rem; font-weight: 600; color: #f1f5f9; }
.profile-field input {
  background: #0f172a; border: 1px solid #334155; color: #f8fafc;
  padding: 0.55rem 0.85rem; border-radius: 0.5rem; font-size: 0.88rem;
  transition: border-color 0.15s, box-shadow 0.15s; width: 100%;
}
.profile-field input:focus { outline: none; border-color: #0d9488; box-shadow: 0 0 0 3px rgba(13,148,136,0.12); }
.profile-field input::placeholder { color: #64748b; }

/* Hint sous un champ */
.profile-field-hint { font-size: 0.7rem; color: #f1f5f9; line-height: 1.45; margin-top: 0.1rem; }

/* Champ mot de passe avec toggle */
.pw-wrap { position: relative; display: flex; align-items: center; }
.pw-wrap input { padding-right: 2.75rem; }
.pw-toggle {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 2.5rem; background: none; border: none; cursor: pointer;
  color: #f1f5f9; display: flex; align-items: center; justify-content: center;
  border-radius: 0 0.5rem 0.5rem 0; transition: color 0.15s;
}
.pw-toggle:hover { color: #e2e8f0; }
.pw-toggle .eye-icon { width: 15px; height: 15px; pointer-events: none; }

/* Footer formulaire */
.profile-footer {
  display: flex; align-items: center; justify-content: flex-end;
  flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem;
  padding-top: 1.25rem; border-top: 1px solid #334155;
}
.profile-msg { font-size: 0.82rem; min-height: 1rem; flex: 1; }
.btn-save-profile {
  background: linear-gradient(135deg, #0d9488, #0f766e); color: #fff; border: none;
  padding: 0.6rem 1.5rem; border-radius: 0.5rem; cursor: pointer;
  font-size: 0.88rem; font-weight: 700; transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap; box-shadow: 0 2px 8px rgba(13,148,136,0.3);
}
.btn-save-profile:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-save-profile:active { transform: translateY(0); }

main {
  max-width: 100rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.page-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.page-sub {
  color: #f1f5f9;
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
}

/* Les grilles/cartes fonctionnelles gardent une largeur lisible malgré le bandeau élargi (alignées à gauche comme le titre) */
.profile-card,
#content {
  max-width: 56rem;
}

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 4rem 0;
  color: #f1f5f9;
}

.spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid #334155;
  border-top-color: #0d9488;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.75rem;
  padding: 3.5rem 2rem;
  text-align: center;
}

.empty-icon { font-size: 3rem; margin-bottom: 1rem; }

.empty h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.empty p {
  color: #f1f5f9;
  font-size: 0.9rem;
  margin-bottom: 1.75rem;
  line-height: 1.6;
}

.licence-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.75rem;
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #334155;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.card-id {
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Consolas', monospace;
  color: #e2e8f0;
}

.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tier-pro     { background: rgba(13,148,136, 0.15); color: #2dd4bf; }
.tier-starter { background: rgba(100, 116, 139, 0.2); color: #f1f5f9; }

.card-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
}

.field-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #f1f5f9;
  margin-bottom: 0.3rem;
}

.field-value {
  font-size: 0.9rem;
  color: #f1f5f9;
  word-break: break-all;
}

.field-value code {
  background: #0f172a;
  color: #7dd3fc;
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  font-family: 'Consolas', monospace;
  font-size: 0.82rem;
}

.modules-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.1rem;
}

.module-chip {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.module-chip.off {
  background: rgba(100, 116, 139, 0.12);
  color: #f1f5f9;
}

.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #334155;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.card-date {
  font-size: 0.8rem;
  color: #f1f5f9;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.25rem;
  background: #0d9488;
  color: white;
  border: none;
  border-radius: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}

.btn-download:hover { background: #0f766e; }

.buy-more {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  background: transparent;
  color: #f1f5f9;
  border: 1px solid #334155;
  border-radius: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.btn-outline:hover { border-color: #f1f5f9; color: #e2e8f0; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  background: #0d9488;
  color: white;
  border: none;
  border-radius: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}

.btn-primary:hover { background: #0f766e; }

/* ------------------------------
   RESPONSIVE - MOBILE
------------------------------ */
@media (max-width: 640px) {
  nav { padding: 0 1rem; }
  .nav-email { display: none; }
  .nav-right { gap: 0.5rem; }
  main { padding: 1.5rem 1rem 3rem; }
  .page-title { font-size: 1.2rem; }
  .page-sub { font-size: 0.82rem; margin-bottom: 1.75rem; }
  .card-header { padding: 1rem; }
  .card-body { padding: 1rem; grid-template-columns: 1fr; gap: 0.875rem; }
  .card-footer { padding: 0.75rem 1rem; flex-direction: column; align-items: flex-start; }
  .buy-more { flex-direction: column; align-items: stretch; }
  .buy-more .btn-primary,
  .buy-more .btn-outline { width: 100%; justify-content: center; }
}

@media (max-width: 400px) {
  .btn-logout span { display: none; }
  .card-id { font-size: 0.82rem; }
}
