:root {
  color-scheme: dark;
  --bg: #07130d;
  --bg-soft: #0b1f15;
  --surface: rgba(12, 31, 22, 0.86);
  --surface-strong: rgba(15, 42, 29, 0.96);
  --surface-soft: rgba(9, 25, 17, 0.72);
  --ink: #f4fbf6;
  --muted: #9db5a7;
  --faint: #6f8b7b;
  --line: rgba(139, 178, 154, 0.2);
  --line-strong: rgba(0, 237, 100, 0.3);
  --accent: #00ed64;
  --accent-dark: #12a150;
  --accent-soft: rgba(0, 237, 100, 0.12);
  --cream: #f7f1df;
  --amber: #f1c75b;
  --danger: #ff6b6b;
  --code-bg: #04110b;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 12% 8%, rgba(0, 237, 100, 0.13), transparent 27%),
    radial-gradient(circle at 85% 12%, rgba(247, 241, 223, 0.08), transparent 24%),
    radial-gradient(circle at 46% 100%, rgba(18, 161, 80, 0.16), transparent 31%),
    var(--bg);
  background-size: 54px 54px, 54px 54px, auto, auto, auto, auto;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(7, 19, 13, 0.06), rgba(7, 19, 13, 0.86));
}

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

h1,
h2,
p {
  margin-top: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 16px clamp(16px, 5vw, 72px);
  background: rgba(7, 19, 13, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.brand::before {
  content: "";
  width: 12px;
  height: 18px;
  border-radius: 12px 12px 12px 3px;
  background: linear-gradient(160deg, var(--accent), #b8ffdf);
  box-shadow: 0 0 22px rgba(0, 237, 100, 0.34);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-weight: 750;
}

nav a {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
}

nav a:hover {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.shell,
.home-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.shell {
  padding: 34px 0 60px;
}

.home-shell {
  padding: clamp(34px, 7vw, 76px) 0 60px;
}

.eyebrow,
.panel-kicker {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-copy {
  max-width: 650px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
  gap: clamp(28px, 5vw, 70px);
  align-items: center;
  min-height: calc(100vh - 190px);
}

.home-copy h1,
.page-head h1,
.admin-title h1 {
  color: var(--cream);
  letter-spacing: 0;
}

.home-copy h1 {
  max-width: 760px;
  margin-bottom: 20px;
  font-size: clamp(44px, 7vw, 82px);
  line-height: 0.98;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-top: 30px;
}

.button-link,
.text-link,
button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 46px;
  border-radius: 8px;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.button-link,
button {
  border: 0;
  padding: 12px 18px;
  background: linear-gradient(135deg, var(--accent), #9cffc9);
  color: #03110a;
  box-shadow: 0 14px 28px rgba(0, 237, 100, 0.14);
}

.button-link:hover,
button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.text-link {
  padding: 11px 8px;
  color: var(--accent);
}

.text-link:hover {
  color: var(--cream);
}

.prep-console {
  display: grid;
  gap: 18px;
  min-height: 520px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 42%),
    var(--surface);
  box-shadow: var(--shadow);
}

.console-head{
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.console-head strong{
  color: var(--accent);
}

.console-stack {
  display: grid;
  gap: 10px;
}

.console-stack span {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(4, 17, 11, 0.56);
  color: #d7eadf;
  font-weight: 760;
}

.home-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 20px;
}

.home-tile,
.question-card,
.panel,
.empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(16px);
}

.home-tile {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 154px;
  padding: 20px;
}

.home-tile:hover,
.question-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.home-tile span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.home-tile strong {
  color: var(--cream);
  font-size: 21px;
}

.home-tile small {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 360px);
  gap: 24px;
  align-items: stretch;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(0, 237, 100, 0.1), transparent 40%),
    var(--surface-soft);
  box-shadow: var(--shadow);
}

.page-head h1,
.admin-title h1 {
  max-width: 780px;
  margin-bottom: 14px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.03;
}

.topic-cloud {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.topic-cloud span {
  display: grid;
  place-items: center;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(4, 17, 11, 0.64);
  color: var(--cream);
  font-size: 13px;
  font-weight: 900;
}

.topic-cloud span:nth-child(3n) {
  color: var(--accent);
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 190px 170px;
  gap: 12px;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 24, 16, 0.76);
  backdrop-filter: blur(16px);
}

.field,
label {
  display: grid;
  gap: 7px;
  color: #cbdccf;
  font-weight: 800;
}

.field span {
  color: var(--faint);
  font-size: 12px;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(3, 16, 10, 0.86);
  color: var(--ink);
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 237, 100, 0.13);
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: #708a7a;
}

textarea {
  resize: vertical;
}

.stats {
  margin-bottom: 12px;
  color: var(--accent);
  font-weight: 850;
}

.question-list,
.compact-list,
.form {
  display: grid;
  gap: 14px;
}

.question-card {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 22px;
  overflow: hidden;
}

.question-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(var(--accent), var(--accent-dark));
}

.question-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.genre,
.type {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  text-transform: capitalize;
}

.genre {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(0, 237, 100, 0.26);
}

.type {
  background: rgba(247, 241, 223, 0.08);
  color: var(--cream);
}

.question-card h2 {
  margin: 0;
  color: var(--cream);
  font-size: 22px;
  line-height: 1.35;
}

.question-card p {
  margin-bottom: 0;
  color: #c9d8cf;
  line-height: 1.75;
}

.code-block {
  overflow-x: auto;
  margin: 2px 0 0;
  padding: 14px;
  border: 1px solid rgba(0, 237, 100, 0.18);
  border-radius: 8px;
  background: var(--code-bg);
  color: #dfffea;
  font-size: 14px;
  line-height: 1.55;
}

.empty {
  padding: 24px;
  color: var(--muted);
}

.admin-shell {
  max-width: 1180px;
}

.admin-title {
  margin-bottom: 18px;
  padding: 28px 0 4px;
}

.panel {
  padding: 24px;
  background: var(--surface-strong);
}

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

.panel-head h2 {
  margin: 0;
  color: var(--cream);
  font-size: 26px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(320px, 1.05fr);
  gap: 18px;
  align-items: start;
}

.secondary {
  background: rgba(0, 237, 100, 0.1);
  color: var(--accent);
  border: 1px solid rgba(0, 237, 100, 0.26);
  box-shadow: none;
}

.danger {
  background: rgba(255, 107, 107, 0.12);
  color: var(--danger);
  border: 1px solid rgba(255, 107, 107, 0.28);
  box-shadow: none;
}

.message {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--accent);
  font-weight: 800;
}

.signin-stage {
  display: grid;
  place-items: center;
  min-height: 360px;
  padding: clamp(42px, 9vw, 96px) 0;
}

.signin-card {
  display: grid;
  justify-items: center;
  width: min(420px, 100%);
  padding: 28px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.signin-card h2 {
  margin-bottom: 20px;
  color: var(--cream);
  font-size: 34px;
}

.login-note {
  max-width: 340px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.google-signin {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
}

.google-dock {
  display: grid;
  place-items: center;
  width: min(340px, 100%);
}

.compact-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(4, 17, 11, 0.56);
}

.compact-item strong,
.compact-item span {
  display: block;
}

.compact-item strong {
  color: var(--cream);
}

.compact-item span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  text-transform: capitalize;
}

.compact {
  box-shadow: none;
}

.hidden {
  display: none;
}

@media (max-width: 860px) {
  .home-hero,
  .page-head,
  .filters,
  .admin-grid,
  .home-strip {
    grid-template-columns: 1fr;
  }

  .home-hero {
    min-height: 0;
  }

  .prep-console {
    min-height: 430px;
  }
}

@media (max-width: 640px) {
  .topbar,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    width: 100%;
  }

  nav a {
    flex: 1;
    text-align: center;
  }

  .home-copy h1 {
    font-size: clamp(38px, 12vw, 56px);
  }

  .page-head,
  .panel,
  .signin-card {
    padding: 20px;
  }

  .topic-cloud,
  .compact-item {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════ FOOTER (PROFESSIONAL ALIGNMENT) ═══════════════ */

.site-footer {
  margin-top: 100px;
  padding: 48px 24px 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: radial-gradient(circle at top, #0d0d0d, #050505);
  color: var(--muted);
  font-size: 14px;
}

/* CONTAINER WIDTH CONTROL */
.footer-top,
.footer-console,
.footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
}

/* TOP SECTION */
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 60px;
}

/* BRAND */
.footer-brand {
  max-width: 420px;
}

.footer-brand h2 {
  color: var(--accent);
  margin-bottom: 12px;
  font-size: 22px;
}

.footer-brand p {
  line-height: 1.7;
}

/* LINKS */
.footer-links {
  min-width: 180px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* SECTION TITLE */
.footer-col h4 {
  color: rgba(255,255,255,0.85);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 6px;
}

/* LINKS */
.footer-col a {
  color: var(--muted);
  text-decoration: none;
  transition: all 0.2s ease;
  line-height: 1.6;
}

.footer-col a:hover {
  color: var(--accent);
  transform: translateX(3px);
}

/* CONSOLE STRIP */
.footer-console {
  margin-top: 36px;
  padding: 12px 16px;
  border: 1px dashed rgba(255,255,255,0.12);
  display: flex;
  gap: 10px;
  font-family: monospace;
  font-size: 12px;
  align-items: center;
}

.footer-console strong {
  color: var(--accent);
}

/* BOTTOM */
.footer-bottom {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

/* ═══════════════ RESPONSIVE (CLEAN STACK) ═══════════════ */

@media (max-width: 768px) {

  .footer-top {
    flex-direction: column;
    gap: 32px;
  }

  .footer-links {
    width: 100%;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}