:root {
  --navy: #0f2a4a;
  --navy-2: #173b66;
  --ink: #1b2533;
  --muted: #5f6b7a;
  --line: #e3e8ef;
  --bg: #f4f6f9;
  --card: #ffffff;
  --brand-a: #4f8ef7;
  --brand-b: #7c3aed;
  --ok: #12805c;
  --ok-bg: #e7f6ef;
  --warn: #9a6700;
  --warn-bg: #fff6dc;
  --bad: #b42318;
  --bad-bg: #fdecea;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .08);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; cursor: pointer; }
input, select { font: inherit; }
a { color: var(--brand-a); }

.hidden { display: none !important; }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 10px;
  padding: 11px 18px; font-weight: 600; font-size: 15px;
  transition: transform .05s ease, box-shadow .15s ease, background .15s ease;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--navy-2); }
.btn-fotoid { background: linear-gradient(135deg, var(--brand-a), var(--brand-b)); color: #fff; box-shadow: 0 6px 16px rgba(79, 142, 247, .35); }
.btn-fotoid:hover:not(:disabled) { box-shadow: 0 8px 22px rgba(124, 58, 237, .35); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: #fff; }
.btn-danger { background: var(--bad-bg); color: var(--bad); }
.btn-block { width: 100%; }

.fotoid-mark {
  width: 22px; height: 22px; border-radius: 7px; display: inline-grid; place-items: center;
  background: rgba(255, 255, 255, .22); font-size: 13px; font-weight: 800; letter-spacing: -.5px;
}

/* ── Form ────────────────────────────────────────────── */
label.field { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  color: var(--ink); font-size: 15px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--brand-a); box-shadow: 0 0 0 3px rgba(79, 142, 247, .18); }

/* ── Badges ──────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-info { background: #eef4ff; color: #2952a3; }

/* ── Spinner ─────────────────────────────────────────── */
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(79, 142, 247, .25); border-top-color: var(--brand-a);
  animation: spin .8s linear infinite; flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px;
  font-size: 14px; box-shadow: var(--shadow); max-width: calc(100% - 32px); z-index: 50;
}
.toast.error { background: var(--bad); }

pre.code {
  font-family: var(--mono); font-size: 12px; background: #0d1422; color: #d7e1f0;
  padding: 14px; border-radius: 10px; overflow: auto; max-height: 280px; margin: 8px 0 0;
  white-space: pre-wrap; word-break: break-all;
}
