/* Palette et typographies issues de la charte graphique STELLARIX (2022) :
   primaire Vibrant Star Blue #2322F0, neutres Galaxy Black / Space Grey,
   secondaires Navy Cosmos / Sky Blue / Ultra Violet / Planet Pink.
   ARS Maquette Pro / ITC Clearface / Nizzoli sont des polices propriétaires
   non disponibles via Google Fonts : Inter est utilisée comme équivalent
   web le plus proche (à remplacer par les fichiers de police officiels
   si STELLARIX dispose des licences web). */
:root {
  --brand: #2322f0;          /* Vibrant Star Blue */
  --brand-dark: #000046;     /* Navy Cosmos Blue */
  --brand-light: #eceafe;    /* teinte pâle du bleu primaire */
  --text: #101014;           /* proche de Galaxy Black, adouci pour la lecture */
  --muted: #6b6e76;          /* dérivé de Space Grey #939597 */
  --border: #e3e2ef;
  --bg: #f6f6fb;
  --danger: #c62828;
  --danger-bg: #fdecea;
  --ok: #1b7f4c;
  --sky: #00c3f2;
  --sky-bg: #e3f9fe;
  --violet: #8d5fff;
  --violet-bg: #f1ecff;
  --pink: #ed1767;
  --pink-bg: #fde7ee;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.topbar {
  background: var(--brand-dark);
  color: #fff;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar .brand {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.topbar a.logout {
  color: #fff;
  opacity: 0.85;
  text-decoration: none;
  font-size: 0.9rem;
}

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.page-title {
  margin: 0 0 6px;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--brand-dark);
}

.page-subtitle {
  color: var(--muted);
  margin: 0 0 28px;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.section-title {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand);
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.field {
  margin-bottom: 16px;
}

.field label.field-label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 6px;
}

.field .required {
  color: var(--danger);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}

.field textarea { min-height: 80px; resize: vertical; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
}

.option-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.94rem;
  font-weight: 400;
}

.needs-toggle {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.needs-toggle .option-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.needs-toggle .option-card:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-light);
}

.needs-toggle .option-card label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 600;
  cursor: pointer;
}

.conditional-section { display: none; }
.conditional-section.visible { display: block; }

.btn {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.btn:hover { background: var(--brand-dark); }

.btn.secondary {
  background: #fff;
  color: var(--brand);
  border: 1px solid var(--brand);
}

.btn.secondary:hover { background: var(--brand-light); }

.btn-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.alert {
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 0.92rem;
}

.alert.error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #f3c6c2;
}

.alert.success {
  background: #eaf7ef;
  color: var(--ok);
  border: 1px solid #bfe6cd;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

table.data-table th,
table.data-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

table.data-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

table.data-table tr:hover td { background: var(--brand-light); }

.badge {
  display: inline-block;
  background: var(--brand-light);
  color: var(--brand-dark);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-right: 4px;
}

.badge-iaas { background: var(--sky-bg); color: #006a82; }
.badge-backup { background: var(--violet-bg); color: #5a34c4; }
.badge-replication { background: var(--pink-bg); color: var(--pink); }

.login-wrap {
  max-width: 380px;
  margin: 80px auto;
}

.detail-field {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.detail-field .label { color: var(--muted); font-weight: 600; }

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
}

.top-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

/* Utilitaires (remplacent les attributs style="" pour rester compatibles avec une CSP stricte) */
.form-inline { margin: 0; }
.link-button { background: none; border: none; cursor: pointer; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 14px; }
.title-tight { margin-bottom: 2px; }
.subtitle-tight { margin: 0; }
.container-wide { max-width: 1100px; }
.table-scroll { overflow-x: auto; }
.ref-line { color: var(--muted); margin-top: -6px; }
.error-list { margin: 8px 0 0; padding-left: 20px; }
