/* ─── Design tokens — matches quirkycarlos.uk ─────────────────────────────── */
:root {
  --bg: #030503;
  --surface: rgba(5, 7, 6, 0.9);
  --surface-soft: rgba(10, 16, 11, 0.78);
  --surface-deep: rgba(10, 0, 20, 0.72);
  --text: #efffed;
  --muted: #9fbea4;
  --line: rgba(57, 255, 20, 0.32);
  --line-purple: rgba(123, 44, 255, 0.46);
  --brand: #39FF14;
  --brand-ink: #c8ffbf;
  --purple: #b026ff;
  --purple-mid: #7b2cff;
  --red: #f04747;
  --yellow: #faa61a;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow-lg: 0 0 44px rgba(57, 255, 20, 0.12), 0 24px 70px rgba(0, 0, 0, 0.62);
  --shadow-sm: 0 0 24px rgba(57, 255, 20, 0.1), 0 8px 26px rgba(0, 0, 0, 0.48);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(57, 255, 20, 0.13), transparent 24%),
    linear-gradient(230deg, rgba(176, 38, 255, 0.18), transparent 30%),
    linear-gradient(180deg, #030503 0%, #060708 48%, #020302 100%);
}

/* ─── bg overlays ────────────────────────────────────────────────────────── */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  opacity: 0.3;
  background-image:
    linear-gradient(rgba(57, 255, 20, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(57, 255, 20, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,0.74) 56%, transparent 100%);
  pointer-events: none;
}

.bg-noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.1;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.4) 1px, transparent 0);
  background-size: 3px 3px;
}

a { color: var(--brand-ink); text-decoration: none; text-shadow: 0 0 12px rgba(57, 255, 20, 0.18); }
a:hover { color: var(--brand); }

/* ─── nav ─────────────────────────────────────────────────────────────────── */
nav {
  position: sticky;
  top: 12px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin: 12px auto;
  max-width: min(1000px, calc(100% - 32px));
  border: 1px solid rgba(57, 255, 20, 0.38);
  background:
    linear-gradient(90deg, rgba(3, 5, 3, 0.95), rgba(14, 0, 24, 0.86)),
    rgba(3, 5, 3, 0.9);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: 8px;
  padding: 6px 10px 6px 6px;
  font-weight: 700;
  color: var(--text);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  text-decoration: none;
}

.nav-icon {
  font-size: 1.35rem;
  color: var(--brand);
  filter: drop-shadow(0 0 8px rgba(57, 255, 20, 0.7));
  line-height: 1;
}

.nav-brand-text {
  color: var(--brand);
  text-shadow:
    0 0 12px rgba(57, 255, 20, 0.42),
    0 0 22px rgba(176, 38, 255, 0.3);
  font-size: 1rem;
  white-space: nowrap;
}

.nav-sub {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: rgba(57, 255, 20, 0.08);
  border: 1px solid rgba(57, 255, 20, 0.24);
  padding: 2px 7px;
  border-radius: 999px;
}

.nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-links a {
  color: var(--muted);
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 7px 11px;
  border: 1px solid transparent;
  transition: 180ms ease;
  font-size: 0.9rem;
  text-shadow: none;
}

.nav-links a:hover {
  color: var(--brand);
  border-color: var(--line);
  background: rgba(57, 255, 20, 0.1);
  box-shadow: 0 0 18px rgba(57, 255, 20, 0.14);
}

.nav-links a.active {
  color: #071000;
  border-color: rgba(57, 255, 20, 0.7);
  background: linear-gradient(130deg, var(--brand), #9dff7f);
  box-shadow:
    0 0 18px rgba(57, 255, 20, 0.32),
    inset 0 0 0 1px rgba(255, 255, 255, 0.28);
  text-shadow: none;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

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

/* ─── main ────────────────────────────────────────────────────────────────── */
main {
  max-width: min(1000px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 3rem;
}

/* ─── page header ──────────────────────────────────────────────────────────── */
.page-header {
  margin: 14px 0 18px;
  padding: clamp(24px, 3.5vw, 36px);
  border: 1px solid rgba(123, 44, 255, 0.52);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 22% 28%, rgba(176, 38, 255, 0.2), transparent 34%),
    radial-gradient(circle at 84% 72%, rgba(57, 255, 20, 0.1), transparent 28%),
    linear-gradient(135deg, #050008, #12001f);
  box-shadow:
    0 0 0 1px rgba(123, 44, 255, 0.16),
    0 0 44px rgba(176, 38, 255, 0.14),
    0 20px 60px rgba(0, 0, 0, 0.48);
  position: relative;
  overflow: hidden;
}

.page-header::after {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  right: -50px;
  top: -50px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(57, 255, 20, 0.14) 0%, rgba(176, 38, 255, 0.18) 50%, transparent 70%);
  pointer-events: none;
}

.page-kicker {
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brand);
  text-shadow: 0 0 14px rgba(57, 255, 20, 0.48);
}

.page-header h1 {
  font-family: "Archivo", "Space Grotesk", sans-serif;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: 0;
  color: #efe7ff;
  text-shadow:
    0 0 18px rgba(176, 38, 255, 0.52),
    0 0 38px rgba(57, 255, 20, 0.2);
}

.page-sub {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 6px;
}

/* ─── sections ─────────────────────────────────────────────────────────────── */
.section {
  background: var(--surface);
  border: 1px solid var(--line-purple);
  border-radius: var(--radius);
  box-shadow:
    inset 0 0 0 1px rgba(176, 38, 255, 0.06),
    0 12px 34px rgba(0, 0, 0, 0.32),
    0 0 24px rgba(123, 44, 255, 0.1);
  backdrop-filter: blur(12px);
  padding: 1.5rem;
  margin-bottom: 14px;
  background:
    radial-gradient(circle at 78% 22%, rgba(176, 38, 255, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(18, 0, 31, 0.78), rgba(5, 0, 8, 0.84));
}

.section h2 {
  font-family: "Archivo", "Space Grotesk", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand);
  text-shadow: 0 0 12px rgba(57, 255, 20, 0.38);
  margin-bottom: 1rem;
}

/* ─── stat cards ───────────────────────────────────────────────────────────── */
.stat-row {
  display: flex;
  gap: 12px;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.stat-card {
  background: rgba(10, 0, 20, 0.72);
  border: 1px solid var(--line-purple);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  min-width: 130px;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.stat-card:hover {
  border-color: var(--brand);
  box-shadow: 0 0 18px rgba(57, 255, 20, 0.14), 0 0 14px rgba(176, 38, 255, 0.18);
}

.stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin-bottom: 5px;
}

.stat-value {
  font-family: "Archivo", "Space Grotesk", sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--brand-ink);
}

.status-ok    { color: var(--brand); text-shadow: 0 0 12px rgba(57, 255, 20, 0.5); }
.status-error { color: var(--red); }
.status-unknown { color: var(--yellow); }

/* ─── table ────────────────────────────────────────────────────────────────── */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th {
  text-align: left;
  color: var(--brand-ink);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

.table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(57, 255, 20, 0.1);
  vertical-align: middle;
  color: var(--muted);
}

.table tr:last-child td { border-bottom: none; }

.table tr:hover td {
  background: rgba(57, 255, 20, 0.04);
  color: var(--text);
}

.mono {
  font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
  font-size: 0.8rem;
  color: var(--brand-ink);
}

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

/* ─── badges ───────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.badge-ok,
.badge-configured {
  background: rgba(57, 255, 20, 0.12);
  color: var(--brand);
  border: 1px solid rgba(57, 255, 20, 0.28);
}

.badge-error {
  background: rgba(240, 71, 71, 0.12);
  color: var(--red);
  border: 1px solid rgba(240, 71, 71, 0.3);
}

.badge-warning {
  background: rgba(250, 166, 26, 0.12);
  color: var(--yellow);
  border: 1px solid rgba(250, 166, 26, 0.28);
}

.badge-not_configured {
  background: rgba(123, 44, 255, 0.12);
  color: var(--muted);
  border: 1px solid var(--line-purple);
}

/* ─── alerts ───────────────────────────────────────────────────────────────── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-success {
  background: rgba(57, 255, 20, 0.08);
  border: 1px solid rgba(57, 255, 20, 0.28);
  color: var(--brand-ink);
}

.alert-error {
  background: rgba(240, 71, 71, 0.08);
  border: 1px solid rgba(240, 71, 71, 0.3);
  color: #ffaaaa;
}

/* ─── buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  padding: 10px 18px;
  transition: 180ms ease;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(130deg, var(--brand), #9dff7f);
  border-color: var(--brand);
  color: #071000;
  box-shadow: 0 0 26px rgba(57, 255, 20, 0.38), 0 0 18px rgba(176, 38, 255, 0.18);
}

.btn-primary:hover {
  background: linear-gradient(130deg, #7cff55, #d3ffc6);
  color: #071000;
  text-shadow: none;
  text-decoration: none;
}

.btn-ghost {
  background: rgba(18, 0, 31, 0.52);
  border-color: rgba(176, 38, 255, 0.62);
  color: #efe7ff;
  box-shadow: 0 0 18px rgba(176, 38, 255, 0.18);
}

.btn-ghost:hover {
  border-color: var(--brand);
  background: rgba(123, 44, 255, 0.26);
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 0 20px rgba(176, 38, 255, 0.28), 0 0 14px rgba(57, 255, 20, 0.16);
}

.btn-discord {
  background: linear-gradient(130deg, #5865f2, #7b2cff);
  border-color: rgba(88, 101, 242, 0.8);
  color: #fff;
  font-size: 1rem;
  padding: 12px 28px;
  box-shadow: 0 0 26px rgba(123, 44, 255, 0.38), 0 0 18px rgba(88, 101, 242, 0.2);
}

.btn-discord:hover {
  background: linear-gradient(130deg, #7b2cff, #5865f2);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 0 36px rgba(123, 44, 255, 0.54);
}

.btn-sm { padding: 6px 14px; font-size: 0.82rem; }

/* ─── form ─────────────────────────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 1.25rem; max-width: 620px; }

.form-group { display: flex; flex-direction: column; gap: 0.4rem; }

.form-group label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-ink);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

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

.input {
  background: rgba(10, 0, 20, 0.72);
  border: 1px solid var(--line-purple);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 13px;
  font-size: 0.9rem;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  width: 100%;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(57, 255, 20, 0.14), 0 0 16px rgba(57, 255, 20, 0.1);
}

.input::placeholder { color: rgba(159, 190, 164, 0.5); }
.textarea { resize: vertical; min-height: 130px; }
.input-color { width: 56px; height: 40px; padding: 2px; cursor: pointer; }
.color-row { display: flex; align-items: center; gap: 0.75rem; }
select.input { cursor: pointer; }

/* ─── trigger cards ────────────────────────────────────────────────────────── */
.trigger-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.trigger-card {
  border: 1px solid var(--line-purple);
  border-radius: 14px;
  background: rgba(10, 0, 20, 0.72);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow:
    inset 0 0 0 1px rgba(176, 38, 255, 0.06),
    0 8px 24px rgba(0, 0, 0, 0.28);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.trigger-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow:
    0 0 26px rgba(176, 38, 255, 0.28),
    0 0 16px rgba(57, 255, 20, 0.18);
}

.trigger-icon {
  font-size: 1.5rem;
  color: var(--brand);
  filter: drop-shadow(0 0 8px rgba(57, 255, 20, 0.6));
  line-height: 1;
}

.trigger-info h3 {
  font-family: "Archivo", "Space Grotesk", sans-serif;
  font-size: 1.06rem;
  font-weight: 700;
  color: #efe7ff;
  letter-spacing: 0;
}

.trigger-info p { font-size: 0.87rem; color: var(--muted); }
.trigger-result { margin-top: 0.25rem; margin-bottom: 0; }

/* ─── login / error ────────────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  border: 1px solid rgba(123, 44, 255, 0.58);
  border-radius: 18px;
  background:
    radial-gradient(circle at 22% 28%, rgba(176, 38, 255, 0.22), transparent 34%),
    radial-gradient(circle at 84% 72%, rgba(57, 255, 20, 0.1), transparent 28%),
    linear-gradient(135deg, #050008, #12001f);
  box-shadow:
    0 0 0 1px rgba(123, 44, 255, 0.18),
    0 0 54px rgba(176, 38, 255, 0.2),
    0 28px 80px rgba(0, 0, 0, 0.58);
  padding: 3rem 2.5rem;
  text-align: center;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.login-logo {
  font-size: 2.8rem;
  color: var(--brand);
  filter: drop-shadow(0 0 18px rgba(57, 255, 20, 0.64)) drop-shadow(0 0 8px rgba(176, 38, 255, 0.4));
  line-height: 1;
}

.login-title {
  font-family: "Archivo", "Space Grotesk", sans-serif;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: 0;
  color: #efe7ff;
  text-shadow:
    0 0 18px rgba(176, 38, 255, 0.4),
    0 0 32px rgba(57, 255, 20, 0.18);
}

.login-sub {
  color: var(--muted);
  font-size: 0.95rem;
}

.login-hint {
  font-size: 0.8rem;
  color: var(--muted);
  border: 1px solid rgba(123, 44, 255, 0.36);
  background: rgba(18, 0, 31, 0.52);
  border-radius: 999px;
  padding: 5px 14px;
  margin-bottom: 0.5rem;
}

/* ─── responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  nav {
    top: 8px;
    margin: 8px auto;
    flex-wrap: wrap;
    gap: 6px;
  }

  .nav-links { flex-wrap: wrap; }

  main { padding: 0 0 2.5rem; }

  .stat-row { flex-direction: column; }

  .trigger-grid { grid-template-columns: 1fr; }
}
