/* ═══════════════════════════════════════════════════════════════════════════
   ASTRADIOM — Main CSS
   Design futuriste spatial
   ═══════════════════════════════════════════════════════════════════════════ */

/* Polices chargées via <link> dans base.html (évite le blocage @import) */

/* ─── Variables ──────────────────────────────────────────────────────────── */
:root {
  --bg-deep:       #020408;
  --bg-dark:       #050c14;
  --bg-panel:      rgba(5, 20, 40, 0.85);
  --bg-panel-alt:  rgba(0, 30, 60, 0.7);
  --border-glow:   #00d4ff;
  --border-dim:    rgba(0, 212, 255, 0.25);
  --cyan:          #00d4ff;
  --cyan-dim:      rgba(0, 212, 255, 0.6);
  --cyan-glow:     0 0 15px rgba(0, 212, 255, 0.5), 0 0 30px rgba(0, 212, 255, 0.2);
  --gold:          #ffd700;
  --gold-dim:      rgba(255, 215, 0, 0.7);
  --red:           #ff3860;
  --green:         #00ff88;
  --purple:        #bf00ff;
  --orange:        #ff6b35;
  --text-primary:  #e0f0ff;
  --text-dim:      rgba(200, 220, 240, 0.6);
  --text-muted:    rgba(200, 220, 240, 0.35);
  --font-title:    'Orbitron', monospace;
  --font-mono:     'Share Tech Mono', monospace;
  --font-body:     'Rajdhani', sans-serif;
  --radius:        4px;
  --radius-lg:     8px;
  --transition:    0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --safe-top:      env(safe-area-inset-top, 0px);
  --safe-right:    env(safe-area-inset-right, 0px);
  --safe-bottom:   env(safe-area-inset-bottom, 0px);
  --safe-left:     env(safe-area-inset-left, 0px);
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; scroll-behavior: smooth; }

body {
  min-height: 100%;
  background-color: var(--bg-deep);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(0, 50, 100, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(0, 20, 80, 0.12) 0%, transparent 50%);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ─── Étoiles animées ────────────────────────────────────────────────────── */
.stars-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* ─── Scanlines overlay ──────────────────────────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.app-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

main { flex: 1; }

/* ─── Navbar ─────────────────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: calc(0.75rem + var(--safe-top)) 2rem 0.75rem;
  background: rgba(2, 6, 12, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-dim);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.08);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--cyan);
  text-shadow: var(--cyan-glow);
}

.navbar-brand .logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--cyan), #0070a0);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.navbar-nav {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  margin-left: auto;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: var(--cyan);
  border-color: var(--border-dim);
  background: rgba(0, 212, 255, 0.07);
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

.nav-credits {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: var(--radius);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

/* ─── Panneaux / Cards ───────────────────────────────────────────────────── */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(135deg, rgba(0,212,255,0.3), transparent 50%, rgba(0,212,255,0.1));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.panel-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-dim);
  font-family: var(--font-title);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--cyan);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.panel-header::before {
  content: '';
  width: 3px;
  height: 1rem;
  background: var(--cyan);
  box-shadow: var(--cyan-glow);
  border-radius: 2px;
}

.panel-body { padding: 1.5rem; }

/* ─── Boutons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid;
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  appearance: none;
  -webkit-appearance: none;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: currentColor;
  opacity: 0;
  transition: opacity var(--transition);
}

.btn:hover::after { opacity: 0.08; }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: rgba(0, 212, 255, 0.12);
  border-color: var(--cyan);
  color: var(--cyan);
}
.btn-primary:hover {
  background: rgba(0, 212, 255, 0.2);
  box-shadow: var(--cyan-glow);
}

.btn-danger {
  background: rgba(255, 56, 96, 0.1);
  border-color: var(--red);
  color: var(--red);
}
.btn-danger:hover { background: rgba(255, 56, 96, 0.2); box-shadow: 0 0 15px rgba(255,56,96,0.3); }

.btn-success {
  background: rgba(0, 255, 136, 0.1);
  border-color: var(--green);
  color: var(--green);
}
.btn-success:hover { background: rgba(0, 255, 136, 0.2); box-shadow: 0 0 15px rgba(0,255,136,0.3); }

.btn-gold {
  background: rgba(255, 215, 0, 0.1);
  border-color: var(--gold);
  color: var(--gold);
}
.btn-gold:hover { background: rgba(255, 215, 0, 0.2); box-shadow: 0 0 15px rgba(255,215,0,0.3); }

.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.75rem; }
.btn-lg { padding: 0.9rem 2rem; font-size: 0.95rem; }
.btn-block { width: 100%; }

.btn[disabled], .btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.mfa-method-grid {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.mfa-method-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 1.25rem 1rem;
  min-height: 7.5rem;
  border: 1px solid var(--border-dim);
  background: var(--bg-panel);
  border-radius: 4px;
  text-align: center;
  white-space: normal;
  overflow: visible;
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
  transition: var(--transition);
  appearance: none;
  -webkit-appearance: none;
  color: inherit;
}

.mfa-method-card .mfa-method-name {
  font-family: var(--font-title);
  font-size: 0.95rem;
  color: var(--cyan);
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mfa-method-card .mfa-method-desc {
  width: 100%;
  margin-top: auto;
  padding-top: 0.75rem;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text-muted);
  text-transform: none;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.mfa-method-card:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.15);
}

.mfa-totp-qr-panel {
  text-align: center;
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  border-radius: 4px;
}

.mfa-totp-qr-panel img {
  max-width: 200px;
  background: #fff;
  padding: 8px;
  border-radius: 4px;
}

.mfa-totp-app-panel {
  margin-bottom: 1rem;
}

.mfa-open-app-link {
  display: block;
  margin-bottom: 0.75rem;
  text-align: center;
  text-decoration: none;
}

.mfa-totp-app-hint {
  font-size: 0.72rem;
  line-height: 1.45;
  margin: 0;
}

.mfa-secret-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.mfa-secret-row .form-control {
  flex: 1;
  min-width: 0;
}

.mfa-copy-secret-btn {
  flex-shrink: 0;
  border: 1px solid var(--border-dim);
  background: transparent;
  color: var(--cyan);
}

/* ─── Formulaires ────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  margin-bottom: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.form-control {
  width: 100%;
  padding: 0.65rem 1rem;
  background: rgba(0, 20, 40, 0.6);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.15);
  background: rgba(0, 30, 60, 0.7);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control option { background: #050c14; color: var(--text-primary); }

.password-field-wrap {
  position: relative;
  width: 100%;
}

.password-field-wrap .form-control {
  padding-right: 2.75rem;
}

.password-toggle-btn {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 0 var(--radius) var(--radius) 0;
  transition: color var(--transition), background var(--transition);
}

.password-toggle-btn:hover {
  color: var(--cyan);
  background: rgba(0, 212, 255, 0.06);
}

.password-toggle-btn:focus-visible {
  outline: 2px solid rgba(0, 212, 255, 0.35);
  outline-offset: -2px;
}

.password-toggle-btn svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}

/* ─── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  border-radius: var(--radius);
  border: 1px solid;
}

.badge-online  { background: rgba(0,255,136,0.1);  border-color: var(--green);  color: var(--green);  }
.badge-offline { background: rgba(255,56,96,0.1);  border-color: var(--red);    color: var(--red);    }
.badge-warning { background: rgba(255,215,0,0.1);  border-color: var(--gold);   color: var(--gold);   }
.badge-cyan    { background: rgba(0,212,255,0.1);  border-color: var(--cyan);   color: var(--cyan);   }
.badge-purple  { background: rgba(191,0,255,0.1);  border-color: var(--purple); color: var(--purple); }

/* ─── Tableaux ───────────────────────────────────────────────────────────── */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
}

table { width: 100%; border-collapse: collapse; }

th {
  padding: 0.75rem 1rem;
  background: rgba(0, 30, 60, 0.6);
  border-bottom: 1px solid var(--border-dim);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  text-align: left;
  white-space: nowrap;
}

td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgba(0, 212, 255, 0.06);
  font-size: 0.88rem;
  color: var(--text-primary);
}

tr:hover td { background: rgba(0, 212, 255, 0.04); }
tr:last-child td { border-bottom: none; }

/* ─── Alertes ────────────────────────────────────────────────────────────── */
.alert {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid;
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.alert-danger  { background: rgba(255,56,96,0.1);  border-color: rgba(255,56,96,0.3);  color: #ff8090; }
.alert-success { background: rgba(0,255,136,0.1);  border-color: rgba(0,255,136,0.3);  color: #00ff88; }
.alert-info    { background: rgba(0,212,255,0.1);  border-color: rgba(0,212,255,0.3);  color: var(--cyan); }
.alert-warning { background: rgba(255,215,0,0.1);  border-color: rgba(255,215,0,0.3);  color: var(--gold); }

/* ─── Séparateurs / Titres ───────────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: var(--font-title); letter-spacing: 0.05em; }

.section-title {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--border-dim), transparent);
}

/* ─── Grid utilitaires ───────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-cyan { color: var(--cyan); }
.text-gold { color: var(--gold); }
.text-red { color: var(--red); }
.text-green { color: var(--green); }
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.font-mono { font-family: var(--font-mono); }

.resource-icon-img {
  object-fit: contain;
  flex-shrink: 0;
}
.inline-resource-icon {
  width: 1.1rem;
  height: 1.1rem;
  display: inline-block;
  vertical-align: -0.15em;
}
.font-title { font-family: var(--font-title); }

/* ─── Loader ─────────────────────────────────────────────────────────────── */
.loader {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid var(--border-dim);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ─── Modal ──────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-dark);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  padding: 2rem;
  min-width: 360px;
  max-width: 560px;
  width: 90%;
  position: relative;
  transform: translateY(20px);
  transition: transform var(--transition);
  box-shadow: 0 0 40px rgba(0,0,0,0.5), 0 0 60px rgba(0,212,255,0.05);
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal-title {
  font-family: var(--font-title);
  font-size: 1rem;
  color: var(--cyan);
  margin-bottom: 1.5rem;
  letter-spacing: 0.1em;
}

.modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--red); }

.recovery-codes-modal .modal-title {
  padding-right: 2rem;
  margin-bottom: 1rem;
}

.recovery-codes-hint {
  font-size: 0.8rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.recovery-codes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  font-size: 0.8rem;
  margin-bottom: 1.25rem;
  max-height: 220px;
  overflow-y: auto;
}

.recovery-codes-grid .recovery-code-item {
  padding: 0.45rem 0.65rem;
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  border-radius: 3px;
  text-align: center;
  letter-spacing: 0.06em;
}

.recovery-codes-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.recovery-codes-actions .btn {
  flex: 1;
}

.recovery-codes-done {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border-dim);
  color: var(--text-dim);
}

/* ─── Toast notifications ────────────────────────────────────────────────── */
.app-footer {
  text-align: center;
  padding: 2rem 2rem calc(2rem + var(--safe-bottom));
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-dim);
  margin-top: auto;
}

/* ─── Préférences de notifications push ───────────────────────────────────── */
.push-prefs {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-dim);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.push-prefs-group { min-width: 0; }
.push-prefs-title {
  font-family: var(--font-title);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--cyan);
  margin-bottom: 0.6rem;
}
.push-prefs-list { display: flex; flex-direction: column; gap: 0.1rem; }

.push-pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0;
  cursor: pointer;
}
.push-pref-label {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.3;
}

.push-switch { position: relative; flex: 0 0 auto; width: 40px; height: 22px; }
.push-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.push-switch-slider {
  position: absolute;
  inset: 0;
  background: rgba(200, 220, 240, 0.18);
  border: 1px solid var(--border-dim);
  border-radius: 999px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.push-switch-slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: transform 0.15s ease, background 0.15s ease;
}
.push-switch input:checked + .push-switch-slider {
  background: rgba(0, 212, 255, 0.3);
  border-color: var(--cyan);
}
.push-switch input:checked + .push-switch-slider::before {
  transform: translateX(18px);
  background: var(--cyan);
}
.push-switch input:focus-visible + .push-switch-slider {
  box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.4);
}

@media (max-width: 640px) {
  .push-prefs { grid-template-columns: 1fr; gap: 1rem; }
}

/* ─── Bouton « Ajouter à l'écran d'accueil » (PWA / A2HS) ──────────────────── */
.pwa-install-bar {
  position: fixed;
  left: calc(1.25rem + var(--safe-left));
  bottom: calc(1.25rem + var(--safe-bottom));
  z-index: 1500;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.pwa-install-bar[hidden] { display: none; }

.pwa-install-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.1rem;
  font-family: var(--font-title);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #021018;
  background: linear-gradient(135deg, #00e5ff, #00a8cc);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(0, 212, 255, 0.4);
  animation: pwaPulse 2.4s ease-in-out infinite;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.pwa-install-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.pwa-install-btn:active { transform: translateY(0); }
.pwa-install-ic { font-size: 1rem; line-height: 1; }

.pwa-install-dismiss {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(2, 8, 16, 0.7);
  border: 1px solid var(--border-dim);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.7rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.pwa-install-dismiss:hover { color: var(--red); border-color: var(--red); }

@keyframes pwaPulse {
  0%, 100% { box-shadow: 0 6px 22px rgba(0, 212, 255, 0.35); }
  50%      { box-shadow: 0 6px 30px rgba(0, 212, 255, 0.62); }
}

.pwa-ios-steps { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.pwa-ios-steps li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border-dim);
  font-family: var(--font-body);
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.4;
}
.pwa-ios-steps li:last-child { border-bottom: none; }
.pwa-ios-num {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 212, 255, 0.15);
  color: var(--cyan);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

#toast-container {
  position: fixed;
  bottom: calc(2rem + var(--safe-bottom));
  right: calc(2rem + var(--safe-right));
  z-index: 2000;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  background: var(--bg-dark);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  padding: 0.85rem 1.25rem;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 280px;
  max-width: 380px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  animation: toast-in 0.3s ease forwards;
  pointer-events: all;
}

.toast.success { border-color: rgba(0,255,136,0.4); }
.toast.error   { border-color: rgba(255,56,96,0.4); }
.toast.info    { border-color: rgba(0,212,255,0.4); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ─── Page de connexion ──────────────────────────────────────────────────── */
.auth-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(2rem + var(--safe-top)) 2rem calc(2rem + var(--safe-bottom));
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  position: relative;
  box-shadow: 0 0 60px rgba(0,0,0,0.5), 0 0 80px rgba(0,212,255,0.05);
}

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo-title {
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--cyan);
  text-shadow: var(--cyan-glow);
  letter-spacing: 0.1em;
}

.auth-logo-subtitle {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-top: 0.25rem;
}

.oauth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.oauth-divider::before,
.oauth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-dim);
}

.oauth-buttons {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 0.65rem;
}

.oauth-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border-radius: 6px;
  border: 1px solid var(--border-dim);
  background: rgba(0, 212, 255, 0.04);
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
}
.oauth-btn:hover {
  border-color: rgba(0, 212, 255, 0.45);
  background: rgba(0, 212, 255, 0.1);
  color: var(--cyan);
}

.oauth-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
}
.oauth-btn-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.oauth-btn--google .oauth-btn-icon { color: inherit; }
.oauth-btn--microsoft .oauth-btn-icon { color: inherit; }
.oauth-btn--discord .oauth-btn-icon { color: #5865f2; }
.oauth-btn--discord:hover .oauth-btn-icon { color: #7289da; }

/* ─── Confirm modal ───────────────────────────────────────────────────────── */
.confirm-modal-overlay { z-index: 1200; }

.confirm-modal {
  text-align: center;
  padding: 1.75rem 1.5rem 1.5rem;
  max-width: 420px;
}

.confirm-modal-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  line-height: 1;
}

.confirm-modal .modal-title {
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.confirm-modal-message {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.55;
  margin: 0 0 1.5rem;
  white-space: pre-line;
}

.confirm-modal-actions {
  display: flex;
  gap: 0.65rem;
  justify-content: center;
  flex-wrap: wrap;
}

.confirm-modal-actions .btn {
  min-width: 7rem;
  letter-spacing: 0.04em;
}

/* ─── Prompt modal ─────────────────────────────────────────────────────────── */
.prompt-modal-overlay { z-index: 1200; }

.prompt-modal {
  text-align: center;
  padding: 1.75rem 1.5rem 1.5rem;
  max-width: 420px;
}

.prompt-modal-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  line-height: 1;
}

.prompt-modal .modal-title {
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.prompt-modal-message {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 0 0 1rem;
  white-space: pre-line;
}

.prompt-modal-field {
  text-align: left;
  margin-bottom: 1.25rem;
}

.prompt-modal-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.prompt-modal-input {
  width: 100%;
}

.prompt-modal-actions {
  display: flex;
  gap: 0.65rem;
  justify-content: center;
  flex-wrap: wrap;
}

.prompt-modal-actions .btn {
  min-width: 7rem;
  letter-spacing: 0.04em;
}

.mfa-digits {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.mfa-digit {
  width: 2.75rem;
  height: 3.25rem;
  padding: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--bg-dark);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  transition: var(--transition);
}

.mfa-digit:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.25);
}

/* ─── Serveurs ───────────────────────────────────────────────────────────── */
.servers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.25rem; }

.server-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}

.server-card:hover {
  border-color: var(--cyan-dim);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.1);
  transform: translateY(-2px);
}

.server-card-name {
  font-family: var(--font-title);
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.server-stats {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.server-stat {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.server-stat .value { color: var(--text-primary); }

.progress-bar {
  height: 3px;
  background: rgba(0, 212, 255, 0.15);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.75rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(to right, var(--cyan), #0070ff);
  border-radius: 2px;
  transition: width 0.5s ease;
  box-shadow: 0 0 8px var(--cyan);
}

/* ─── Premium cards ──────────────────────────────────────────────────────── */
.premium-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
@media (max-width: 900px) { .premium-grid { grid-template-columns: 1fr; } }

.premium-card {
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: var(--transition);
  position: relative;
}

.premium-card.featured {
  border-color: var(--gold);
  box-shadow: 0 0 30px rgba(255,215,0,0.1);
}

.premium-card.featured::before {
  content: 'MEILLEURE VALEUR';
  position: absolute;
  top: -0.7rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: #000;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 0.2rem 0.75rem;
  border-radius: 20px;
  letter-spacing: 0.1em;
}

.premium-price {
  font-family: var(--font-title);
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--cyan);
  text-shadow: var(--cyan-glow);
  line-height: 1;
  margin: 1rem 0 0.25rem;
}

.premium-period { font-size: 0.8rem; color: var(--text-dim); }

.premium-features {
  list-style: none;
  margin: 1.5rem 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.premium-features li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.premium-features li::before {
  content: '✦';
  color: var(--cyan);
  font-size: 0.6rem;
  flex-shrink: 0;
}

/* ─── Stat boxes ─────────────────────────────────────────────────────────── */
.stat-box {
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.stat-value {
  font-family: var(--font-title);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--cyan);
  line-height: 1;
}

/* ─── Pulse animation ────────────────────────────────────────────────────── */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 5px rgba(0,212,255,0.3); }
  50%       { box-shadow: 0 0 20px rgba(0,212,255,0.7); }
}

.online-indicator {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse-glow 2s ease-in-out infinite;
}

/* ─── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0, 212, 255, 0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 212, 255, 0.5); }

/* ─── Menu mobile navbar ─────────────────────────────────────────────────── */
.navbar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  margin-left: auto;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  color: var(--cyan);
  font-size: 1.25rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
}
.navbar-toggle:hover { background: rgba(0, 212, 255, 0.15); }

.navbar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: 0.5rem;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .navbar { padding: calc(0.65rem + var(--safe-top)) 1.25rem 0.65rem; gap: 1rem; }
  .navbar-brand { font-size: 1rem; }
  .premium-grid { grid-template-columns: 1fr; }
  .servers-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .navbar {
    flex-wrap: wrap;
    padding: calc(0.65rem + var(--safe-top)) 1rem 0.65rem;
    gap: 0.5rem;
  }

  .navbar-toggle { display: inline-flex; }

  .navbar-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    order: 4;
    margin-left: 0;
    padding: 0.5rem 0;
    border-top: 1px solid var(--border-dim);
    gap: 0.25rem;
  }

  .navbar-nav.open { display: flex; }

  .nav-link {
    padding: 0.65rem 0.85rem;
    width: 100%;
  }

  .navbar-user {
    order: 3;
    margin-left: auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
  }

  .navbar-user .text-dim {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .auth-page { padding: 1rem; }
  .auth-card { padding: 1.75rem 1.25rem; }
  .auth-logo-title { font-size: 1.35rem; }

  .modal { min-width: 0; padding: 1.5rem; }

  #toast-container {
    left: 1rem;
    right: 1rem;
    bottom: calc(1rem + var(--safe-bottom));
  }

  .toast {
    min-width: 0;
    max-width: none;
    width: 100%;
  }

  .panel-body { padding: 1rem; }
  .panel-header { padding: 0.85rem 1rem; }

  .stat-value { font-size: 1.4rem; }
}

.page-content {
  padding: 2rem 2rem calc(2rem + var(--safe-bottom));
  max-width: 1400px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .page-content { padding: 1rem 0.75rem; }
}

@media (max-width: 480px) {
  .page-content { padding: 0.75rem 0.5rem; }
  .navbar-brand { font-size: 0.9rem; gap: 0.5rem; }
  .navbar-brand .logo-icon { width: 30px; height: 30px; font-size: 0.95rem; }
  .btn-lg { padding: 0.75rem 1.25rem; font-size: 0.85rem; }
  .premium-price { font-size: 2rem; }
}
