/* --- Reset minimaliste + theme sombre --- */
*,
*::before,
*::after { box-sizing: border-box; }

:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --surface-2: #232323;
  --border: #2a2a2a;
  --text: #f4f4f5;
  --muted: #9a9aa1;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.01em; margin: 0 0 0.6em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }

p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.accent { color: var(--accent); }

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Header --- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(15, 15, 15, 0.9);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--text);
  font-size: 1.1rem;
}
.brand:hover { color: var(--text); }
.brand-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.nav a {
  color: var(--muted);
  font-weight: 500;
}
.nav a:hover { color: var(--text); }
.nav-admin {
  color: var(--accent) !important;
  font-weight: 600 !important;
}
.credits-badge {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text);
}

/* --- Main / Footer --- */
.main-content {
  flex: 1;
  padding: 40px 24px 80px;
}
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.95rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  font-family: inherit;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); color: white; }
.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-block { width: 100%; }

/* --- Cards --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

/* --- Hero --- */
.hero {
  text-align: center;
  padding: 80px 0 60px;
}
.hero h1 {
  font-size: 2.6rem;
  max-width: 820px;
  margin: 0 auto 16px;
  line-height: 1.2;
}
.hero-subtitle {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 580px;
  margin: 0 auto 32px;
}
.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Offres --- */
.offers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin: 40px 0;
}
.offer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.offer-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}
.offer-header h2 { margin: 0 0 6px; }
.offer-price { display: flex; align-items: baseline; gap: 6px; }
.offer-price .price {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent);
}
.offer-price .price-unit { color: var(--muted); font-size: 0.9rem; }
.offer-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.offer-features li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}
.offer-features li:last-child { border-bottom: none; }
.offer-features strong { color: var(--text); }

/* --- Features (page d'accueil) --- */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin: 60px 0 30px;
}
.feature {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

/* --- Forms --- */
form label {
  display: block;
  margin-bottom: 14px;
  font-size: 0.9rem;
  color: var(--muted);
}
form input, form select, form textarea {
  display: block;
  width: 100%;
  padding: 11px 14px;
  margin-top: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
}
form input:focus, form select:focus, form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
form small {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--muted);
}
.form-card { max-width: 420px; margin: 0 auto; }
.form-footer {
  text-align: center;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.9rem;
}
.auth-form {
  max-width: 480px;
  margin: 40px auto;
}
.auth-form h1 { text-align: center; }
.auth-subtitle {
  text-align: center;
  color: var(--muted);
  margin-bottom: 24px;
}

/* --- Alerts --- */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  border: 1px solid;
  font-size: 0.95rem;
}
.alert-error {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}
.alert-success {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.4);
  color: #86efac;
}

/* --- Layouts grilles --- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

/* --- Page header --- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 24px;
  gap: 12px;
  flex-wrap: wrap;
}
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* --- Dashboard / serveurs --- */
.empty-state { text-align: center; padding: 40px 24px; }
.server-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.server-card { display: flex; flex-direction: column; gap: 14px; }
.server-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.server-header h2 { margin: 0; }
.server-meta {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* --- Status pill --- */
.status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: capitalize;
}
.status-active {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
}
.status-suspended {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

/* --- Badges role --- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.badge-user {
  background: var(--surface-2);
  color: var(--muted);
}
.badge-admin {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}

/* --- Tables --- */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th, .data-table td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.data-table thead th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table code {
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', 'Consolas', monospace;
  font-size: 0.85rem;
}

/* --- Stat cards admin --- */
.stat-card {
  text-align: center;
}
.stat-card h2 {
  font-size: 2.6rem;
  color: var(--accent);
  margin: 0 0 4px;
}

/* --- Key/value list (compte) --- */
.kv {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 16px;
  margin: 0;
}
.kv dt { color: var(--muted); font-size: 0.9rem; }
.kv dd { margin: 0; word-break: break-word; }

/* --- Reveal pass --- */
.reveal { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.reveal .masked { font-family: 'SF Mono', 'Consolas', monospace; }
.reveal.revealed .masked { color: var(--accent); }

/* --- Big number --- */
.big-number {
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0;
}

/* --- Error page --- */
.error-page {
  text-align: center;
  padding: 80px 0;
}

/* --- Alerts info (banniere dashboard) --- */
.alert-info {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.4);
  color: #93c5fd;
}

/* --- Statuts supplementaires (file de configuration) --- */
.status-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
}
.status-done {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
}

/* --- Carte stat coloree (admin) --- */
.stat-card-warning {
  border-color: rgba(245, 158, 11, 0.6);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.08), var(--surface));
}
.stat-card-warning h2 { color: var(--warning); }
.stat-card-muted h2 { color: var(--muted); }

/* --- Pending configs --- */
.pending-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.pending-card { display: flex; flex-direction: column; gap: 14px; }
.pending-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.pending-head h2 { margin: 0 0 4px; }

/* --- Blocs de code copyables --- */
.code-block {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.code-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
}
.code-block pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: 'SF Mono', 'Consolas', monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text);
  white-space: pre;
}
.code-block code { font-family: inherit; }

/* --- Avertissement port manquant --- */
.port-warn {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #fca5a5 !important;
}

/* --- Responsive --- */
@media (max-width: 720px) {
  .hero h1 { font-size: 2rem; }
  .header-inner { flex-direction: column; height: auto; padding: 16px 0; gap: 12px; }
  .nav { justify-content: center; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { margin-top: 6px; }
  .page-header { flex-direction: column; align-items: flex-start; }
}
