/* ============================================
   TechDZ Admin — Styles
   ============================================ */

:root {
  --bg-primary: #0B1120;
  --bg-secondary: #0F172A;
  --bg-card: rgba(15, 23, 42, 0.6);
  --text-primary: #F1F5F9;
  --text-secondary: #A6B4C9;
  --text-muted: #8593A8;
  --border-color: rgba(148, 163, 184, 0.14);
  --primary: #2E6BFF;
  --primary-hover: #1D5AF0;
  --primary-glow: rgba(46, 107, 255, 0.35);
  --secondary: #14B8A6;
  --secondary-hover: #0FA395;
  --red: #EF4444;
  --amber: #F59E0B;
  --accent: #D9A441;
  --accent-glow: rgba(217, 164, 65, 0.28);
  --success: #22C55E;
  --warning: #F59E0B;
  --error: #EF4444;
  --info: #38BDF8;
  --gradient-primary: linear-gradient(135deg, #2E6BFF, #14B8A6);
  --gradient-gold: linear-gradient(135deg, #D9A441, #E6B45A);
  --font-primary: 'Inter', -apple-system, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-md: 0 4px 12px rgba(0,0,0,0.25);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.3);
  --transition: 0.3s cubic-bezier(0.4,0,0.2,1);
}

/* Palette du réseau de nœuds par thème (identité partagée) */
[data-bg-theme="signal"] { --node-primary: 46,107,255; --node-accent: 20,184,166; }
[data-bg-theme="code"]   { --node-primary: 46,107,255; --node-accent: 56,189,248; --node-alpha: 0.45; }
[data-bg-theme="fusion"] { --node-primary: 56,189,248; --node-accent: 20,184,166; --node-alpha: 0.5; }
[data-bg-theme="dunes"]  { --node-primary: 217,164,65; --node-accent: 251,191,36; --node-alpha: 0.5; }
[data-bg-theme="nuit"]   { --node-primary: 99,102,241; --node-accent: 168,85,247; --node-alpha: 0.5; }

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-primary); background: var(--bg-primary); color: var(--text-primary); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }
button { border: none; background: none; cursor: pointer; font-family: inherit; color: inherit; }
input { font-family: inherit; outline: none; border: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.9rem; transition: all var(--transition); white-space: nowrap; }
.btn-primary { background: var(--gradient-primary); color: #fff; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 15px var(--primary-glow); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-danger { background: rgba(239,68,68,0.1); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }
.btn-danger:hover { background: rgba(239,68,68,0.2); }

/* Login Page */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-container { width: 100%; max-width: 420px; padding: 24px; }
.login-card { padding: 48px 40px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); }
.login-header { text-align: center; margin-bottom: 32px; }
.login-header img { height: 32px; }
.login-header h1 { font-size: 1.4rem; font-weight: 800; margin-top: 12px; }
.login-header p { color: var(--text-secondary); font-size: 0.9rem; margin-top: 4px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); }
.form-group input, .form-group select, .form-group textarea {
  padding: 12px 16px; background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); color: var(--text-primary); font-size: 0.95rem; transition: all 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-group select { appearance: none; cursor: pointer; }
.login-footer { text-align: center; margin-top: 24px; }
.login-footer a { color: var(--text-secondary); font-size: 0.85rem; }
.login-footer a:hover { color: var(--primary); }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 0.85rem; display: none; margin-bottom: 16px; }
.alert.error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2); color: var(--red); }
.alert.success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.2); color: var(--secondary); }

/* Admin Layout */
.admin-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-header {
  padding: 0 24px 24px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-header img { height: 28px; margin-bottom: 8px; }
.sidebar-header p { font-size: 0.78rem; color: var(--text-muted); }

.sidebar-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.sidebar-link:hover { background: rgba(59,130,246,0.08); color: var(--text-primary); }
.sidebar-link.active { background: rgba(59,130,246,0.12); color: var(--primary); font-weight: 600; }
.sidebar-link i { width: 20px; text-align: center; font-size: 0.9rem; }

.sidebar-link .badge {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(59,130,246,0.12);
  color: var(--primary);
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: var(--gradient-primary);
}

.sidebar-user-info strong { display: block; font-size: 0.85rem; }
.sidebar-user-info span { font-size: 0.75rem; color: var(--text-muted); }

/* Main Content */
.main-content {
  flex: 1;
  min-width: 0;
  margin-left: 260px;
  padding: 32px;
  position: relative;
  z-index: 1;
}

/* Réseau de nœuds connectés — fond animé global (identité partagée) */
.network-bg,
.dunes-bg,
.nuit-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

/* Ciel d'ambiance (encre WebGL) */
body > [data-ink-version] { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* Theme Picker (fond + logo : code / signal / fusion) */
.theme-picker { position: relative; }

.theme-picker-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
}

.theme-picker-btn:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary);
}

.theme-picker-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 235px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: var(--transition);
  overflow: hidden;
  z-index: 100;
}

.theme-picker-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.theme-picker-header {
  padding: 10px 14px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  text-align: left;
  color: var(--text-secondary);
  transition: var(--transition);
}

.theme-option:hover {
  background: rgba(59, 130, 246, 0.06);
  color: var(--text-primary);
}

.theme-option.active {
  color: var(--primary);
  background: rgba(59, 130, 246, 0.08);
}

.theme-option-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.theme-option-text strong { font-size: 0.85rem; font-weight: 600; }
.theme-option-text small { font-size: 0.72rem; color: var(--text-muted); }

.theme-check {
  margin-left: auto;
  opacity: 0;
  transition: opacity var(--transition);
}

.theme-option.active .theme-check { opacity: 1; }

.theme-swatch {
  flex-shrink: 0;
  width: 44px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.swatch-code {
  background: radial-gradient(ellipse 70% 45% at 50% 25%, rgba(4, 40, 91, 0) 0%, rgba(4, 40, 91, 0.9) 100%), linear-gradient(#0B1E3F, #04285B);
}

.swatch-code::after {
  content: '</>';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #7DD3FC;
}

.swatch-signal { background: linear-gradient(160deg, #0F172A, #0B1120); }

.swatch-signal::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle 2px at 22% 30%, rgba(59, 130, 246, 0.9) 50%, transparent 51%),
    radial-gradient(circle 2px at 70% 65%, rgba(16, 185, 129, 0.9) 50%, transparent 51%),
    radial-gradient(circle 2px at 45% 85%, rgba(59, 130, 246, 0.8) 50%, transparent 51%),
    radial-gradient(circle 2px at 82% 22%, rgba(59, 130, 246, 0.7) 50%, transparent 51%),
    radial-gradient(circle 2px at 12% 72%, rgba(16, 185, 129, 0.7) 50%, transparent 51%);
}

.swatch-signal::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #3B82F6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25), 0 0 0 8px rgba(59, 130, 246, 0.12);
}

.swatch-fusion {
  background: radial-gradient(ellipse 60% 40% at 50% 30%, #0560E3 0%, #04285B 70%, #0B1120 100%);
}

.swatch-fusion::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
}

.swatch-dunes {
  background: linear-gradient(180deg, #4C1D95 0%, #B45309 55%, #D97706 100%);
}

.swatch-dunes::before {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  top: 55%;
  background-image:
    radial-gradient(ellipse 50% 130% at 10% 100%, rgba(253, 230, 138, 0.95), transparent 70%),
    radial-gradient(ellipse 50% 130% at 42% 100%, rgba(253, 230, 138, 0.95), transparent 70%),
    radial-gradient(ellipse 50% 130% at 74% 100%, rgba(253, 230, 138, 0.95), transparent 70%),
    radial-gradient(ellipse 50% 130% at 106% 100%, rgba(253, 230, 138, 0.95), transparent 70%);
}

.swatch-dunes::after {
  content: '';
  position: absolute;
  top: 24%;
  left: auto;
  right: 22%;
  width: 13px;
  height: 13px;
  transform: none;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #FEF3C7, #F59E0B 62%);
  box-shadow: 0 0 7px rgba(245, 158, 11, 0.85);
}

.swatch-nuit {
  background: linear-gradient(180deg, #0B1026 0%, #1E1B4B 55%, #3730A3 100%);
}

.swatch-nuit::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle 1.5px at 20% 30%, rgba(255, 255, 255, 0.95) 50%, transparent 51%),
    radial-gradient(circle 1.5px at 70% 18%, rgba(255, 255, 255, 0.9) 50%, transparent 51%),
    radial-gradient(circle 1.5px at 45% 68%, rgba(255, 255, 255, 0.9) 50%, transparent 51%),
    radial-gradient(circle 1px at 85% 52%, rgba(255, 255, 255, 0.85) 50%, transparent 51%),
    radial-gradient(circle 1px at 12% 62%, rgba(255, 255, 255, 0.8) 50%, transparent 51%);
}

.swatch-nuit::after {
  content: '';
  position: absolute;
  top: 24%;
  left: auto;
  right: 24%;
  width: 11px;
  height: 11px;
  transform: none;
  border-radius: 50%;
  background: #E0E7FF;
  box-shadow: 0 0 8px rgba(199, 210, 254, 0.9);
}

/* Pages de login admin : sélecteur en haut à droite */
.theme-picker-fixed {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 3;
}

/* Sidebar : menu qui s'ouvre vers le haut */
.theme-picker-up .theme-picker-menu {
  top: auto;
  bottom: calc(100% + 8px);
  transform: translateY(8px);
}

.theme-picker-up .theme-picker-menu.open { transform: translateY(0); }

/* Sidebar : palette alignée à droite dans le pied de la sidebar */
.sidebar-footer .theme-picker {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

[dir="rtl"] .theme-option { text-align: right; }
[dir="rtl"] .theme-check { margin-left: 0; margin-right: auto; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.page-header h1 { font-size: 1.75rem; font-weight: 800; }
.page-header p { color: var(--text-secondary); font-size: 0.9rem; margin-top: 4px; }

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  padding: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
}

.stat-card:hover { border-color: rgba(59,130,246,0.2); }

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.stat-card-icon.blue { background: rgba(59,130,246,0.1); color: var(--primary); }
.stat-card-icon.green { background: rgba(16,185,129,0.1); color: var(--secondary); }
.stat-card-icon.purple { background: rgba(139,92,246,0.1); color: var(--accent); }
.stat-card-icon.amber { background: rgba(245,158,11,0.1); color: var(--amber); }
.stat-card-icon.teal { background: rgba(20,184,166,0.1); color: #14b8a6; }
.stat-card-icon.red { background: rgba(239,68,68,0.1); color: var(--red); }

.stat-card-value { font-size: 2rem; font-weight: 800; }
.stat-card-label { font-size: 0.85rem; color: var(--text-secondary); margin-top: 4px; }

/* Table */
.table-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.table-header h2 { font-size: 1.1rem; font-weight: 700; }

.table-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.table-search input {
  background: transparent;
  color: var(--text-primary);
  font-size: 0.85rem;
  width: 200px;
}

.table-search input::placeholder { color: var(--text-muted); }

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

thead th {
  padding: 12px 20px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  background: rgba(255,255,255,0.02);
}

tbody td {
  padding: 14px 20px;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border-color);
}

tbody tr:hover { background: rgba(59,130,246,0.03); }
tbody tr:last-child td { border-bottom: none; }

.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-cell-avatar {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  background: var(--gradient-primary);
  flex-shrink: 0;
}

.role-badge {
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
}

.role-badge.admin { background: rgba(239,68,68,0.1); color: var(--red); }
.role-badge.moderator { background: rgba(245,158,11,0.1); color: var(--amber); }
.role-badge.member { background: rgba(59,130,246,0.1); color: var(--primary); }
.role-badge.remote { background: rgba(16,185,129,0.1); color: var(--secondary); }
.role-badge.hybrid { background: rgba(139,92,246,0.1); color: var(--accent); }
.role-badge.onsite { background: rgba(59,130,246,0.1); color: var(--primary); }
.role-badge.beginner { background: rgba(16,185,129,0.1); color: var(--secondary); }
.role-badge.intermediate { background: rgba(245,158,11,0.1); color: var(--amber); }
.role-badge.advanced { background: rgba(239,68,68,0.1); color: var(--red); }

.status-badge {
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
}

.status-badge.active { background: rgba(16,185,129,0.1); color: var(--secondary); }
.status-badge.inactive { background: rgba(239,68,68,0.1); color: var(--red); }

.actions-cell { display: flex; gap: 6px; }
.actions-cell button {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: all 0.2s;
}
.actions-cell button:hover { background: rgba(59,130,246,0.1); color: var(--primary); }
.actions-cell button.edit:hover { background: rgba(16,185,129,0.1); color: var(--secondary); }
.actions-cell button.delete:hover { background: rgba(239,68,68,0.1); color: var(--red); }

/* Sélecteur de rôle (tableau utilisateurs) */
.role-select {
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  appearance: none;
}
.role-select.admin { background: rgba(239,68,68,0.1); color: var(--red); border-color: rgba(239,68,68,0.2); }
.role-select.moderator { background: rgba(245,158,11,0.1); color: var(--amber); border-color: rgba(245,158,11,0.2); }
.role-select.member { background: rgba(59,130,246,0.1); color: var(--primary); border-color: rgba(59,130,246,0.2); }
.role-select:disabled { opacity: 0.5; cursor: not-allowed; }

/* Pagination */
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
}

.table-pagination span { font-size: 0.8rem; color: var(--text-muted); }

.pagination-btns { display: flex; gap: 6px; }
.pagination-btns button {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  transition: all 0.2s;
}
.pagination-btns button:hover { border-color: var(--primary); color: var(--primary); }
.pagination-btns button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination-btns button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination-btns button:disabled:hover { border-color: var(--border-color); color: var(--text-secondary); }

/* Hidden sections */
.admin-section { display: none; }
.admin-section.active { display: block; }

/* Mobile */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 20px; }
  .stats-grid { grid-template-columns: 1fr; }
  .table-search input { width: 140px; }
  .table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-header { flex-wrap: wrap; gap: 10px; }
  .table-pagination { flex-wrap: wrap; gap: 8px; }
  .pagination-btns { flex-wrap: wrap; }
}

/* ============================================
   Modal Styles
   ============================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal {
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 32px;
  position: relative;
}
.modal h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 20px; color: var(--text-primary); }
.modal .form-group { margin-bottom: 14px; }
.modal .form-group label {
  font-size: 0.82rem; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 4px; display: block;
}
.modal .form-group input,
.modal .form-group select,
.modal .form-group textarea {
  width: 100%; padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9rem; font-family: inherit;
}
.modal .form-group input:focus,
.modal .form-group select:focus,
.modal .form-group textarea:focus {
  border-color: var(--primary); outline: none;
}
.modal .form-group textarea { min-height: 100px; resize: vertical; }
.modal .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); background: none; border: none; cursor: pointer;
}
.modal-close:hover { background: rgba(239,68,68,0.1); color: var(--red); }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; }
.modal-actions .btn-outline {
  padding: 10px 20px; border-radius: 8px;
  border: 1px solid var(--border-color);
  background: transparent; color: var(--text-secondary);
  font-weight: 600; font-size: 0.85rem; cursor: pointer;
}
.modal-actions .btn-outline:hover { border-color: var(--primary); color: var(--primary); }

/* ============================================
   Cloudflare Turnstile — wrapper du widget
   ============================================ */
#turnstile-widget {
  position: relative;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  overflow: hidden;
  background: var(--bg-card, rgba(15, 23, 42, 0.35));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
/* État de chargement (avant le rendu Cloudflare) : icône de sécurisation + spinner */
#turnstile-widget::before {
  content: '\f023';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 1.15rem;
  color: var(--text-muted);
  animation: turnstile-pulse 1.4s ease-in-out infinite;
}
#turnstile-widget::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: turnstile-spin 0.9s linear infinite;
}
@keyframes turnstile-spin {
  to { transform: rotate(360deg); }
}
@keyframes turnstile-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
/* Widget rendu : on masque le spinner, on garde le cadre discret */
#turnstile-widget.captcha-loaded::before,
#turnstile-widget.captcha-loaded::after {
  display: none;
}
#turnstile-widget.captcha-loaded {
  background: var(--bg-card);
  border-color: var(--border-color);
}
/* Captcha résolu : bordure verte + halo léger */
#turnstile-widget.captcha-success {
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14);
}
/* L'iframe injectée par Cloudflare est centrée par le flex du conteneur */
#turnstile-widget iframe {
  margin: 0 auto;
  max-width: 100%;
}
