@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 "PARAMÈTRES"
   Comme pour les autres pages de l'app, ce fichier ne redéfinit aucun
   token : il s'appuie sur les variables, la sidebar, la navbar et
   .stat-card / .status-badge déjà définis dans assets/css/dashboard.css
   (chargé avant celui-ci). Il ajoute uniquement les composants propres à
   cette page : navigation à onglets, formulaires, cartes de thème,
   sélecteur d'accent, sliders, switches, sécurité, clé API, panneau
   Équipe verrouillé, résumé de facturation et notifications toast.
   ========================================================================= */

/* =========================================================================
   HERO
   ========================================================================= */
.settings-hero { margin-bottom: 1.75rem; }
.settings-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;
}
.settings-hero p { font-size: 0.95rem; color: var(--text-secondary); max-width: 560px; line-height: 1.6; }

/* =========================================================================
   MISE EN PAGE — navigation + panneaux
   ========================================================================= */
.settings-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

/* =========================================================================
   NAVIGATION DES PARAMÈTRES (onglets desktop/tablette, barre compacte mobile)
   ========================================================================= */
.settings-nav {
  position: sticky;
  top: calc(var(--navbar-h) + 1.5rem);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.6rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--bg-glass-1), var(--bg-glass-2));
  border: 1px solid var(--border-soft);
}
.settings-nav-item {
  position: relative;
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.87rem; font-weight: 500;
  white-space: nowrap;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.15s var(--ease);
}
.settings-nav-item svg:first-child { width: 18px; height: 18px; flex-shrink: 0; color: var(--text-muted); transition: color 0.2s var(--ease); }
.settings-nav-item:hover { background: var(--bg-glass-1); color: var(--text-primary); transform: translateX(2px); }
.settings-nav-item.is-active {
  background: linear-gradient(135deg, rgba(255, 190, 142, 0.22), rgba(255, 190, 142, 0.08));
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px rgba(224, 138, 73, 0.35);
}
.settings-nav-item.is-active svg:first-child { color: var(--accent-strong); }
.settings-nav-item.is-locked { color: var(--text-muted); }
.settings-nav-lock { width: 13px !important; height: 13px !important; margin-left: auto; color: var(--text-muted); }

/* =========================================================================
   PANNEAUX — un seul visible à la fois, transition fondu + glissement
   ========================================================================= */
.settings-panels { min-width: 0; }
.settings-panel { display: none; }
.settings-panel.is-active {
  display: block;
  animation: settingsPanelIn 0.4s var(--ease);
}
@keyframes settingsPanelIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.glass-card {
  background: linear-gradient(160deg, var(--bg-glass-1), var(--bg-glass-2));
  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);
}
.glass-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; gap: 0.75rem; flex-wrap: wrap; }
.glass-card-header h2 { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); letter-spacing: -0.01em; }

.settings-subheading {
  display: block;
  font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 1.4rem 0 0.8rem;
}
.settings-subheading:first-of-type { margin-top: 0; }

.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; }
.status-badge.status-pending { background: rgba(251,191,36,0.16); color: #f59e0b; }

/* =========================================================================
   FORMULAIRES
   ========================================================================= */
.settings-form {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem 1.3rem;
}
.form-field { display: flex; flex-direction: column; gap: 0.5rem; }
.form-field-wide { grid-column: 1 / -1; }
.form-field label {
  font-size: 0.78rem; font-weight: 600; color: var(--text-secondary);
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
}
.form-field input[type="text"], .form-field input[type="email"] {
  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: var(--accent-strong); background: var(--bg-glass-2); box-shadow: 0 0 0 3px var(--accent-glow); }

.select-wrap { position: relative; }
.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: var(--accent-strong); box-shadow: 0 0 0 3px var(--accent-glow); }
.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; gap: 0.75rem; margin-top: 0.4rem; }

/* =========================================================================
   BOUTONS (même langage que les autres pages de l'app)
   ========================================================================= */
.settings-btn {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.72rem 1.2rem;
  border-radius: 100px;
  background: var(--bg-glass-1);
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  font-size: 0.85rem; 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);
}
.settings-btn svg { width: 16px; height: 16px; }
.settings-btn:hover { background: var(--bg-glass-2); color: var(--text-primary); transform: translateY(-1px); }
.settings-btn-sm { padding: 0.5rem 0.85rem; font-size: 0.78rem; }
.settings-btn-ghost { background: transparent; }
.settings-btn-primary {
  background: linear-gradient(135deg, #FF6B5A, #e08a49);
  border-color: transparent; color: #fff;
  box-shadow: 0 10px 26px rgba(224, 138, 73, 0.35);
}
.settings-btn-primary:hover { color: #fff; box-shadow: 0 14px 34px rgba(224, 138, 73, 0.5); filter: brightness(1.05); }
.settings-btn-danger:hover { background: rgba(239,68,68,0.12); color: #f87171; border-color: rgba(239,68,68,0.3); }

.settings-actions-row { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 0.4rem; }

/* =========================================================================
   APPARENCE — cartes de thème + accent + toggles
   ========================================================================= */
.theme-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.9rem; margin-bottom: 0.4rem; }
.theme-card {
  display: flex; flex-direction: column; align-items: center; gap: 0.7rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-glass-1);
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  font-size: 0.85rem; font-weight: 600;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.theme-card:hover { transform: translateY(-3px); border-color: rgba(224, 138, 73, 0.35); }
.theme-card.is-active { border-color: var(--accent-strong); box-shadow: 0 0 0 1px var(--accent-strong), 0 14px 30px var(--accent-glow); color: var(--text-primary); }
.theme-card-preview {
  width: 100%; height: 64px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
}
.theme-preview-light { background: linear-gradient(160deg, #ffffff, #faf5f0); }
.theme-preview-dark { background: linear-gradient(160deg, #1c1c28, #0d0d14); }
.theme-preview-system { background: linear-gradient(90deg, #ffffff 50%, #0d0d14 50%); }

.accent-swatches { display: flex; gap: 0.7rem; margin-bottom: 0.4rem; }
.accent-swatch {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid transparent;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
.accent-swatch:hover { transform: scale(1.12); }
.accent-swatch.is-active { border-color: var(--text-primary); transform: scale(1.15); }

.settings-toggle-list { display: flex; flex-direction: column; }
.settings-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-soft);
}
.settings-toggle-row:last-child { border-bottom: none; padding-bottom: 0; }
.settings-toggle-row h3 { font-size: 0.88rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.2rem; }
.settings-toggle-row p { font-size: 0.78rem; color: var(--text-muted); max-width: 420px; }

/* Interrupteur (switch) réutilisé partout dans cette page */
.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: linear-gradient(135deg, #FF6B5A, #e08a49); border-color: transparent; }
.toggle-switch[aria-checked="true"] .toggle-switch-thumb { transform: translateX(20px); background: #fff; }

/* =========================================================================
   SLIDERS (créativité, température)
   ========================================================================= */
.slider-value { font-weight: 700; color: var(--accent-strong); }
.settings-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 100px;
  background: var(--bg-glass-2);
  outline: none;
}
.settings-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF6B5A, #e08a49);
  box-shadow: 0 0 0 4px var(--accent-glow), 0 4px 10px rgba(224, 138, 73, 0.35);
  cursor: pointer;
  transition: transform 0.15s var(--ease);
}
.settings-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
.settings-slider::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #FF6B5A, #e08a49);
  box-shadow: 0 0 0 4px var(--accent-glow), 0 4px 10px rgba(224, 138, 73, 0.35);
  cursor: pointer;
}

/* =========================================================================
   SÉCURITÉ — lignes, appareils, historique de connexion
   ========================================================================= */
.security-rows { display: flex; flex-direction: column; margin-bottom: 0.4rem; }
.security-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-soft);
}
.security-row:last-child { border-bottom: none; }
.security-row-info h3 { font-size: 0.88rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.2rem; }
.security-row-info p { font-size: 0.78rem; color: var(--text-muted); }

.device-list { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 0.4rem; }
.device-row {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-glass-1);
  border: 1px solid var(--border-soft);
}
.device-icon {
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 10px;
  background: var(--accent-tint);
  color: var(--accent-strong);
  display: flex; align-items: center; justify-content: center;
}
.device-icon svg { width: 18px; height: 18px; }
.device-info { flex: 1; min-width: 0; }
.device-info h4 { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); }
.device-info p { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.login-history { display: flex; flex-direction: column; }
.login-history-row {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.8rem; color: var(--text-secondary);
}
.login-history-row:last-child { border-bottom: none; }
.login-history-row span:first-child { color: var(--text-primary); font-weight: 600; }

/* =========================================================================
   API
   ========================================================================= */
.api-key-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  background: var(--bg-glass-1);
  border: 1px solid var(--border-soft);
  margin-bottom: 0.8rem;
}
.api-key-value {
  font-family: monospace;
  font-size: 0.88rem;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}
.api-key-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.api-note { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 1.1rem; }

/* =========================================================================
   ÉQUIPE — panneau verrouillé
   ========================================================================= */
.team-locked-overlay {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 0.7rem;
  padding: 2rem 1.5rem;
  border-radius: var(--radius-md);
  background: var(--bg-glass-1);
  border: 1px dashed var(--border-strong);
  margin-bottom: 1.3rem;
}
.team-locked-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: var(--accent-tint);
  color: var(--accent-strong);
  display: flex; align-items: center; justify-content: center;
}
.team-locked-icon svg { width: 22px; height: 22px; }
.team-locked-overlay h3 { font-size: 0.98rem; font-weight: 700; color: var(--text-primary); }
.team-locked-overlay p { font-size: 0.85rem; color: var(--text-secondary); max-width: 380px; line-height: 1.6; }

.team-preview { display: flex; flex-direction: column; gap: 0.6rem; opacity: 0.5; filter: grayscale(0.3); pointer-events: none; }
.team-preview-row {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  background: var(--bg-glass-1);
  border: 1px solid var(--border-soft);
}
.team-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  color: #fff; font-family: 'Sora', sans-serif; font-weight: 700; font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.team-preview-info { flex: 1; display: flex; flex-direction: column; }
.team-preview-info strong { font-size: 0.85rem; color: var(--text-primary); }
.team-preview-info span { font-size: 0.74rem; color: var(--text-muted); }

/* =========================================================================
   FACTURATION — résumé
   ========================================================================= */
.billing-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.3rem;
}
.profile-info-item { display: flex; flex-direction: column; gap: 0.35rem; padding: 1rem 1.1rem; border-radius: var(--radius-md); background: var(--bg-glass-1); border: 1px solid var(--border-soft); }
.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); }

/* =========================================================================
   ZONE DANGEREUSE (avancé)
   ========================================================================= */
.danger-zone {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.2rem; flex-wrap: wrap;
  margin-top: 1.4rem;
  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 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 .settings-btn-danger { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.4); color: #f87171; flex-shrink: 0; }
.danger-zone .settings-btn-danger:hover { background: #ef4444; color: #fff; border-color: #ef4444; }

/* =========================================================================
   TOASTS ("Tester une notification")
   ========================================================================= */
.toast-stack {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 2000;
  display: flex; flex-direction: column; gap: 0.6rem;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-ambient);
  color: var(--text-primary);
  font-size: 0.85rem; font-weight: 600;
  min-width: 260px;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
}
.toast.is-visible { transform: translateX(0); opacity: 1; }
.toast-icon { width: 20px; height: 20px; color: var(--accent-strong); flex-shrink: 0; }

/* =========================================================================
   RESPONSIVE
   Desktop : navigation latérale — Tablette : navigation repliée (barre
   compacte horizontale) — Mobile : navigation en accordéon (barre + panneaux
   empilés pleine largeur)
   ========================================================================= */
@media (max-width: 1180px) {
  .settings-form { grid-template-columns: repeat(2, 1fr); }
  .theme-cards { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1024px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    gap: 0.4rem;
  }
  .settings-nav-item { flex-shrink: 0; }
  .settings-nav-item span:not(.settings-nav-lock) { display: inline; }
  .billing-summary-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .settings-form { grid-template-columns: 1fr; }
  .theme-cards { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column; }
  .form-actions .settings-btn { width: 100%; justify-content: center; }
  .security-row, .settings-toggle-row { flex-direction: column; align-items: flex-start; }
  .danger-zone { flex-direction: column; align-items: flex-start; }
  .danger-zone .settings-btn-danger { width: 100%; justify-content: center; }
  .billing-summary-grid { grid-template-columns: 1fr; }
  .api-key-row { flex-direction: column; align-items: flex-start; }
  .toast-stack { left: 12px; right: 12px; top: 12px; }
  .toast { min-width: 0; width: 100%; }
}

@media (max-width: 480px) {
  .settings-nav-item span:not(.settings-nav-lock) { display: none; }
  .settings-nav-item { padding: 0.65rem; }
  .glass-card { padding: 1.3rem 1.15rem; }
  .settings-actions-row .settings-btn { width: 100%; justify-content: center; }
}