:root {
  --bg: #080b16;
  --bg-alt: #0c1122;
  --surface: rgba(22, 30, 53, 0.72);
  --surface-solid: #161e35;
  --surface-2: #1d294a;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #eef1fb;
  --muted: #98a3c4;
  --primary: #5b85ff;
  --primary-600: #3a63e0;
  --accent: #2ee0b0;
  --warn: #f5b14c;
  --danger: #f06b6b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.65);
  --shadow-sm: 0 8px 24px -12px rgba(0, 0, 0, 0.5);
  --ring: 0 0 0 3px rgba(91, 133, 255, 0.28);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv02", "cv03", "cv04", "ss01";
  position: relative;
  min-height: 100vh;
}
/* Ambient-Glow-Hintergrund für Tiefe */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(800px 480px at 88% -8%, rgba(91, 133, 255, 0.16), transparent 60%),
    radial-gradient(680px 420px at 6% 4%, rgba(46, 224, 176, 0.10), transparent 60%),
    radial-gradient(900px 600px at 50% 110%, rgba(91, 133, 255, 0.07), transparent 60%);
  pointer-events: none;
}
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.025em; }
::selection { background: rgba(91, 133, 255, 0.32); }

/* Sanfte Einblend-Animation für Inhalte */
.container > * { animation: fadeUp 0.4s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ===== Auth-Seiten ===== */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(600px 300px at 80% -10%, rgba(79,124,255,0.18), transparent 70%),
    radial-gradient(500px 300px at 10% 10%, rgba(34,211,166,0.10), transparent 70%);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 38px 34px;
  box-shadow: var(--shadow);
  animation: fadeUp 0.4s ease both;
}
.auth-brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.25rem; margin-bottom: 24px; color: var(--text);
}
.auth-brand .dot {
  width: 12px; height: 12px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 4px rgba(34,211,166,0.18);
}
.auth-card h1 { font-size: 1.5rem; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); margin: 0 0 24px; font-size: 0.95rem; }

label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--muted); margin-bottom: 16px; }
label span { display: block; margin-bottom: 7px; }
input, select, textarea {
  width: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  color: var(--text);
  font: inherit;
  font-size: 0.97rem;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.95rem; font-family: inherit;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.14s ease, background 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  color: #fff;
  box-shadow: 0 10px 26px -12px rgba(91, 133, 255, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn-primary:hover { box-shadow: 0 16px 36px -12px rgba(91, 133, 255, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.18); transform: translateY(-1px); }
.btn-block { width: 100%; }
.btn-ghost { background: rgba(255, 255, 255, 0.04); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--border-strong); }
.btn-danger { background: transparent; border-color: rgba(240, 107, 107, 0.5); color: var(--danger); }
.btn-danger:hover { background: rgba(240, 107, 107, 0.12); border-color: var(--danger); }
.btn-sm { padding: 7px 12px; font-size: 0.85rem; }

input, select, textarea {
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
input:focus, select:focus, textarea:focus { box-shadow: var(--ring); }

.auth-foot { text-align: center; margin-top: 18px; color: var(--muted); font-size: 0.9rem; }
.error { color: var(--danger); font-size: 0.88rem; min-height: 18px; margin: 4px 0 14px; }

/* ===== Dashboard-Layout ===== */
.topbar {
  height: 64px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 14, 28, 0.7);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 20;
}
.topbar .brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--text); }
.topbar .brand .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(34,211,166,0.18); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-right .who { color: var(--muted); font-size: 0.9rem; }

.container { max-width: 1080px; margin: 0 auto; padding: 32px 24px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.6rem; }
.page-head .public-link { color: var(--muted); font-size: 0.9rem; }
.page-head .public-link a { color: var(--accent); }

.tabs { display: flex; gap: 8px; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.tabs button {
  background: none; border: none; color: var(--muted); font: inherit; font-weight: 600;
  padding: 12px 4px; margin-right: 18px; cursor: pointer; border-bottom: 2px solid transparent;
}
.tabs button.active { color: var(--text); border-bottom-color: var(--primary); }

/* Karten / Listen */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 14px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}
.monitor-row {
  display: grid; grid-template-columns: auto 1fr auto auto auto; gap: 16px;
  align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px; margin-bottom: 12px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s, transform 0.12s, box-shadow 0.18s;
}
.monitor-row:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.monitor-row .dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.dot-up { background: var(--accent); box-shadow: 0 0 0 4px rgba(34,211,166,0.15); }
.dot-down { background: var(--danger); box-shadow: 0 0 0 4px rgba(240,99,99,0.15); }
.dot-pending { background: var(--muted); }
.m-name { font-weight: 600; }
.m-target { color: var(--muted); font-size: 0.85rem; word-break: break-all; }
.m-meta { color: var(--muted); font-size: 0.85rem; text-align: right; font-variant-numeric: tabular-nums; }
.m-meta .big { color: var(--text); font-weight: 600; display: block; }
.m-actions { display: flex; gap: 8px; }

.badge { font-size: 0.72rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.03em; }
.badge-up { background: rgba(34,211,166,0.15); color: var(--accent); }
.badge-down { background: rgba(240,99,99,0.15); color: var(--danger); }
.badge-pending { background: rgba(154,166,196,0.15); color: var(--muted); }

.empty { text-align: center; color: var(--muted); padding: 48px 20px; }

.plan-banner {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  background: var(--surface);
}
.plan-banner a { font-weight: 600; }
.plan-banner.trial { background: rgba(245,177,76,0.10); border-color: rgba(245,177,76,0.4); }
.plan-banner.expired { background: rgba(240,99,99,0.10); border-color: rgba(240,99,99,0.4); }
.plan-banner.canceled { background: rgba(154,166,196,0.10); }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(4,8,18,0.7);
  display: none; place-items: center; padding: 24px; z-index: 50;
}
.modal-backdrop.open { display: grid; }
.modal {
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
  background: var(--surface-solid); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 28px;
  box-shadow: var(--shadow);
  animation: modalIn 0.22s ease both;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-backdrop { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal h2 { font-size: 1.3rem; margin-bottom: 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hint { color: var(--muted); font-size: 0.8rem; margin-top: -10px; margin-bottom: 14px; }

.notif-checks { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.notif-check { display: flex; align-items: center; gap: 10px; font-size: 0.92rem; color: var(--text); margin: 0; }
.notif-check input { width: auto; }
.notif-check em { color: var(--muted); font-style: normal; font-size: 0.82rem; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 12px 20px; border-radius: var(--radius-sm); font-size: 0.9rem;
  opacity: 0; transition: opacity 0.25s; pointer-events: none; z-index: 60;
}
.toast.show { opacity: 1; }
.toast.err { border-color: var(--danger); color: var(--danger); }

@media (max-width: 640px) {
  .monitor-row { grid-template-columns: auto 1fr; }
  .monitor-row .m-meta, .monitor-row .badge { grid-column: 2; text-align: left; }
  .m-actions { grid-column: 1 / -1; }
  .form-row { grid-template-columns: 1fr; }
}
