/* FudliCraft — Minecraft hosting on the homelab
   Design language matched to RouteBox / Archivista:
   near-black background, faint grid, cream text, lime accent, Inter display. */

:root {
  --bg: #0e100b;
  --bg-soft: #12150d;
  --panel: #14180f;
  --panel-2: #181d12;
  --line: rgba(245, 240, 222, 0.09);
  --line-strong: rgba(245, 240, 222, 0.16);

  --ink: #f5f0e1;
  --ink-soft: #b4b3a3;
  --ink-dim: #7f8073;

  --lime: #c4f53b;
  --lime-deep: #aee227;
  --lime-dim: #8fa83a;
  --orange: #f0883e;

  --maxw: 1180px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.9);

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Space Mono", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  font-feature-settings: "cv11", "ss01";
}

/* page-wide ambient: faint grid + top-left green glow */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(245, 240, 222, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(245, 240, 222, 0.035) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(1100px 720px at 12% -5%, #000 35%, transparent 78%);
}
.bg-glow {
  position: fixed; top: -240px; left: -180px; width: 760px; height: 620px; z-index: 0;
  pointer-events: none;
  background: radial-gradient(circle, rgba(150, 200, 40, 0.18), transparent 62%);
  filter: blur(8px);
}

.wrap { position: relative; z-index: 2; max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(18px, 4vw, 40px); }

a { color: inherit; text-decoration: none; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(14, 16, 11, 0.72);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 30px; height: 66px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.brand .logo { width: 30px; height: 30px; border-radius: 8px; }
.nav-links { display: flex; gap: 26px; margin-left: 6px; font-size: 14.5px; color: var(--ink-soft); }
.nav-links a { transition: color 0.15s; }
.nav-links a:hover { color: var(--ink); }
.nav-right { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.nav-right .txt-link { font-size: 14.5px; color: var(--ink-soft); }
.nav-right .txt-link:hover { color: var(--ink); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--sans); font-weight: 600; font-size: 14.5px;
  padding: 11px 18px; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; transition: transform 0.12s ease, background 0.18s, border-color 0.18s, box-shadow 0.18s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-lime { background: var(--lime); color: #1a2305; box-shadow: 0 0 0 1px rgba(196, 245, 59, 0.3), 0 16px 40px -18px rgba(196, 245, 59, 0.7); }
.btn-lime:hover { background: var(--lime-deep); }
.btn-ghost { background: rgba(245, 240, 222, 0.02); border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--lime-dim); }
.btn-lg { padding: 13px 22px; font-size: 15px; }
.btn-sm { padding: 8px 14px; font-size: 13.5px; }
.btn-block { width: 100%; justify-content: center; }
.btn svg { width: 16px; height: 16px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* ---------- shared section bits ---------- */
.kicker { font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--lime); }
.section { padding: clamp(56px, 9vw, 110px) 0; position: relative; }
.section-head { max-width: 760px; }
.h-display {
  font-weight: 800; letter-spacing: -0.03em; line-height: 0.96;
  font-size: clamp(38px, 7.5vw, 84px);
}
.h-2 { font-weight: 800; letter-spacing: -0.025em; line-height: 1.0; font-size: clamp(30px, 5vw, 56px); }
.lead { color: var(--ink-soft); font-size: clamp(15.5px, 1.8vw, 18px); max-width: 540px; }
.hl { color: var(--lime); }

/* ---------- hero ---------- */
.hero { padding-top: clamp(56px, 8vw, 96px); padding-bottom: clamp(40px, 6vw, 72px); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(32px, 5vw, 70px); align-items: center; }
.hero .kicker { display: block; margin-bottom: 22px; }
.hero h1 { margin-bottom: 24px; }
.hero .lead { margin-bottom: 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 40px; }
.hero-stats { display: flex; gap: 38px; flex-wrap: wrap; }
.hstat b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.hstat span { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-dim); }

/* floating window card */
.window-wrap { position: relative; }
.window-wrap::before {
  content: ""; position: absolute; inset: 18px -14px -16px 16px; border-radius: var(--radius-lg);
  background: rgba(150, 200, 40, 0.1); border: 1px solid rgba(196, 245, 59, 0.18);
}
.window {
  position: relative; background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-strong); border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow);
}
.window-bar { display: flex; align-items: center; gap: 7px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.window-bar i { width: 10px; height: 10px; border-radius: 50%; background: #3a3f30; display: inline-block; }
.window-bar i:nth-child(2) { background: #4a4f3a; }
.window-bar i:nth-child(3) { background: #5a6044; }
.window-bar .wtitle { font-family: var(--mono); font-size: 11.5px; color: var(--ink-dim); margin-left: 8px; letter-spacing: 0.04em; }
.window-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.wrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 11px; border: 1px solid var(--line); background: rgba(245, 240, 222, 0.015); }
.wrow.active { border-color: rgba(196, 245, 59, 0.4); background: rgba(196, 245, 59, 0.05); }
.wrow .wname { display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.wrow .wval { font-family: var(--mono); font-size: 13px; color: var(--lime); }
.wrow .wval.dim { color: var(--ink-dim); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.on { background: var(--lime); box-shadow: 0 0 9px var(--lime); }
.dot.off { background: var(--ink-dim); }
.dot.warm { background: var(--orange); box-shadow: 0 0 8px rgba(240, 136, 62, 0.7); }

/* ---------- marquee ---------- */
.marquee { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; padding: 16px 0; background: var(--bg-soft); position: relative; z-index: 2; }
.marquee-track { display: inline-flex; gap: 44px; white-space: nowrap; animation: scroll 28s linear infinite; font-family: var(--mono); font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim); }
.marquee-track b { color: var(--ink-soft); font-weight: 500; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- feature grid ---------- */
.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; margin-top: 52px; }
.feat { padding: 30px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); position: relative; transition: background 0.2s; }
.feat:hover { background: rgba(196, 245, 59, 0.03); }
.feat:nth-child(3n) { border-right: none; }
.feat:nth-last-child(-n+3) { border-bottom: none; }
.feat .ico { width: 26px; height: 26px; color: var(--lime); margin-bottom: 20px; }
.feat h3 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 9px; }
.feat p { color: var(--ink-soft); font-size: 14.5px; max-width: 34ch; }

/* ---------- split (setup / why) ---------- */
.split { display: grid; grid-template-columns: 0.95fr 1.05fr; gap: clamp(30px, 5vw, 64px); align-items: start; }
.split .kicker { display: block; margin-bottom: 18px; }
.split-left .lead { margin-top: 22px; }

.steps { display: flex; flex-direction: column; gap: 12px; }
.step { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); transition: border-color 0.18s; }
.step:hover { border-color: var(--line-strong); }
.step .num { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--lime); color: #1a2305; font-weight: 800; font-size: 14px; }
.step .txt b { display: block; font-size: 15.5px; font-weight: 600; }
.step .txt span { font-size: 13.5px; color: var(--ink-dim); }

/* template / why cards 2x2 */
.mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mini { padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); transition: border-color 0.18s, transform 0.18s; }
.mini:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.mini .tag { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--lime); }
.mini h3 { font-size: 16.5px; font-weight: 700; margin: 12px 0 7px; }
.mini p { font-size: 13.5px; color: var(--ink-soft); }

/* node strip */
.node-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 50px; }
.ncard { padding: 26px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: linear-gradient(180deg, var(--panel), var(--bg-soft)); }
.ncard.live { border-color: rgba(196, 245, 59, 0.22); }
.ncard .ntop { display: flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); margin-bottom: 16px; }
.ncard h3 { font-size: 19px; font-weight: 700; margin-bottom: 8px; }
.ncard p { font-size: 14px; color: var(--ink-soft); margin-bottom: 16px; }
.ncard ul { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.ncard li { font-size: 13.5px; color: var(--ink-dim); font-family: var(--mono); }
.ncard li::before { content: "› "; color: var(--lime); }

/* ---------- CTA band ---------- */
.cta-band { border: 1px solid rgba(196, 245, 59, 0.25); border-radius: var(--radius-lg); padding: clamp(34px, 5vw, 60px); background: linear-gradient(120deg, rgba(150, 200, 40, 0.08), rgba(14, 16, 11, 0.2)); position: relative; overflow: hidden; }
.cta-band .h-2 { margin-bottom: 14px; }
.cta-band p { color: var(--ink-soft); margin-bottom: 28px; max-width: 480px; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 40px 0; margin-top: 30px; position: relative; z-index: 2; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 26px; }
.footer .brand { font-size: 15px; }
.footer-note { color: var(--ink-dim); font-size: 13px; flex: 1; min-width: 220px; }
.footer-links { display: flex; gap: 20px; font-size: 13.5px; color: var(--ink-soft); }
.footer-links a:hover { color: var(--lime); }

/* ===================== APP / DASHBOARD ===================== */
.app-shell { padding: 30px 0 80px; }
.app-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 26px; }
.app-head .kicker { display: block; margin-bottom: 10px; }
.app-head h1 { font-weight: 800; letter-spacing: -0.025em; font-size: clamp(28px, 4vw, 44px); line-height: 1; }
.app-head p { color: var(--ink-soft); font-size: 14.5px; margin-top: 8px; }
.conn { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; padding: 8px 13px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-soft); }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 30px; }
.stat-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.stat-card .label { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-dim); }
.stat-card .big { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; margin-top: 8px; }
.stat-card .big.lime { color: var(--lime); }

.app-section { margin-top: 34px; }
.app-section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.app-section-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.app-section-head .hint { font-family: var(--mono); font-size: 11.5px; color: var(--ink-dim); }

.srv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.srv { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); transition: border-color 0.18s, transform 0.18s; }
.srv:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.srv-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.state { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); }
.state.on { color: var(--lime); border-color: rgba(196, 245, 59, 0.4); }
.state.off { color: var(--ink-dim); }
.state.warm { color: var(--orange); border-color: rgba(240, 136, 62, 0.4); }
.srv h3 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.srv .srv-sub { font-family: var(--mono); font-size: 12px; color: var(--ink-dim); margin-bottom: 16px; }
.srv .srv-specs { display: flex; gap: 16px; margin-bottom: 16px; }
.srv .spec span { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-dim); display: block; }
.srv .spec b { font-size: 14px; font-weight: 600; }
.srv-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-family: var(--sans); font-weight: 600; font-size: 13px; padding: 7px 13px; border-radius: 8px; border: 1px solid var(--line); background: rgba(245, 240, 222, 0.02); color: var(--ink); cursor: pointer; transition: border-color 0.15s, color 0.15s; }
.chip:hover:not([disabled]) { border-color: var(--lime-dim); color: var(--lime); }
.chip[disabled] { opacity: 0.4; cursor: not-allowed; }

.empty { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 44px 24px; text-align: center; color: var(--ink-dim); }
.empty .ei { width: 34px; height: 34px; color: var(--lime); opacity: 0.7; margin: 0 auto 14px; }
.empty b { color: var(--ink); font-size: 16px; display: block; margin-bottom: 6px; font-weight: 600; }
.empty p { font-size: 14px; max-width: 44ch; margin: 0 auto 18px; }

.node-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.nl { padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); display: flex; align-items: center; gap: 14px; }
.nl .nl-main { flex: 1; }
.nl b { font-size: 15px; }
.nl span { display: block; font-family: var(--mono); font-size: 12px; color: var(--ink-dim); }

.banner { display: flex; align-items: flex-start; gap: 11px; padding: 14px 16px; border-radius: 12px; font-size: 14px; margin-bottom: 28px; }
.banner.warn { background: rgba(240, 136, 62, 0.07); border: 1px solid rgba(240, 136, 62, 0.3); color: var(--ink-soft); }
.banner.err { background: rgba(224, 86, 74, 0.08); border: 1px solid rgba(224, 86, 74, 0.35); color: #f0c0bb; }
.banner svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.banner a { color: var(--lime); text-decoration: underline; }

.skeleton { background: linear-gradient(90deg, rgba(245,240,222,0.04), rgba(245,240,222,0.09), rgba(245,240,222,0.04)); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: 6px; color: transparent !important; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* toast */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(18px); background: var(--panel-2); border: 1px solid var(--lime-dim); color: var(--ink); padding: 12px 18px; border-radius: 11px; font-size: 14px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity 0.22s, transform 0.22s; z-index: 100; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===================== AUTH PAGES ===================== */
.auth-body { min-height: 100vh; display: flex; }
.auth-wrap { position: relative; z-index: 2; margin: auto; width: 100%; max-width: 420px; padding: 40px 20px; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.auth-brand { font-size: 18px; }
.auth-card { width: 100%; }
.auth-card-body { padding: 26px 24px 28px; gap: 0; }
.auth-card-body .kicker { display: block; margin-bottom: 12px; }
.auth-title { font-weight: 800; letter-spacing: -0.025em; font-size: 28px; line-height: 1.05; }
.auth-sub { color: var(--ink-soft); font-size: 14px; margin: 8px 0 22px; }
.auth-back { font-family: var(--mono); font-size: 12.5px; color: var(--ink-dim); }
.auth-back:hover { color: var(--lime); }

/* ---------- forms ---------- */
.field { display: block; margin-bottom: 15px; }
.field > span { display: block; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-dim); margin-bottom: 7px; }
.field input, .field select {
  width: 100%; font-family: var(--sans); font-size: 15px; color: var(--ink);
  background: rgba(245, 240, 222, 0.02); border: 1px solid var(--line-strong);
  border-radius: 10px; padding: 12px 14px; transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--lime-dim); box-shadow: 0 0 0 3px rgba(196, 245, 59, 0.12); }
.field input::placeholder { color: var(--ink-dim); }
form .btn-block { margin-top: 6px; }

.form-err { background: rgba(224, 86, 74, 0.08); border: 1px solid rgba(224, 86, 74, 0.35); color: #f0c0bb; font-size: 13.5px; padding: 11px 14px; border-radius: 10px; margin-bottom: 16px; }
.form-ok { background: rgba(196, 245, 59, 0.07); border: 1px solid rgba(196, 245, 59, 0.32); color: var(--ink); font-size: 13.5px; padding: 11px 14px; border-radius: 10px; margin-bottom: 16px; }
.form-ok code { font-family: var(--mono); color: var(--lime); }

/* ---------- user menu (dashboard nav) ---------- */
.usermenu { display: inline-flex; align-items: center; gap: 10px; }
.usermenu .uname { font-size: 13.5px; color: var(--ink-soft); }
.usermenu .uname b { color: var(--ink); font-weight: 600; }

/* ---------- admin panel ---------- */
.admin-only[hidden] { display: none !important; }
.utable { width: 100%; border-collapse: collapse; font-size: 14px; }
.utable th { text-align: left; font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-dim); font-weight: 500; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.utable td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.utable tr:last-child td { border-bottom: none; }
.utable .umail { font-weight: 600; }
.utable .umeta { font-family: var(--mono); font-size: 11.5px; color: var(--ink-dim); }
.badge { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-soft); }
.badge.admin { color: var(--lime); border-color: rgba(196, 245, 59, 0.4); }
.badge.pending { color: var(--orange); border-color: rgba(240, 136, 62, 0.4); }
.utable-wrap { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow-x: auto; }
.admin-form { display: grid; grid-template-columns: 1.4fr 1fr 0.8fr auto; gap: 12px; align-items: end; margin-bottom: 18px; }
.admin-form .field { margin-bottom: 0; }
.admin-form .btn { height: 44px; }
.uactions { display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .window-wrap { order: 2; }
  .split { grid-template-columns: 1fr; }
  .feat-grid { grid-template-columns: 1fr 1fr; }
  .feat:nth-child(3n) { border-right: 1px solid var(--line); }
  .feat:nth-child(2n) { border-right: none; }
  .node-row { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .nav-links { display: none; }
  .feat-grid { grid-template-columns: 1fr; }
  .feat { border-right: none !important; }
  .mini-grid { grid-template-columns: 1fr; }
  .admin-form { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; scroll-behavior: auto; } }
