/* ============================================================
   RVKXSE — Design system (dark UI)
   Extrait et mergé depuis login.html, index.html et admin.html.
   Reutilisable tel quel sur un nouveau projet : colle ce fichier,
   importe-le, et utilise les classes ci-dessous (.card, .btn-*,
   inputs, .hint, .alias-chip, etc.)
   ============================================================ */

/* ------------------------------------------------------------
   1. TOKENS (variables CSS) — superset des 3 fichiers d'origine.
   ------------------------------------------------------------ */
:root {
  /* Fonds */
  --bg: #08090f;
  --panel: #11141e;
  --panel-2: #161a26;
  --panel-3: #1c2231;
  --sidebar: #0c0e16;

  /* Bordures */
  --border: #232838;
  --border-strong: #363f57;

  /* Texte */
  --ink: #e9ebf5;
  --ink-dim: #c3c8db;
  --muted: #868faa;
  --muted-2: #5a6379;

  /* Accent (violet, couleur de marque) */
  --accent: #7c5cff;
  --accent-hover: #9679ff;
  --accent-soft: rgba(124, 92, 255, 0.14);
  --highlight-color: #7c5cff;

  /* Accent secondaire (teal) */
  --accent-2: #33d6c0;
  --accent-2-soft: rgba(51, 214, 192, 0.14);
  --slate-soft: rgba(51, 214, 192, 0.12);

  /* Couleurs de statut */
  --blue: #4a9eff;
  --blue-soft: rgba(74, 158, 255, 0.14);
  --green: #43c98d;
  --green-soft: rgba(67, 201, 141, 0.14);
  --amber: #f0b429;
  --amber-soft: rgba(240, 180, 41, 0.14);
  --red: #f0665f;
  --red-soft: rgba(240, 102, 95, 0.13);

  /* Typo */
  --font-display: 'Space Grotesk', 'Inter', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Formes / ombres */
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-lg: 0 24px 60px -28px rgba(0, 0, 0, 0.65);
  --shadow-sm: 0 10px 24px -18px rgba(0, 0, 0, 0.5);
}

/* Police (a inclure dans <head> du HTML consommateur) :
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap" rel="stylesheet">
*/

/* ------------------------------------------------------------
   2. RESET / BASE
   ------------------------------------------------------------ */
* { box-sizing: border-box; }
html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 1000px 560px at 12% -10%, rgba(124, 92, 255, 0.10), transparent 58%),
    radial-gradient(ellipse 820px 540px at 105% 0%, rgba(51, 214, 192, 0.08), transparent 55%);
  background-attachment: fixed;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent-soft); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--accent-2); }

button:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 2px;
}

/* ------------------------------------------------------------
   3. LAYOUT UTILITAIRES
   ------------------------------------------------------------ */

/* Page centree type "carte de connexion" (login.html) */
.center-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  min-height: 100vh;
}

/* Grille app a 2 colonnes (index.html) */
.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 26px 28px 60px;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 22px;
}
@media (max-width: 800px) {
  .container { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------
   4. CARTES / PANNEAUX
   ------------------------------------------------------------ */

/* Carte generique (dashboard) */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card h2 {
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15.5px;
  letter-spacing: 0.005em;
  color: var(--ink);
}

/* Carte "modale" / login (bordure haute accentuee) */
#card, .modal-card {
  max-width: 400px;
  width: 100%;
  margin: 0 auto;
  padding: 34px 30px 30px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

/* Bandeau marque (logo + nom) */
.brand-row { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.brand-row img { width: 40px; height: 40px; border-radius: 10px; box-shadow: 0 8px 22px -10px rgba(124, 92, 255, 0.7); }
.brand-row .name { font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.brand-row .eyebrow { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-2); margin-top: 2px; }

/* Titres de section */
h2.title { margin: 0 0 4px; font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; font-size: 20px; color: var(--ink); }
.subtitle { margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.5; }

/* ------------------------------------------------------------
   5. ONGLETS (tabs)
   ------------------------------------------------------------ */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 22px;
}
.tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  padding: 9px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.tab-btn.active { background: var(--accent); color: #fff; }
.tab-btn:not(.active):hover { color: var(--ink); }

/* ------------------------------------------------------------
   6. FORMULAIRES / INPUTS
   ------------------------------------------------------------ */

/* Variante "formulaire simple" (login.html) */
label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}

/* Variante "formulaire dashboard" (index.html) — label en petites
   majuscules mono, plus d'espacement vertical entre champs empiles.
   Ajoute .label-mono sur un formulaire pour l'activer. */
.label-mono label {
  font-size: 11px;
  color: var(--muted);
  display: block;
  margin-top: 14px;
  font-weight: 600;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.label-mono label:first-of-type { margin-top: 0; }

input[type="text"],
input[type="password"],
input[type="email"],
input:not([type]),
textarea {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 11px 12px;
  outline: none;
  transition: border-color 0.15s ease, background 0.14s ease;
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, textarea:focus { border-color: var(--accent); background: var(--panel-3); }
input:disabled { opacity: 0.6; cursor: not-allowed; }

textarea { min-height: 160px; resize: vertical; line-height: 1.5; margin-top: 7px; }
textarea.textarea-small { min-height: 90px; }

.field-hint, .hint {
  font-size: 11.5px;
  color: var(--muted-2);
  margin-top: 7px;
  line-height: 1.45;
}

.error-msg {
  display: none;
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid rgba(240, 102, 95, 0.3);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  line-height: 1.5;
  padding: 9px 11px;
}
.error-msg.visible { display: block; }

/* Champ mot de passe avec bouton "afficher" */
.pass-field { position: relative; }
.pass-toggle {
  position: absolute;
  right: 4px;
  top: 4px;
  bottom: 4px;
  width: 34px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pass-toggle:hover { color: var(--ink); background: var(--panel-3); }

/* Selecteur de fichier stylise */
.file-input { display: inline-flex; align-items: center; gap: 10px; margin-top: 8px; cursor: pointer; }
.file-input-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--ink-dim);
}

/* ------------------------------------------------------------
   7. BOUTONS
   ------------------------------------------------------------ */
button.btn, .submit {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13.5px;
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .15s ease, border-color .15s ease, opacity .15s ease, transform .1s ease;
}
button.btn:active, .submit:active { transform: translateY(1px) scale(0.99); }
button.btn:disabled, .submit:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* Primaire (violet, appel a l'action principal) */
.btn-primary, .submit {
  background: linear-gradient(180deg, var(--accent-hover), var(--accent));
  color: #fff;
  box-shadow: 0 10px 24px -12px rgba(124, 92, 255, 0.55);
}
.btn-primary:hover, .submit:hover { background: var(--accent-hover); }

/* Secondaire (neutre) */
.btn-secondary {
  background: var(--panel-2);
  color: var(--ink);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--border-strong); background: var(--panel-3); }

/* Danger (suppression, deconnexion...) */
.btn-danger {
  background: var(--red-soft);
  color: var(--red);
  border-color: rgba(240, 102, 95, 0.28);
}
.btn-danger:hover { background: rgba(240, 102, 95, 0.22); }

/* Fantome (discret) */
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}
.btn-ghost:hover { color: var(--ink); background: var(--panel-2); }

/* Modificateurs de taille / largeur */
.btn-block { width: 100%; }
.btn-mini { padding: 6px 11px; font-size: 12px; }
.btn-icon { padding: 8px; width: 32px; height: 32px; }

/* Spinner de chargement pour bouton */
.spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------
   8. CHIPS / BADGES (alias mail, methodes de connexion, statuts…)
   ------------------------------------------------------------ */
.alias-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.alias-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--ink-dim);
}
.alias-chip .x-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  font-size: 11px;
  line-height: 1;
}
.alias-chip .x-btn:hover { color: var(--red); }

.alias-count-badge {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--muted-2);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
}

.text-dim { color: var(--muted-2); }

/* Badges de statut colores (a combiner avec un fond -soft) */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge-green  { background: var(--green-soft);  color: var(--green); }
.badge-amber  { background: var(--amber-soft);  color: var(--amber); }
.badge-red    { background: var(--red-soft);    color: var(--red); }
.badge-blue   { background: var(--blue-soft);   color: var(--blue); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }

/* ------------------------------------------------------------
   9. AVATAR / INITIALES
   ------------------------------------------------------------ */
.row-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  flex-shrink: 0;
}

/* ------------------------------------------------------------
   10. EN-TETE / BARRE SUPERIEURE
   ------------------------------------------------------------ */
header {
  padding: 22px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

/* ------------------------------------------------------------
   11. TABLE (utilisee dans admin.html)
   ------------------------------------------------------------ */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-2);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:hover td { background: var(--panel-2); }

.mono { font-family: var(--font-mono); font-size: 13px; }

.copy-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 2px;
  display: inline-flex;
  vertical-align: middle;
  margin-left: 4px;
}
.copy-btn:hover { color: var(--accent-2); }
