/* ==========================================================
   NewHeights RP — Site Stylesheet
   A dark, neon-skyline theme built for a FiveM RP community.
   ========================================================== */

:root {
  --bg:            #0a0e1a;
  --bg-elevated:   #10162a;
  --surface:       rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --border:        rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text:          #eef1fb;
  --text-dim:      #9aa3c0;
  --text-faint:    #565d7a;
  --text-muted:    #6c7495;

  --primary:       #7c5cff;
  --primary-dim:   #5b3fd6;
  --accent:        #22d3ee;
  --accent-pink:   #ff5cad;

  --success:       #34d399;
  --warning:       #fbbf24;
  --danger:        #fb7185;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --shadow-glow: 0 8px 30px rgba(124, 92, 255, 0.25);
  --font-display: 'Rajdhani', 'Inter', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

#error-banner {
    /* keep your existing background, padding, and text colors here */
    white-space: pre-line; 
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0 0 0.5em;
  color: #fff;
}

a { color: inherit; text-decoration: none; }
p { color: var(--text-dim); }

/* ---------------- Background glow blobs ---------------- */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  opacity: 0.35;
  pointer-events: none;
  animation: drift 18s ease-in-out infinite alternate;
}
.bg-glow-1 {
  width: 520px; height: 520px;
  top: -160px; left: -120px;
  background: var(--primary);
}
.bg-glow-2 {
  width: 480px; height: 480px;
  bottom: -180px; right: -140px;
  background: var(--accent);
  animation-delay: -9s;
}
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(40px, 30px) scale(1.08); }
}

/* ---------------- Header / Nav ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  background: rgba(10, 14, 26, 0.75);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 72px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: #fff;
  white-space: nowrap;
}
.brand-icon {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 1rem;
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  flex: 1;
  justify-content: center;
}
.main-nav a {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 8px 2px;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.main-nav a:hover { color: #fff; }
.main-nav a.active { color: #fff; border-color: var(--accent); }

.header-actions { display: flex; align-items: center; gap: 12px; }
.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--border);
  color: #fff; width: 40px; height: 40px; border-radius: 10px;
  cursor: pointer;
}
.user-chip {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.9rem; color: var(--text-dim);
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
}
.avatar-dot {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  color: #fff; font-weight: 700; font-size: 0.8rem;
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease, opacity .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), #9b7bff);
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover { background: var(--surface-hover); }
.btn-discord {
  background: rgba(88, 101, 242, 0.15);
  color: #b9c0ff;
  border-color: rgba(88, 101, 242, 0.35);
}
.btn-discord:hover { background: rgba(88, 101, 242, 0.25); }
.btn-success { background: linear-gradient(135deg, #22c07d, var(--success)); color: #06251a; }
.btn-danger  { background: linear-gradient(135deg, #f43f5e, var(--danger)); color: #2b0710; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 0.82rem; border-radius: 8px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------------- Flash messages ---------------- */
.flash-stack { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.flash {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  border: 1px solid var(--border);
  background: var(--surface);
}
.flash i { font-size: 1rem; }
.flash-success { border-color: rgba(52, 211, 153, 0.4); color: #a7f3d4; background: rgba(52, 211, 153, 0.08); }
.flash-error   { border-color: rgba(251, 113, 133, 0.4); color: #fecdd6; background: rgba(251, 113, 133, 0.08); }
.flash-info    { border-color: rgba(34, 211, 238, 0.4); color: #b8f0fb; background: rgba(34, 211, 238, 0.08); }
.flash-close {
  margin-left: auto; background: none; border: none; color: inherit;
  font-size: 1.2rem; cursor: pointer; opacity: 0.7; line-height: 1;
}
.flash-close:hover { opacity: 1; }

/* ---------------- Hero ---------------- */
.hero {
  padding: 96px 0 80px;
  text-align: center;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.hero-eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.18);
}
.hero h1 {
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  line-height: 1.05;
  margin-bottom: 20px;
}
.hero h1 .accent-text {
  background: linear-gradient(135deg, var(--accent), var(--primary) 60%, var(--accent-pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lede {
  max-width: 620px;
  margin: 0 auto 36px;
  font-size: 1.1rem;
  color: var(--text-dim);
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 72px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 18px;
  text-align: center;
}
.stat-card .num {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fff, var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-card .label { color: var(--text-muted); font-size: 0.85rem; margin-top: 4px; }

/* ---------------- Section / cards ---------------- */
.section { padding: 70px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section-head h2 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); }
.section-head p { font-size: 1.02rem; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 26px;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  background: var(--surface-hover);
}
.feature-icon {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(124,92,255,0.25), rgba(34,211,238,0.25));
  color: var(--accent);
  font-size: 1.3rem;
  margin-bottom: 18px;
}
.feature-card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.feature-card p { font-size: 0.93rem; margin: 0; }

/* CTA band */
.cta-band {
  border-radius: var(--radius-lg);
  padding: 56px 40px;
  text-align: center;
  background: linear-gradient(135deg, rgba(124,92,255,0.16), rgba(34,211,238,0.1));
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.cta-band h2 { margin-bottom: 12px; }
.cta-band p { max-width: 520px; margin: 0 auto 28px; }

/* ---------------- Forms / cards (auth, apply) ---------------- */
.form-shell {
  max-width: 460px;
  margin: 64px auto;
  padding: 40px 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.form-shell.form-wide { max-width: 760px; }
.form-shell h1 { font-size: 1.6rem; text-align: center; margin-bottom: 6px; }
.form-shell .sub { text-align: center; color: var(--text-dim); font-size: 0.92rem; margin-bottom: 30px; }

.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 7px;
}
.field .hint { display: block; font-size: 0.78rem; color: var(--text-muted); margin-top: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  transition: border-color .15s ease, background .15s ease;
}
textarea { resize: vertical; min-height: 110px; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(124,92,255,0.06);
}
select { appearance: none; cursor: pointer; }
.char-count { text-align: right; font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

/* Dims a field that doesn't apply to the currently selected option,
   without hiding it — it stays visible and fillable without JS. */
.field-dim { opacity: 0.4; transition: opacity .15s ease; }

.form-foot { text-align: center; margin-top: 22px; font-size: 0.9rem; color: var(--text-dim); }
.form-foot a { color: var(--accent); font-weight: 600; }

/* Applications closed notice */
.notice-card {
  max-width: 560px;
  margin: 64px auto;
  padding: 40px;
  text-align: center;
  background: var(--surface);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: var(--radius-lg);
}
.notice-card .icon {
  width: 60px; height: 60px; margin: 0 auto 18px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(251, 191, 36, 0.15);
  color: var(--warning);
  font-size: 1.6rem;
}

/* ---------------- Badges ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-pending  { background: rgba(251, 191, 36, 0.15); color: var(--warning); }
.badge-accepted { background: rgba(52, 211, 153, 0.15); color: var(--success); }
.badge-denied   { background: rgba(251, 113, 133, 0.15); color: var(--danger); }
.badge-admin    { background: rgba(124, 92, 255, 0.2); color: #cbbcff; }
.badge-member   { background: rgba(255,255,255,0.08); color: var(--text-dim); }
.badge-active   { background: rgba(52, 211, 153, 0.15); color: var(--success); }
.badge-banned   { background: rgba(251, 113, 133, 0.15); color: var(--danger); }

/* ---------------- Dashboard ---------------- */
.dash-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  flex-wrap: wrap; gap: 16px;
  margin-bottom: 32px;
}
.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  margin-bottom: 20px;
}
.app-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap; gap: 10px;
}
.app-row:last-child { border-bottom: none; }
.empty-state {
  text-align: center; padding: 50px 20px; color: var(--text-muted);
}
.empty-state i { font-size: 2rem; margin-bottom: 14px; color: var(--text-faint); display: block; }

/* ---------------- Table (admin) ---------------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--text-muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: var(--surface-hover); }
td.wrap { white-space: normal; max-width: 320px; }

/* ---------------- Footer ---------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  margin-top: 60px;
}
.footer-inner { text-align: center; }
.footer-brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 700; color: #fff;
  margin-bottom: 8px;
}
.footer-tagline { font-size: 0.9rem; margin-bottom: 18px; }
.footer-links { display: flex; gap: 22px; justify-content: center; margin-bottom: 22px; flex-wrap: wrap; }
.footer-links a { color: var(--text-dim); font-size: 0.9rem; }
.footer-links a:hover { color: #fff; }
.footer-copy { font-size: 0.78rem; color: var(--text-faint); }

/* ---------------- Rules page ---------------- */
.rules-list { counter-reset: rule; list-style: none; padding: 0; margin: 0; }
.rules-list li {
  counter-increment: rule;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 22px 20px 60px;
  margin-bottom: 14px;
  position: relative;
}
.rules-list li::before {
  content: counter(rule);
  position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-weight: 700; font-size: 0.85rem;
  font-family: var(--font-display);
}
.rules-list h4 { margin: 0 0 4px; font-size: 1rem; }
.rules-list p { margin: 0; font-size: 0.9rem; }

/* ==========================================================
   Admin panel layout
   ========================================================== */
.admin-body { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  padding: 26px 18px;
  position: sticky; top: 0; height: 100vh;
}
.admin-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 700; color: #fff;
  padding: 0 10px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.admin-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  color: var(--text-dim);
  font-size: 0.92rem;
  font-weight: 500;
  margin-bottom: 4px;
  transition: background .15s ease, color .15s ease;
}
.admin-nav a i { width: 18px; text-align: center; color: var(--text-muted); }
.admin-nav a:hover { background: var(--surface); color: #fff; }
.admin-nav a.active { background: linear-gradient(135deg, rgba(124,92,255,0.22), rgba(34,211,238,0.12)); color: #fff; }
.admin-nav a.active i { color: var(--accent); }
.admin-nav .back-link {
  margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border);
}

.admin-main { flex: 1; min-width: 0; }
.admin-topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
  background: rgba(10,14,26,0.85);
  backdrop-filter: blur(10px);
}
.admin-topbar h1 { font-size: 1.3rem; margin: 0; }
.admin-content { padding: 32px; max-width: 1200px; }

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 30px;
}
.admin-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
}
.admin-stat-card .top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.admin-stat-card .icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center; font-size: 1rem;
}
.icon-purple { background: rgba(124,92,255,0.18); color: var(--primary); }
.icon-cyan   { background: rgba(34,211,238,0.18); color: var(--accent); }
.icon-amber  { background: rgba(251,191,36,0.18); color: var(--warning); }
.icon-green  { background: rgba(52,211,153,0.18); color: var(--success); }
.admin-stat-card .num { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; }
.admin-stat-card .label { color: var(--text-muted); font-size: 0.85rem; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  margin-bottom: 24px;
}
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.panel-head h2 { font-size: 1.1rem; margin: 0; }

.filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-tabs a {
  padding: 7px 14px; border-radius: 999px; font-size: 0.85rem; font-weight: 600;
  border: 1px solid var(--border); color: var(--text-dim);
}
.filter-tabs a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Toggle switch */
.switch-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0; border-bottom: 1px solid var(--border);
}
.switch-row:last-child { border-bottom: none; }
.switch-row .title { font-weight: 600; color: #fff; font-size: 0.95rem; }
.switch-row .desc { font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; }
.switch { position: relative; display: inline-block; width: 52px; height: 30px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
  transition: background .2s ease;
}
.switch-slider::before {
  content: ""; position: absolute; height: 22px; width: 22px;
  left: 4px; bottom: 4px;
  background: #fff; border-radius: 50%;
  transition: transform .2s ease;
}
.switch input:checked + .switch-slider { background: linear-gradient(135deg, var(--primary), var(--accent)); }
.switch input:checked + .switch-slider::before { transform: translateX(22px); }

.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 24px; }
.detail-item .k { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 4px; }
.detail-item .v { font-size: 0.95rem; color: #fff; }
.detail-block { margin-bottom: 22px; }
.detail-block .k { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 8px; }
.detail-block .v { font-size: 0.92rem; color: var(--text); white-space: pre-wrap; line-height: 1.7; }

.action-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }

/* Utility */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .admin-stat-grid { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .main-nav {
    position: absolute; top: 72px; left: 0; right: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 24px;
    gap: 4px;
    display: none;
  }
  .main-nav.open { display: flex; }
  .main-nav a { width: 100%; padding: 12px 0; border-bottom: none; }
  .nav-toggle { display: grid; place-items: center; }
  .header-actions .btn-discord span,
  .header-actions .user-chip span:last-child { display: none; }
  .feature-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .admin-content { padding: 20px; }
  .admin-topbar { padding: 16px 20px; }
  .admin-stat-grid { grid-template-columns: 1fr; }
  .form-shell { margin: 32px 16px; padding: 28px 22px; }
}

@media (max-width: 560px) {
  .stat-row { grid-template-columns: 1fr; }
  .hero { padding: 64px 0 56px; }
}
