/* Installateur : les couleurs, rayons et contrôles de l'admin de The Grid (src/web/palette.css et
   src/web/admin/admin.css), recopiés : pas de code partagé entre les deux dépôts (fiche 0001).
   Un état ne passe jamais par la couleur seule : il a toujours son mot. */
:root {
  color-scheme: light dark;
  --bg: light-dark(#f4f4f4, #181818);
  --surface: light-dark(#ffffff, #262626);
  --container: light-dark(#ebebeb, #303030);
  --control: light-dark(#e2e2e2, #474747);
  --control-hover: light-dark(#d5d5d5, #4c4c4c);
  --text: light-dark(#262626, #ebebeb);
  --muted: light-dark(#555555, #c9c9c9);
  --primary: light-dark(#555555, #cccccc);
  --on-primary: light-dark(#ffffff, #222222);
  --primary-hover: light-dark(#4b4b4b, #d2d2d2);
  --focus: light-dark(#555555, #cccccc);
  --success-bg: light-dark(#5fd08a, #0f3a22);
  --warning-bg: light-dark(#ffd24d, #402c05);
  --danger-bg: light-dark(#ee6a5e, #45161a);
  --border-subtle: light-dark(#cccccc, #5e5e5e);
  --shadow-panel: 0 1px 2px light-dark(rgb(0 0 0 / 6%), rgb(0 0 0 / 30%)), 0 6px 20px light-dark(rgb(0 0 0 / 8%), rgb(0 0 0 / 45%));
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-xl: 28px;
  --radius-pill: 999px;
  --control-height: 2.75rem;

  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
}

body {
  margin: 0;
}

.page {
  width: min(100% - 2rem, 52rem);
  margin: 0 auto;
  padding: 8vh 0 4rem;
}

.page-narrow {
  width: min(100% - 2rem, 32rem);
}

header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.logo {
  display: block;
  width: 176px;
  height: 40px;
  background: url('/the-grid-logo-light.svg') left center / contain no-repeat;
  background-image: light-dark(url('/the-grid-logo-light.svg'), url('/the-grid-logo-dark.svg'));
}

.subtitle {
  color: var(--muted);
}

h1 {
  margin: 0 0 1rem;
  font-size: 1.3rem;
}

h2 {
  margin: 0 0 0.8rem;
  font-size: 1rem;
}

p {
  margin: 0 0 0.8rem;
}

a {
  color: inherit;
}

code,
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.panel {
  margin-bottom: 1.25rem;
  padding: 1.2rem 1.4rem;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-panel);
}

.hint {
  font-size: 0.85rem;
  color: var(--muted);
}

form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.9rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.6rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  width: min(100%, 24rem);
  font-size: 0.9rem;
}

input {
  box-sizing: border-box;
  width: 100%;
  height: var(--control-height);
  padding: 0 1rem;
  font: inherit;
  color: var(--text);
  background: var(--control);
  border: 0;
  border-radius: var(--radius-pill);
}

button {
  height: var(--control-height);
  padding: 0 1.1rem;
  font: inherit;
  color: var(--text);
  background: var(--control);
  border: 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: var(--control-hover);
}

button.primary {
  color: var(--on-primary);
  background: var(--primary);
}

button.primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

:is(button, input, a):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* Messages : un mot en tête (Erreur, Attention, Prêt) porte le sens, la couleur ne fait que l'appuyer. */
.notice {
  align-self: stretch;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  overflow-wrap: anywhere;
}

.notice strong {
  margin-right: 0.3rem;
}

.notice-error {
  background: var(--danger-bg);
}

.notice-warning {
  background: var(--warning-bg);
}

.notice-success {
  background: var(--success-bg);
}

/* Valeur à recopier (lien d'invitation, code de création) : grande, sélectionnable. */
.secret {
  display: block;
  padding: 0.7rem 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.05rem;
  background: var(--container);
  border-radius: var(--radius-sm);
  overflow-wrap: anywhere;
  user-select: all;
}

.secret-big {
  font-size: 1.6rem;
  letter-spacing: 0.08em;
}

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

th,
td {
  padding: 0.55rem 0.5rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border-subtle);
}

th {
  font-weight: 600;
  color: var(--muted);
}

td button {
  height: 2rem;
  padding: 0 0.8rem;
}

/* Champ suivi du domaine des instances : grand-nom.lab.highten.com */
.with-suffix {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.with-suffix span {
  color: var(--muted);
  white-space: nowrap;
}
