/* ===========================================================================
   Système visuel BUILD — repris de DESIGN_TOKENS.md (source : build-studio.html).
   Noir absolu, bleu, cube, sobre. Aucune couleur inventée.
   =========================================================================== */

:root {
  --bg: #000000;
  --panel: #05070e;
  --panel-2: #080c17;
  --navy: #0e2a5e;
  --line: rgba(255, 255, 255, 0.1);
  --line-2: rgba(255, 255, 255, 0.16);
  --blue: #2f6bff;
  --blue-2: #7aa6ff;
  --text: #ffffff;
  --muted: #c2c9da;
  --muted-2: #808aa0;
  --danger: #ff5c5c;
  --ok: #58d38c;
  --grad: linear-gradient(125deg, #21539f 0%, #0c265c 100%);
  --grad-text: linear-gradient(95deg, #9cbcff, #3f78ff);
  --grad-soft: linear-gradient(120deg, rgba(47, 107, 255, 0.16), rgba(20, 50, 120, 0.2));
  --r: 18px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  background: var(--bg);
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: 'General Sans', system-ui, -apple-system, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Halo bleu diffus, discret — jamais assez fort pour laver le noir. */
body::before {
  content: '';
  position: fixed;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(47, 107, 255, 0.14), transparent 62%);
  filter: blur(100px);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  margin: auto;
  padding: 40px 24px;
}

.wrap--wide {
  max-width: 760px;
}

/* --- Logo BUILD : cube isométrique + wordmark ---------------------------- */

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
}

.brand svg {
  width: 34px;
  height: 34px;
}

.brand .word {
  font-family: 'Clash Display', sans-serif;
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.brand .word .dot {
  color: var(--blue-2);
}

/* --- Carte / panneau ----------------------------------------------------- */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 32px 28px;
}

h1 {
  font-family: 'Clash Display', sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 26px;
  margin: 0 0 8px;
}

.sub {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
  margin: 0 0 26px;
}

/* --- Eyebrow (label mono) ------------------------------------------------ */

.eyebrow {
  font-family: 'Spline Sans Mono', monospace;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue-2);
  margin: 0 0 14px;
}

/* --- Champs de formulaire ------------------------------------------------ */

.field {
  margin-bottom: 18px;
}

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 7px;
}

input[type='email'],
input[type='password'],
input[type='text'] {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  color: var(--text);
  font-size: 15px;
  padding: 13px 14px;
  font-family: inherit;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.18);
}

.hint {
  font-size: 12px;
  color: var(--muted-2);
  margin-top: 7px;
}

/* --- Boutons ------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: 0;
  border-radius: 100px;
  padding: 13px 20px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--grad);
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), opacity 0.2s;
}

.btn:hover {
  box-shadow: 0 8px 30px rgba(47, 107, 255, 0.32);
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-2);
}

.btn--ghost:hover {
  box-shadow: none;
  border-color: var(--blue);
}

/* --- Liens --------------------------------------------------------------- */

.links {
  margin-top: 22px;
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
}

a {
  color: var(--blue-2);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* --- Messages (erreur / succès) ------------------------------------------ */

.msg {
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.45;
  margin-bottom: 20px;
  display: none;
}

.msg.show {
  display: block;
}

.msg--error {
  background: rgba(255, 92, 92, 0.1);
  border: 1px solid rgba(255, 92, 92, 0.32);
  color: #ffc9c9;
}

.msg--ok {
  background: rgba(88, 211, 140, 0.1);
  border: 1px solid rgba(88, 211, 140, 0.32);
  color: #bff0d3;
}

/* --- Espace : cartes de tenants ------------------------------------------ */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
}

.who {
  font-size: 13px;
  color: var(--muted-2);
}

.who b {
  color: var(--muted);
  font-weight: 500;
}

.tenant-grid {
  display: grid;
  gap: 16px;
}

.tenant {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px 24px;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease);
}

.tenant:hover {
  transform: translateY(-4px);
  border-color: var(--line-2);
}

.tenant-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 4px;
}

.tenant-name {
  font-family: 'Clash Display', sans-serif;
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.tenant-role {
  font-family: 'Spline Sans Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-2);
}

.tenant-slug {
  font-family: 'Spline Sans Mono', monospace;
  font-size: 12px;
  color: var(--muted-2);
  margin-bottom: 16px;
}

.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tool {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 100px;
  padding: 8px 15px;
  font-size: 13.5px;
  color: var(--text);
}

.tool:hover {
  border-color: var(--blue);
  text-decoration: none;
}

.tools-empty {
  font-size: 13px;
  color: var(--muted-2);
}

.suspended {
  border-color: rgba(255, 92, 92, 0.3);
}

.suspended-tag {
  font-family: 'Spline Sans Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--danger);
}

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

.spinner {
  color: var(--muted-2);
  font-size: 13.5px;
  text-align: center;
  padding: 20px 0;
}

.logout {
  background: none;
  border: 0;
  color: var(--muted-2);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}

.logout:hover {
  color: var(--text);
}

/* --- Administration ------------------------------------------------------ */

.admin-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 26px 26px;
  margin-bottom: 20px;
}

.admin-section h2 {
  font-family: 'Clash Display', sans-serif;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
}

.row-inline {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.row-inline .field {
  flex: 1;
  min-width: 160px;
  margin-bottom: 0;
}

.row-inline .btn {
  width: auto;
  padding: 13px 26px;
  white-space: nowrap;
}

select {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  color: var(--text);
  font-size: 15px;
  padding: 13px 14px;
  font-family: inherit;
}

select:focus {
  outline: none;
  border-color: var(--blue);
}

.tenant-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 10px;
}

.tenant-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.tenant-row-title {
  font-weight: 600;
  font-size: 15.5px;
}

.tenant-row-meta {
  font-family: 'Spline Sans Mono', monospace;
  font-size: 12px;
  color: var(--muted-2);
}

.member-list {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: none;
}

.member-list.show {
  display: block;
}

.member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  padding: 6px 0;
}

.member .email {
  color: var(--text);
}

.member .meta {
  font-family: 'Spline Sans Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.badge-pending {
  color: #ffcf8f;
}

.badge-active {
  color: var(--ok);
}

.admin-link {
  font-size: 13px;
}

.rgpd-actions {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 18px;
}

.rgpd-link {
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--blue-2);
  cursor: pointer;
}

.rgpd-link:hover {
  text-decoration: underline;
}

.rgpd-danger {
  color: var(--danger);
}
