:root {
  --bg: #080808;
  --surface: #0F1213;
  --surface-2: #141820;
  --surface-3: #1a2230;
  --border: rgba(255, 255, 255, 0.08);
  --border-soft: rgba(255, 255, 255, 0.05);
  --text: #F5F5F5;
  --text-bright: #ffffff;
  --muted: #9CA3AF;
  --brand: #0A4D6F;
  --accent: #008FC4;
  --accent-bright: #00A6D9;
  --danger: #f87171;
  --ok: #34d399;
  --font: "Cairo", system-ui, sans-serif;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --glow: 0 0 24px rgba(0, 143, 196, 0.25);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 80% 0%, rgba(10, 77, 111, 0.22), transparent 55%),
    radial-gradient(ellipse 55% 45% at 10% 20%, rgba(0, 143, 196, 0.08), transparent 50%),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(10, 77, 111, 0.12), transparent 55%),
    linear-gradient(180deg, #0c0c0c 0%, #080808 100%);
}
.texture {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1140px, calc(100% - 2rem));
  margin-inline: auto;
  padding-bottom: 3rem;
}

a { color: inherit; text-decoration: none; transition: color 0.2s, opacity 0.2s; }
a:hover { color: var(--accent-bright); }
img { display: block; max-width: 100%; }

h1, h2, h3 {
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.02em;
  color: var(--text-bright);
}
h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); }
h2 { font-size: clamp(1.45rem, 2.8vw, 2rem); }

.eyebrow, .fx-label {
  margin: 0 0 0.6rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
.muted { color: var(--muted); }
.center { text-align: center; }
code {
  font-size: 0.88em;
  padding: 0.12em 0.4em;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
}

.logo-mark {
  flex-shrink: 0;
  border: none;
  box-shadow: none;
  background: transparent;
}
.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  filter: drop-shadow(0 0 8px rgba(0, 166, 217, 0.3));
}
.logo-mark--sm { width: 44px; height: 44px; }

.nav-shell {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1rem 0 0.75rem;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0.55rem 0.55rem 1rem;
  border-radius: var(--radius);
  background: rgba(15, 18, 19, 0.92);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 0.85rem; }
.brand__text strong {
  display: block;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  font-weight: 800;
}
.brand__text small {
  display: block;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.15rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.88rem;
  flex-wrap: wrap;
}
.nav a {
  color: var(--muted);
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
}
.nav a:hover { color: var(--text); background: rgba(0, 143, 196, 0.08); }
.nav-form { margin: 0; }
.nav-form button {
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
}
.nav-form button:hover { color: var(--text); background: rgba(0, 143, 196, 0.08); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.35rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn--solid {
  background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
  color: #fff;
  border-color: rgba(0, 166, 217, 0.35);
  box-shadow: var(--glow);
}
.btn--solid:hover { box-shadow: 0 0 32px rgba(0, 166, 217, 0.35); }
.btn--outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn--outline:hover { border-color: rgba(0, 143, 196, 0.45); background: rgba(0, 143, 196, 0.06); }
.btn--outline-nav {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.45rem 1rem;
  font-size: 0.84rem;
}
.btn--danger {
  border-color: rgba(248, 113, 113, 0.35);
  color: #fca5a5;
  background: transparent;
}
.btn--sm { padding: 0.45rem 0.9rem; font-size: 0.8rem; }
.btn--lg { padding: 0.85rem 1.75rem; font-size: 0.95rem; }
.btn--block { width: 100%; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.card--accent {
  background: linear-gradient(145deg, var(--surface-2) 0%, var(--surface) 100%);
  text-align: center;
  padding: 2.5rem 2rem;
}
.card__num {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.toasts {
  margin: 1rem 0;
  display: grid;
  gap: 0.5rem;
}
.toasts p {
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 143, 196, 0.12);
  border: 1px solid rgba(0, 143, 196, 0.25);
}

.page-center { max-width: 520px; margin: 2rem auto; text-align: center; }
.rate-limit-card__hint { margin: 0.75rem 0 0.35rem; }
.rate-limit-card__timer {
  margin: 0 0 1.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-bright);
}
.page-head { padding: 2rem 0 1rem; }
.auth-card label, .admin-form label, .apply-card label {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  font-weight: 600;
}
.auth-card input, .auth-card textarea,
.admin-form input, .admin-form textarea, .admin-form select,
.apply-card input, .apply-card textarea,
.admin-filters select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.auth-card textarea, .admin-form textarea, .apply-card textarea { resize: vertical; min-height: 90px; }

.foot {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.foot__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.foot__brand { font-weight: 800; letter-spacing: 0.08em; }
.foot a { display: block; color: var(--muted); margin-top: 0.35rem; }

.status-pill {
  display: inline-flex;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--border);
}
.status-pill--pending { color: #fbbf24; border-color: rgba(251, 191, 36, 0.35); }
.status-pill--accepted { color: var(--ok); border-color: rgba(52, 211, 153, 0.35); }
.status-pill--rejected { color: var(--danger); border-color: rgba(248, 113, 113, 0.35); }

.track-results { display: grid; gap: 1rem; margin-top: 1.5rem; }
.track-card__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.track-reject { color: #fca5a5; }

.article { max-width: 760px; margin: 2rem auto; }
.article__body p { margin: 0 0 1rem; color: var(--text); }
.article__cta { margin: 2rem 0; padding: 1.25rem; border: 1px solid var(--border); border-radius: var(--radius); }
.article__back { margin-top: 2rem; }

.news-list, .news-grid { display: grid; gap: 1rem; }
.news-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1rem;
  align-items: center;
}
.news-card__thumb {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.news-card:not(:has(.news-card__thumb)) { grid-template-columns: 1fr; }
  display: block;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.2s, transform 0.15s;
}
.news-card:hover { border-color: rgba(0, 143, 196, 0.35); transform: translateY(-2px); }
.news-card__date { font-size: 0.75rem; color: var(--accent); letter-spacing: 0.12em; }
.news-card h2, .news-card h3 { margin-top: 0.5rem; font-size: 1.15rem; }
.news-card p { color: var(--muted); margin: 0.5rem 0 0; }
.news-card__link { color: var(--accent-bright); font-size: 0.88rem; font-weight: 700; }

.admin-head { padding: 1.5rem 0 1rem; }
.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.admin-nav a {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.85rem;
  font-weight: 700;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.admin-stats strong { font-size: 2rem; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th, .admin-table td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border);
  text-align: right;
}
.admin-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}
.admin-export-links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.inline-form { display: inline; }
.link-btn {
  background: none;
  border: 0;
  color: var(--accent-bright);
  cursor: pointer;
  font: inherit;
  padding: 0;
}
.application-detail h3 { margin-top: 1.25rem; font-size: 1rem; color: var(--accent); }
.application-detail__meta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1rem; }
.application-actions { display: grid; gap: 1rem; margin-top: 1.5rem; }
.reject-form textarea { width: 100%; margin: 0.5rem 0; }
.export-box {
  width: 100%;
  margin-top: 1rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-family: ui-monospace, monospace;
}
.gate-status-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; }
.gate-status-list li { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.admin-gate-card { margin-bottom: 1rem; }
.admin-gate-card__head { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.admin-gate-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1rem; align-items: end; }
.inline-label { display: grid; gap: 0.35rem; font-size: 0.85rem; }
.checkbox-label { display: flex !important; align-items: center; gap: 0.5rem; }
.gate-closed-box { text-align: center; padding: 1rem 0; }

@media (max-width: 768px) {
  .topbar { flex-direction: column; align-items: stretch; }
  .nav { justify-content: center; }
  .foot__grid, .admin-stats { grid-template-columns: 1fr; }
}
