/* server-monitor — base commune (couleurs, typographie) et page de connexion. Fichier public. */

:root {
  --bg: #f2f4f7;
  --card: #ffffff;
  --text: #1a1d23;
  --muted: #5f6672;
  --line: #dde1e7;
  --accent: #1f5fbf;
  --accent-text: #ffffff;
  --focus: #1f5fbf;

  --ok: #1e7b34;      --ok-bg: #e5f4e8;     --ok-edge: #2e9e4a;
  --warn: #8a5300;    --warn-bg: #fff2d9;   --warn-edge: #e08a00;
  --crit: #b3261e;    --crit-bg: #fde5e3;   --crit-edge: #d93025;
  --err: #6a3fa0;     --err-bg: #f0e8fb;    --err-edge: #8a5cc4;
  --info: #3d5a80;    --info-bg: #e7eef7;   --info-edge: #9fb3cc;

  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216;
    --card: #191d23;
    --text: #e7e9ec;
    --muted: #9ba3ae;
    --line: #2a3038;
    --accent: #6ea2f5;
    --accent-text: #0b1220;
    --focus: #8ab4f8;

    --ok: #7bd389;      --ok-bg: #16281a;     --ok-edge: #3f9a52;
    --warn: #ffc266;    --warn-bg: #33260c;   --warn-edge: #e0a03a;
    --crit: #ff8a80;    --crit-bg: #3a1513;   --crit-edge: #e5534b;
    --err: #c9a7ff;     --err-bg: #2a2140;    --err-edge: #9b7ad6;
    --info: #9cb8de;    --info-bg: #1b2533;   --info-edge: #4a5d78;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  overflow-wrap: anywhere;
}
a { color: var(--accent); }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Pastille d'état : icône + libellé, jamais la couleur seule. */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 999px;
  font-size: .78rem; font-weight: 700; white-space: nowrap;
  border: 1px solid transparent;
}
.pill.lvl-ok   { color: var(--ok);   background: var(--ok-bg);   border-color: var(--ok-edge); }
.pill.lvl-warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-edge); }
.pill.lvl-crit { color: var(--crit); background: var(--crit-bg); border-color: var(--crit-edge); }
.pill.lvl-err  { color: var(--err);  background: var(--err-bg);  border-color: var(--err-edge); }
.pill.lvl-info { color: var(--info); background: var(--info-bg); border-color: var(--info-edge); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 36px; padding: 6px 12px;
  border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); cursor: pointer; font-weight: 600;
}
.btn-ghost { background: transparent; }

/* ── page de connexion ── */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card {
  width: 100%; max-width: 380px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); padding: 24px 20px;
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.brand img { border-radius: 10px; flex: none; }
.brand h1 { margin: 0; font-size: 1.25rem; }
.brand p { margin: 2px 0 0; }
.login-card form { display: flex; flex-direction: column; gap: 6px; }
.login-card label { font-weight: 600; font-size: .9rem; margin-top: 8px; }
.login-card input[type=text], .login-card input[type=password] {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
  font-size: 16px; /* évite le zoom automatique sur iOS */
}
.pw { position: relative; }
.pw input { padding-right: 92px !important; }
.toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  min-height: 32px; padding: 4px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: .85rem; font-weight: 600;
}
.primary {
  margin-top: 16px; min-height: 46px; border: 0; border-radius: 10px;
  background: var(--accent); color: var(--accent-text); font-weight: 700; cursor: pointer; font-size: 1rem;
}
.alert { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; font-weight: 600; border: 1px solid; }
.alert-error { color: var(--crit); background: var(--crit-bg); border-color: var(--crit-edge); }
.alert-ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-edge); }
.login-card .small { margin: 16px 0 0; text-align: center; }
