@import "global.css";
/* --- Vyra Global Text Selection (#ffbe8e) --- */
::selection {
  background-color: #ffbe8e !important;
  color: #0d0d14 !important;
}
::-moz-selection {
  background-color: #ffbe8e !important;
  color: #0d0d14 !important;
}

/* =========================================================================
   VYRA — PAGE "PROFIL"
   Comme pour Générer, Historique et Facturation, ce fichier ne redéfinit
   aucun token : il s'appuie sur les variables, la sidebar, la navbar,
   .stat-card et .section-heading déjà définis dans assets/css/dashboard.css
   (chargé avant celui-ci). Il ajoute uniquement les composants propres à
   cette page : carte profil, formulaire d'informations personnelles,
   sécurité (+ switch 2FA), chronologie d'activité, badges, statistiques et
   actions du compte (dont la zone dangereuse de suppression).
   ========================================================================= */

/* =========================================================================
   ENTRÉE "PROFIL" DANS LA SIDEBAR
   Le bloc utilisateur en bas de la sidebar (identique sur toutes les pages)
   devient le point d'entrée vers le profil ; cette page lui ajoute
   uniquement un léger état actif, sans changer sa structure.
   ========================================================================= */
.sidebar-user.is-active {
  background: rgba(255, 111, 111, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255,111,111,0.25);
}

/* =========================================================================
   HERO
   ========================================================================= */
.profile-hero { margin-bottom: 1.75rem; }
.profile-hero h1 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 0.5rem 0 0.4rem;
}
.profile-hero p { font-size: 0.95rem; color: var(--text-secondary); max-width: 560px; line-height: 1.6; }

/* =========================================================================
   CARTE VERRE GÉNÉRIQUE
   ========================================================================= */
.glass-card {
  background: var(--bg-surface, #ffffff);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.75rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 1.5rem;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.glass-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.1rem; gap: 0.75rem; flex-wrap: wrap; }
.glass-card-header h2 { font-size: 1.02rem; font-weight: 700; color: var(--text-primary); letter-spacing: -0.01em; }

.status-badge {
  font-size: 0.72rem; font-weight: 700;
  padding: 0.28rem 0.7rem;
  border-radius: 100px;
  white-space: nowrap;
}
.status-badge.status-active { background: rgba(52,211,153,0.14); color: #34d399; }

/* =========================================================================
   CARTE PROFIL
   ========================================================================= */
.profile-card-main {
  display: flex; align-items: center; gap: 1.4rem;
  flex-wrap: wrap;
  margin-bottom: 1.6rem;
  padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--border-soft);
}
.profile-avatar-wrap { position: relative; flex-shrink: 0; }
.profile-avatar {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: #18181b;
  color: #fff;
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 1.8rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 32px rgba(255,111,111,0.3);
  transition: transform 0.3s var(--ease);
}
.profile-card:hover .profile-avatar { transform: scale(1.03); }
.profile-avatar-edit {
  position: absolute; bottom: 0; right: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--bg-page);
  color: var(--text-primary);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-card);
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}
.profile-avatar-edit:hover { background: #ff6f6f; color: #fff; transform: scale(1.08); }
.profile-avatar-edit svg { width: 14px; height: 14px; }

.profile-main-info { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.profile-main-info h2 { font-family: 'Sora', sans-serif; font-size: 1.3rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.02em; }
.profile-username { font-size: 0.85rem; color: var(--text-muted); }
.profile-meta-badges { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; flex-wrap: wrap; }
.plan-chip {
  font-size: 0.72rem; font-weight: 700;
  padding: 0.28rem 0.7rem;
  border-radius: 100px;
  background: rgba(255,111,111,0.14);
  color: #ff6f6f;
}

.profile-info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.1rem;
}
.profile-info-item { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.profile-info-label { font-size: 0.74rem; color: var(--text-muted); font-weight: 600; }
.profile-info-value { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); overflow-wrap: anywhere; }
.profile-info-mono { font-family: monospace; font-size: 0.82rem; overflow-wrap: anywhere; }

/* =========================================================================
   FORMULAIRE — INFORMATIONS PERSONNELLES
   ========================================================================= */
.personal-info-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem 1.3rem;
}
.form-field { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.form-field label { font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); }
.form-field input {
  width: 100%;
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius-sm);
  background: var(--bg-glass-1);
  border: 1px solid var(--border-soft);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
.form-field input:focus { border-color: #ff6f6f; background: var(--bg-glass-2); box-shadow: 0 0 0 3px rgba(255,111,111,0.2); }

.select-wrap { position: relative; min-width: 0; }
.select-wrap select {
  width: 100%;
  appearance: none; -webkit-appearance: none;
  padding: 0.7rem 2.2rem 0.7rem 0.95rem;
  border-radius: var(--radius-sm);
  background: var(--bg-glass-1);
  border: 1px solid var(--border-soft);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
.select-wrap select:hover { background: var(--bg-glass-2); }
.select-wrap select:focus { border-color: #ff6f6f; box-shadow: 0 0 0 3px rgba(255,111,111,0.2); }
.select-wrap select option { background: var(--bg-surface); color: var(--text-primary); }
.select-chevron { position: absolute; top: 50%; right: 0.75rem; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-muted); pointer-events: none; }

.form-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.4rem; }

/* =========================================================================
   BOUTONS (même langage que Générer / Historique / Facturation)
   ========================================================================= */
.billing-btn {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.75rem 1.3rem;
  border-radius: 100px;
  background: var(--bg-glass-1);
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  font-size: 0.86rem; font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.15s var(--ease), box-shadow 0.2s var(--ease);
}
.billing-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.billing-btn:hover { background: var(--bg-glass-2); color: var(--text-primary); transform: translateY(-1px); }

.billing-btn-primary {
  background: #ff6f6f;
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 26px rgba(255,111,111,0.3);
}
.billing-btn-primary:hover { color: #fff; box-shadow: 0 14px 34px rgba(255,111,111,0.4); filter: brightness(1.05); }

.billing-btn-ghost { background: transparent; }

.billing-btn-danger:hover { background: rgba(239,68,68,0.12); color: #f87171; border-color: rgba(239,68,68,0.3); }

/* =========================================================================
   SÉCURITÉ
   ========================================================================= */
.security-badges { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.security-mini-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.74rem; font-weight: 600;
  color: #34d399;
  background: rgba(52,211,153,0.12);
  padding: 0.32rem 0.7rem;
  border-radius: 100px;
}
.security-mini-badge svg { width: 13px; height: 13px; flex-shrink: 0; }

.security-rows { display: flex; flex-direction: column; }
.security-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border-soft);
}
.security-row:last-child { border-bottom: none; padding-bottom: 0; }
.security-row-info { min-width: 0; }
.security-row-info h3 { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.25rem; }
.security-row-info p { font-size: 0.8rem; color: var(--text-muted); }

/* Interrupteur 2FA */
.toggle-switch {
  position: relative;
  width: 46px; height: 26px;
  border-radius: 100px;
  background: var(--bg-glass-2);
  border: 1px solid var(--border-soft);
  flex-shrink: 0;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
}
.toggle-switch-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1), background 0.25s var(--ease);
}
.toggle-switch[aria-checked="true"] {
  background: #ff6f6f;
  border-color: transparent;
}
.toggle-switch[aria-checked="true"] .toggle-switch-thumb { transform: translateX(20px); background: #fff; }

/* =========================================================================
   ACTIVITÉ RÉCENTE + BADGES — grille 2 colonnes
   ========================================================================= */
.profile-split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: start;
}
.profile-split-grid .glass-card { margin-bottom: 0; }

/* Chronologie */
.timeline { list-style: none; position: relative; padding-left: 2.1rem; }
.timeline::before {
  content: '';
  position: absolute; left: 15px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--border-soft);
}
.timeline-item { position: relative; padding-bottom: 1.4rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-icon {
  position: absolute; left: -2.1rem; top: 0;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255,111,111,0.16);
  color: #ff6f6f;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 4px var(--bg-surface);
  z-index: 1;
}
.timeline-icon svg { width: 15px; height: 15px; }
.timeline-content h4 { font-size: 0.88rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.15rem; }
.timeline-content span { font-size: 0.76rem; color: var(--text-muted); }

/* Badges */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}
.profile-badge {
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  text-align: center;
  padding: 1.2rem 0.8rem;
  border-radius: var(--radius-md);
  background: var(--bg-glass-1);
  border: 1px solid var(--border-soft);
  min-width: 0;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.profile-badge:hover {
  transform: translateY(-4px);
  border-color: rgba(255,111,111,0.3);
  box-shadow: 0 14px 32px rgba(255,111,111,0.2);
}
.profile-badge-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: rgba(255, 111, 111, 0.12); color: #ff6f6f;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(255,111,111,0.3);
  transition: transform 0.3s var(--ease);
  flex-shrink: 0;
}
.profile-badge:hover .profile-badge-icon { transform: scale(1.1) rotate(-4deg); }
.profile-badge-icon svg { width: 20px; height: 20px; }
.profile-badge span { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); }

/* =========================================================================
   STATISTIQUES — réutilise .stat-card de dashboard.css
   ========================================================================= */
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
  margin-bottom: 1.5rem;
}

/* =========================================================================
   ACTIONS DU COMPTE + ZONE DANGEREUSE
   ========================================================================= */
.account-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.4rem; }

.danger-zone {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.2rem; flex-wrap: wrap;
  padding: 1.2rem 1.3rem;
  border-radius: var(--radius-md);
  background: rgba(239,68,68,0.06);
  border: 1px solid rgba(239,68,68,0.25);
}
.danger-zone-info { min-width: 0; }
.danger-zone-info h3 { font-size: 0.9rem; font-weight: 700; color: #f87171; margin-bottom: 0.3rem; }
.danger-zone-info p { font-size: 0.8rem; color: var(--text-secondary); max-width: 440px; line-height: 1.55; }
.danger-zone .billing-btn-danger {
  background: rgba(239,68,68,0.12);
  border-color: rgba(239,68,68,0.4);
  color: #f87171;
  flex-shrink: 0;
}
.danger-zone .billing-btn-danger:hover { background: #ef4444; color: #fff; border-color: #ef4444; }

/* =========================================================================
   RESPONSIVE
   Desktop : plusieurs colonnes — Tablette : 2 colonnes — Mobile : 1 colonne
   ========================================================================= */
@media (max-width: 1180px) {
  .profile-info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  .profile-split-grid { grid-template-columns: minmax(0, 1fr); }
  .personal-info-form { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 768px) {
  .profile-card-main { flex-direction: column; text-align: center; }
  .profile-meta-badges { justify-content: center; }
  .profile-info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .badges-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .security-row { flex-direction: column; align-items: flex-start; }
  .danger-zone { flex-direction: column; align-items: flex-start; }
  .danger-zone .billing-btn-danger { width: 100%; justify-content: center; }
  .account-actions .billing-btn { flex: 1 1 calc(50% - 0.75rem); justify-content: center; }
}

@media (max-width: 480px) {
  .profile-info-grid { grid-template-columns: minmax(0, 1fr); }
  .profile-stats-grid { grid-template-columns: minmax(0, 1fr); }
  .badges-grid { grid-template-columns: minmax(0, 1fr); }
  .form-actions { flex-direction: column; }
  .form-actions .billing-btn { width: 100%; justify-content: center; }
  .account-actions .billing-btn { flex: 1 1 100%; }
  .glass-card { padding: 1.3rem 1.15rem; }
}