/* ============================================================
   RoSync — design system
   Dark, glassy, gradient-accented. No external dependencies.
   ============================================================ */

:root {
  /* Surfaces */
  --bg: #0a0b14;
  --bg-2: #0e1020;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-solid: #14162a;
  --panel-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);

  /* Text */
  --text: #eef1f8;
  --muted: #9aa3b8;
  --faint: #69708a;

  /* Brand */
  --accent: #7c8bff;
  --accent-2: #b078ff;
  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #c084fc 100%);
  --grad-soft: linear-gradient(135deg, rgba(99,102,241,.18), rgba(192,132,252,.18));

  /* Status */
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --cyan: #22d3ee;

  /* Effects */
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 0 1px var(--border), 0 18px 40px -18px rgba(99, 102, 241, 0.45);
  --ring: 0 0 0 3px rgba(124, 139, 255, 0.25);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Ambient background glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60vw 60vw at 12% -8%, rgba(99, 102, 241, 0.22), transparent 60%),
    radial-gradient(55vw 55vw at 95% 8%, rgba(192, 132, 252, 0.16), transparent 55%),
    radial-gradient(50vw 50vw at 50% 110%, rgba(34, 211, 238, 0.10), transparent 55%),
    var(--bg);
}

a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: #a9b4ff; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 .4em; }
h1 { font-size: clamp(28px, 4vw, 44px); font-weight: 800; }
h2 { font-size: 21px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 600; }
p { margin: 0 0 1em; }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.center { text-align: center; }

/* ---------- Header / nav ---------- */
header.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: rgba(10, 11, 20, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 18px; color: var(--text); letter-spacing: -0.02em;
}
.brand:hover { color: var(--text); }
.brand .logo {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--grad);
  box-shadow: 0 6px 18px -6px rgba(124, 139, 255, 0.8);
  font-size: 16px;
}
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  color: var(--muted); padding: 8px 14px; border-radius: 9px;
  font-weight: 500; font-size: 14px; transition: all .15s ease;
}
.nav-links a:hover { color: var(--text); background: var(--panel-hover); }

/* ---------- Layout ---------- */
main { max-width: 1080px; margin: 0 auto; padding: 40px 24px 80px; }
.section { margin-bottom: 28px; }
.stack > * + * { margin-top: 14px; }

/* ---------- Panels / cards ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-glow);
}
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 56px 16px 40px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; margin-bottom: 22px;
  border: 1px solid var(--border-strong); border-radius: 99px;
  background: var(--grad-soft); color: #d7d2ff;
  font-size: 13px; font-weight: 600;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 99px; background: var(--ok);
  box-shadow: 0 0 10px var(--ok); }
.hero h1 { max-width: 14ch; margin-inline: auto; }
.gradient-text {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.hero p.lead { max-width: 58ch; margin: 0 auto 28px; font-size: 18px; color: var(--muted); }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border: 1px solid transparent; border-radius: 11px;
  font-size: 14.5px; font-weight: 600; cursor: pointer;
  background: var(--grad); color: #fff;
  box-shadow: 0 10px 26px -10px rgba(124, 139, 255, 0.9);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.08); color: #fff;
  box-shadow: 0 14px 32px -10px rgba(124, 139, 255, 1); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; filter: grayscale(.4); }
.btn.secondary {
  background: var(--panel); color: var(--text); border-color: var(--border-strong);
  box-shadow: none;
}
.btn.secondary:hover { background: var(--panel-hover); color: var(--text); }
.btn.ghost { background: transparent; color: var(--muted); box-shadow: none; }
.btn.ghost:hover { background: var(--panel-hover); color: var(--text); }
.btn.vip { background: linear-gradient(135deg, #a855f7, #ec4899); }
.btn.danger { background: linear-gradient(135deg, #ef4444, #f97316);
  box-shadow: 0 10px 26px -12px rgba(239, 68, 68, 0.8); }
.btn.sm { padding: 7px 13px; font-size: 13px; border-radius: 9px; }

/* ---------- Tags / badges ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 11px; border-radius: 99px;
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
  text-transform: capitalize;
}
.tag.free { background: rgba(124, 139, 255, .15); color: #aab4ff; border: 1px solid rgba(124,139,255,.3); }
.tag.paid { background: rgba(52, 211, 153, .14); color: #6ee7b7; border: 1px solid rgba(52,211,153,.3); }
.tag.vip  { background: rgba(192, 132, 252, .16); color: #e2b8ff; border: 1px solid rgba(192,132,252,.35); }
.tag.ok   { background: rgba(52, 211, 153, .14); color: #6ee7b7; }
.tag.off  { background: rgba(255,255,255,.06); color: var(--muted); border: 1px solid var(--border); }

/* ---------- Stats ---------- */
.stat { }
.stat .label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.stat .value { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.stat .value .inf { background: var(--grad); -webkit-background-clip: text;
  background-clip: text; color: transparent; }

/* ---------- Progress bar ---------- */
.bar { height: 8px; background: rgba(255,255,255,.07); border-radius: 99px;
  overflow: hidden; margin-top: 10px; }
.bar > span { display: block; height: 100%; border-radius: 99px;
  background: var(--grad); transition: width .4s ease; }
.bar.full > span { background: linear-gradient(135deg, #fbbf24, #f87171); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 14px; font-size: 14px; }
thead th {
  color: var(--muted); font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 1px solid var(--border);
}
tbody tr { border-bottom: 1px solid var(--border); transition: background .12s ease; }
tbody tr:last-child { border-bottom: 0; }
tbody tr:hover { background: var(--panel-hover); }

/* ---------- Forms ---------- */
label { display: block; margin: 14px 0 6px; font-size: 13px; font-weight: 500;
  color: var(--muted); }
input[type=text], input[type=number], input:not([type]), select {
  width: 100%;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 14px; font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input::placeholder { color: var(--faint); }
select option { background: var(--panel-solid); }
.checkbox { display: flex; align-items: center; gap: 9px; cursor: pointer;
  margin: 14px 0; font-size: 14px; color: var(--text); }
.checkbox input { width: 18px; height: 18px; accent-color: #7c8bff; }
.field-hint { font-size: 12px; color: var(--faint); margin-top: 5px; }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row .grow { flex: 1; min-width: 140px; }

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--border); margin: 22px 0; border: 0; }
.pill-list { display: flex; gap: 8px; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; }
.feature { display: flex; gap: 12px; align-items: flex-start; padding: 6px 0; }
.feature .ic {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; font-size: 17px;
  background: var(--grad-soft); border: 1px solid var(--border);
}
.feature .ftext strong { display: block; font-weight: 600; }
.feature .ftext span { color: var(--muted); font-size: 13.5px; }

.price { font-size: 38px; font-weight: 800; letter-spacing: -0.03em; }
.price .per { font-size: 15px; font-weight: 500; color: var(--muted); }
.popular { position: relative; border-color: var(--border-strong);
  box-shadow: var(--shadow-glow); }
.popular::after {
  content: "Most popular"; position: absolute; top: -11px; right: 20px;
  background: var(--grad); color: #fff; font-size: 11px; font-weight: 700;
  padding: 4px 11px; border-radius: 99px; letter-spacing: .03em;
}

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .big { font-size: 40px; margin-bottom: 8px; }

footer.foot {
  border-top: 1px solid var(--border); padding: 30px 24px;
  text-align: center; color: var(--faint); font-size: 13px;
}

.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--muted);
  font-size: 14px; margin-bottom: 12px; }
.crumb:hover { color: var(--text); }

.page-head { display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }

/* Entrance animation */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.panel, .card, .hero > * { animation: rise .5s ease both; }
.hero h1 { animation-delay: .05s; }
.hero p.lead { animation-delay: .1s; }
.hero-actions { animation-delay: .15s; }

/* ---------- Guild management: sidebar layout ---------- */
.guild-layout { display: grid; grid-template-columns: 220px 1fr; gap: 22px; align-items: start; }
.side-nav {
  position: sticky; top: 84px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px; backdrop-filter: blur(10px);
}
.side-nav .nav-search { width: 100%; margin-bottom: 6px; font-size: 13px;
  padding: 8px 10px; }
.side-nav .nav-results { display: flex; flex-direction: column; gap: 2px;
  margin-bottom: 8px; max-height: 320px; overflow-y: auto; }
.side-nav .nav-result { display: flex; align-items: center; justify-content: space-between;
  gap: 8px; width: 100%; text-align: left; background: transparent; border: 0;
  color: var(--text); font: inherit; font-size: 13.5px; padding: 8px 10px;
  border-radius: 8px; cursor: pointer; }
.side-nav .nav-result:hover { background: var(--panel-hover); }
.side-nav .nav-result.none { color: var(--faint); cursor: default; }
.side-nav .nav-result-tab { font-size: 11px; color: var(--faint); flex: 0 0 auto; }
.side-nav .nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--faint); padding: 12px 12px 6px; }
.side-nav button.nav-item, .side-nav a.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: transparent; border: 0; cursor: pointer; text-align: left;
  color: var(--muted); font: inherit; font-size: 14px; font-weight: 500;
  padding: 10px 12px; border-radius: 9px; transition: all .12s ease;
}
.side-nav .nav-item:hover { background: var(--panel-hover); color: var(--text); }
.side-nav .nav-item.active { background: var(--grad-soft); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border-strong); }
.side-nav .nav-item .ic-sm { width: 18px; text-align: center; }
.side-nav .nav-item .pro { margin-left: auto; font-size: 10px; color: var(--ok);
  background: rgba(52,211,153,.14); padding: 1px 7px; border-radius: 99px; }

.page-section { display: none; animation: rise .35s ease both; }
.page-section.active { display: block; }
.section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.section-sub { color: var(--muted); margin: 0 0 18px; font-size: 14px; }

/* Setup / overview cards */
.setup-card { display: flex; gap: 16px; align-items: flex-start; padding: 18px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
.setup-card .big-ic { width: 46px; height: 46px; border-radius: 12px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 22px; background: var(--grad-soft);
  border: 1px solid var(--border); }
.setup-card .body { flex: 1; }
.setup-card h3 { margin-bottom: 4px; }
.status-line { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.dot-ok { width: 8px; height: 8px; border-radius: 99px; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot-off { width: 8px; height: 8px; border-radius: 99px; background: var(--faint); }
.dot-warn { width: 8px; height: 8px; border-radius: 99px; background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.dot-err { width: 8px; height: 8px; border-radius: 99px; background: var(--err); box-shadow: 0 0 8px var(--err); }

/* Search input + combobox theming */
.side-nav .nav-search,
input[type=search] {
  width: 100%; background: rgba(255,255,255,.04); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm); padding: 9px 12px;
  font-size: 13px; font-family: inherit; -webkit-appearance: none; appearance: none;
}
.side-nav .nav-search::placeholder { color: var(--faint); }
.side-nav .nav-search:focus, input[type=search]:focus {
  outline: none; border-color: var(--accent); box-shadow: var(--ring); }

.combo { position: relative; }
.combo .combo-menu {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px);
  background: var(--panel-solid); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  max-height: 240px; overflow-y: auto; padding: 4px;
}
.combo .combo-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 14px;
}
.combo .combo-item:hover, .combo .combo-item.active { background: var(--panel-hover); }
.combo .combo-item .cid { font-size: 11px; color: var(--faint); }
.combo .combo-item .role-dot { width: 10px; height: 10px; border-radius: 99px;
  flex: 0 0 auto; margin-right: 6px; }
.combo .combo-empty { padding: 9px 10px; color: var(--faint); font-size: 13px; }

/* Full-page search results (shown on Enter) */
.search-hit {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; text-align: left; background: var(--panel); border: 1px solid var(--border);
  color: var(--text); font: inherit; font-size: 15px; padding: 14px 16px;
  border-radius: var(--radius-sm); cursor: pointer; margin-bottom: 8px;
  transition: border-color .15s ease, transform .1s ease;
}
.search-hit:hover { border-color: var(--border-strong); transform: translateX(2px); }
.search-hit .hit-tab { font-size: 12px; color: var(--muted);
  background: var(--panel-hover); padding: 3px 9px; border-radius: 99px; }

/* Alerts */
.alert { display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 14px; border: 1px solid; }
.alert.ok { background: rgba(52,211,153,.1); border-color: rgba(52,211,153,.35); color: #6ee7b7; }
.alert.err { background: rgba(248,113,113,.1); border-color: rgba(248,113,113,.35); color: #fca5a5; }
.alert.warn { background: rgba(251,191,36,.1); border-color: rgba(251,191,36,.35); color: #fcd34d; }
.alert.fade-out { opacity: 0; transition: opacity .6s ease; }
.alert code, .alert b { color: inherit; }

.copy-btn { background: var(--panel-hover); border: 1px solid var(--border);
  color: var(--muted); border-radius: 7px; padding: 5px 10px; font-size: 12px;
  cursor: pointer; font-weight: 600; }
.copy-btn:hover { background: var(--border-strong); color: var(--text); }

/* Modals */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: none;
  background: rgba(5,6,12,.7); backdrop-filter: blur(4px); padding: 24px;
  overflow-y: auto; }
.modal-backdrop.open { display: grid; place-items: start center; }
.modal { width: 100%; max-width: 560px; margin-top: 8vh;
  background: var(--panel-solid); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-head h2 { margin: 0; }
.modal-close { background: var(--panel-hover); border: 1px solid var(--border);
  color: var(--text); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 16px; }
.modal-close:hover { background: var(--border-strong); }

pre.code { background: rgba(0,0,0,.35); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px; overflow-x: auto; font-size: 13px;
  white-space: pre-wrap; word-break: break-all; }

@media (max-width: 760px) {
  .guild-layout { grid-template-columns: 1fr; }
  .side-nav { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
  .side-nav .nav-section { width: 100%; }
}
@media (max-width: 640px) {
  main { padding: 28px 16px 60px; }
  header.nav { padding: 12px 16px; }
  .hero { padding: 36px 8px 28px; }
}
