/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0a0a0f;
  --surface:     #131320;
  --surface-2:   #1c1c30;
  --border:      #252540;
  --accent:      #5865f2;
  --accent-h:    #4752c4;
  --accent-glow: rgba(88,101,242,0.25);
  --green:       #57f287;
  --green-dim:   rgba(87,242,135,0.12);
  --red:         #ed4245;
  --red-dim:     rgba(237,66,69,0.12);
  --yellow:      #fee75c;
  --text:        #dcdcf0;
  --text-muted:  #7e7e9a;
  --white:       #ffffff;
  --radius:      12px;
  --radius-sm:   8px;
  --radius-lg:   16px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.page { flex: 1; padding: 48px 24px 80px; max-width: 1160px; margin: 0 auto; width: 100%; }

/* ── Navigation ──────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1160px; margin: 0 auto; padding: 0 24px;
  height: 60px; display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-size: 22px; font-weight: 800;
  color: var(--accent);
  text-decoration: none;
}
.nav-logo:hover { text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links > a {
  color: var(--text-muted); font-size: 14px; font-weight: 500;
  transition: color .15s;
}
.nav-links > a:hover { color: var(--text); text-decoration: none; }
.nav-user { display: flex; align-items: center; gap: 10px; }
.nav-avatar { width: 28px; height: 28px; border-radius: 50%; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer;
  border: none; transition: all .15s; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 13px 28px; font-size: 16px; }

.btn-primary { background: var(--accent); color: var(--white); }
.btn-primary:hover { background: var(--accent-h); color: var(--white); }

.btn-secondary {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); color: var(--white); }

.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-danger { background: var(--red-dim); color: var(--red); border: 1px solid rgba(237,66,69,.3); }
.btn-danger:hover { background: var(--red); color: var(--white); }

.btn-success { background: var(--green-dim); color: var(--green); border: 1px solid rgba(87,242,135,.3); }
.btn-success:hover { background: var(--green); color: #0a0a0f; }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.card-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.card-header h2, .card-header h3 { font-size: 17px; font-weight: 700; }

/* ── Flash messages ──────────────────────────────────────────────────────── */
.flash-container { max-width: 1160px; margin: 16px auto 0; padding: 0 24px; }
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; margin-bottom: 8px;
}
.alert-success { background: var(--green-dim); color: var(--green); border: 1px solid rgba(87,242,135,.3); }
.alert-error   { background: var(--red-dim);   color: var(--red);   border: 1px solid rgba(237,66,69,.3); }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 100px 24px 80px;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, var(--accent-glow), transparent);
  position: relative;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(88,101,242,.15); border: 1px solid rgba(88,101,242,.3);
  color: #a5b4fc; font-size: 13px; font-weight: 600;
  padding: 5px 14px; border-radius: 100px; margin-bottom: 28px;
}
.hero-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.hero h1 {
  font-size: clamp(42px, 7vw, 72px); font-weight: 800; line-height: 1.1;
  letter-spacing: -2px; color: var(--white); margin-bottom: 20px;
}
.hero h1 span {
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub {
  font-size: 18px; color: var(--text-muted); max-width: 560px;
  margin: 0 auto 40px;
}
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-stats {
  display: flex; gap: 48px; justify-content: center;
  margin-top: 64px; flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat-num { font-size: 28px; font-weight: 800; color: var(--white); }
.hero-stat-lbl { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ── Features bento ──────────────────────────────────────────────────────── */
.bento-section {
  padding: 64px 24px 80px;
  max-width: 1160px; margin: 0 auto;
}
.bento-label {
  font-size: 11px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 24px;
}

.features-bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

/* span helpers */
.fc-wide { grid-column: span 2; }
.fc-full { grid-column: 1 / -1; }

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  transition: border-color .15s;
  display: flex; flex-direction: column; gap: 14px;
}
.feature-card:hover {
  border-color: rgba(255,255,255,.15);
}

/* wide card: icon + title/desc side by side */
.fc-head {
  display: flex; align-items: flex-start; gap: 16px;
}
.fc-head .feature-icon { margin-bottom: 0; flex-shrink: 0; }

/* Panel banner */
.fc-banner {
  flex-direction: row; align-items: center; gap: 40px;
}
.fc-banner-text { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.fc-banner-text .feature-icon { margin-bottom: 0; }
.fc-banner-stats {
  display: flex; gap: 32px; flex-shrink: 0;
  padding: 20px 28px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.fc-stat { text-align: center; }
.fc-stat-num { font-size: 36px; font-weight: 800; color: var(--white); line-height: 1; }
.fc-stat-lbl { font-size: 11px; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 1px; }

.fc-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.fc-pill {
  font-size: 12px; font-weight: 500;
  padding: 4px 10px; border-radius: 100px;
  background: var(--surface-2); color: var(--text-muted);
  border: 1px solid var(--border);
}

.feature-icon {
  font-size: 32px; display: block;
  filter: drop-shadow(0 0 10px var(--card-glow, var(--accent-glow)));
}
.feature-title { font-size: 17px; font-weight: 700; color: var(--white); }
.feature-desc  { font-size: 13px; color: var(--text-muted); line-height: 1.7; }
.feature-list  { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.feature-list li {
  font-size: 13px; color: var(--text-muted);
  display: flex; align-items: center; gap: 8px;
}
.feature-list li::before { content: '✓'; color: var(--green); font-weight: 700; flex-shrink: 0; }
.feature-list code { font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

/* ── CTA Section ─────────────────────────────────────────────────────────── */
.cta-section {
  text-align: center; padding: 80px 24px;
  background: radial-gradient(ellipse 60% 80% at 50% 100%, var(--accent-glow), transparent);
}
.cta-section h2 { font-size: 36px; font-weight: 800; color: var(--white); margin-bottom: 14px; }
.cta-section p  { font-size: 17px; color: var(--text-muted); margin-bottom: 36px; }

/* ── Dashboard ───────────────────────────────────────────────────────────── */
.page-header { margin-bottom: 36px; }
.page-header h1 { font-size: 28px; font-weight: 800; color: var(--white); }
.page-header p  { color: var(--text-muted); margin-top: 6px; }

.section-label {
  font-size: 11px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 14px;
}

.empty-state {
  text-align: center; padding: 80px 24px;
  color: var(--text-muted);
}
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 20px; font-weight: 700; color: var(--white); margin-bottom: 8px; }
.empty-state p  { margin-bottom: 24px; }

.guild-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.guild-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; flex-direction: column; gap: 16px;
  transition: border-color .15s, box-shadow .15s;
}
.guild-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 24px rgba(88,101,242,.1);
}
.guild-info { display: flex; align-items: center; gap: 12px; }
.guild-icon {
  width: 48px; height: 48px; border-radius: 12px;
  object-fit: cover; background: var(--surface-2);
}
.guild-name { font-weight: 700; font-size: 15px; color: var(--white); line-height: 1.2; }
.guild-status {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; margin-top: 4px;
}
.guild-status--live { color: var(--green); }
.guild-status--off  { color: var(--text-muted); }
.status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; flex-shrink: 0;
}

.guild-card--inactive {
  opacity: .65;
  border-style: dashed;
}
.guild-card--inactive:hover { opacity: 1; }

.guild-actions { display: flex; gap: 8px; }
.guild-actions .btn { flex: 1; justify-content: center; }

/* ── Server Config ───────────────────────────────────────────────────────── */
.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(440px, 1fr));
  gap: 20px;
}

.form-group { margin-bottom: 20px; }
.form-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .5px;
}
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

.form-control {
  width: 100%; padding: 10px 14px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: inherit; font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
}
.form-control:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-control option { background: var(--surface-2); }

textarea.form-control { resize: vertical; min-height: 80px; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 100px;
  font-size: 12px; font-weight: 600;
}
.badge-green  { background: var(--green-dim); color: var(--green); }
.badge-red    { background: var(--red-dim); color: var(--red); }
.badge-purple { background: rgba(88,101,242,.15); color: #a5b4fc; }

/* ── Admin Table ─────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table {
  width: 100%; border-collapse: collapse;
  font-size: 14px;
}
thead tr { border-bottom: 1px solid var(--border); }
th {
  padding: 12px 16px; text-align: left;
  font-size: 12px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; color: var(--text-muted);
}
td { padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-2); }
.mono { font-family: 'Courier New', monospace; font-size: 13px; }

/* ── Input Row ───────────────────────────────────────────────────────────── */
.input-row { display: flex; gap: 10px; }
.input-row .form-control { flex: 1; }

/* ── Error Page ──────────────────────────────────────────────────────────── */
.error-page { text-align: center; padding: 120px 24px; }
.error-code { font-size: 100px; font-weight: 800; color: var(--border); line-height: 1; }
.error-page h2 { font-size: 24px; font-weight: 700; color: var(--white); margin: 16px 0 10px; }
.error-page p  { color: var(--text-muted); margin-bottom: 28px; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 24px;
  margin-top: auto;
}
.footer-inner {
  max-width: 1160px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
}
.footer-logo { font-weight: 800; font-size: 18px; color: var(--text-muted); }
.footer-links { display: flex; gap: 24px; }
.footer-links a { font-size: 14px; color: var(--text-muted); }
.footer-links a:hover { color: var(--text); text-decoration: none; }
.footer-copy { font-size: 13px; color: var(--text-muted); }

/* ── Divider ─────────────────────────────────────────────────────────────── */
.divider {
  border: none; border-top: 1px solid var(--border);
  margin: 32px 0;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .features-bento { grid-template-columns: 1fr; }
  .fc-wide  { grid-column: span 1; }
  .fc-full  { grid-column: span 1; }
  .fc-banner { flex-direction: column; }
  .fc-banner-stats { flex-direction: row; justify-content: center; width: 100%; }
  .fc-head { flex-direction: column; gap: 10px; }
}

@media (max-width: 640px) {
  .nav-links > a:not(.btn) { display: none; }
  .hero { padding: 72px 16px 56px; }
  .hero h1 { font-size: 38px; }
  .hero-stats { gap: 28px; }
  .config-grid   { grid-template-columns: 1fr; }
  .guild-grid    { grid-template-columns: 1fr; }
  .footer-inner  { flex-direction: column; text-align: center; }
}
