:root {
  --bg: #F3F4F6;          /* Neutral light-gray background, globally accessible */
  --card: #FFFFFF;         /* Clean surface — supports glassmorphism easily */
  --accent: #655596;        /* Primary brand purple — balanced and modern */
  --accent-alt: #7C5AC9;    /* Slightly lighter purple accent for hover, focus, links */
  --fg: #111827;           /* Primary text, WCAG AA+ contrast */
  --muted: #6B7280;        /* Secondary text — balanced gray tone */
  --border: rgba(17, 24, 39, 0.08); /* Subtle borders */
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.08); /* Modern elevation */
}

/* === BASE === */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--fg);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Main grows to push footer down */
main, .main-content {
  flex: 1 0 auto;
  width: 100%;
}
/* === HEADER STYLES === */
.site-header {
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: relative;
  min-height: 80px;
}

/* Brand/Logo */
.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--accent);
  font-weight: 800;
  font-size: 1.5rem;
  gap: 0.75rem;
}

.logo {
  height: 60px;
  width: auto;
}

.brand-text {
  color: var(--accent);
}

/* Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 10;
}

.hamburger span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: var(--accent);
  border-radius: 3px;
  transition: all 0.3s ease;
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* Navigation */
.nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav a {
  text-decoration: none;
  color: var(--headline);
  font-weight: 600;
  transition: color 0.2s ease;
  padding: 0.5rem 0;
  position: relative;
}

.nav a:hover {
  color: var(--accent);
}

.nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent);
  transition: width 0.3s ease;
}

.nav a:hover::after {
  width: 100%;
}

/* Mobile Styles */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }
  
  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: white;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 5rem 2rem 2rem;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 5;
  }
  
  .nav.active {
    right: 0;
  }
  
  .nav a {
    width: 100%;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-size: 1.1rem;
  }
  
  .nav a:last-child {
    border-bottom: none;
  }
  
  /* Overlay when menu is open */
  .nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 4;
  }
  
  .nav-overlay.active {
    opacity: 1;
    visibility: visible;
  }
}

.site-footer {
  flex-shrink: 0;
  background: rgba(0,0,0,0.15);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  padding: 18px 0;
  position: relative;
  bottom: 0;
}

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

.brand {
  font-weight: 800;
  font-size: 24px;
  color: var(--accent);
}

/* === GRID / CARD === */
.grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: left;
  gap: 24px;
  margin: 10px;
  width: 100%;
}
.grid-2 > .card {
  flex: 1 1 320px;
  max-width: 500px; /* 🔒 limit each card width */
}

/* Card styling */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform .25s ease, box-shadow .25s ease;
  min-height: 260px;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 25px rgba(0,0,0,0.25);
}
.card h3 {
  font-size: 20px;
  margin-bottom: 8px;
}
.card img {
  width: 100%;
  margin-bottom: 6px;
  object-fit: cover;
}
.card p.meta {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 10px;
}
.card select {
  width: 100%;
  margin-top: 6px;
}

/* === BUTTONS === */
.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 700;
  transition: all .25s;
  box-shadow: 0 0 14px rgba(0,0,0,0.4);
  text-decoration: none;
  font-family: inherit;
  font-size: inherit;
}
.btn:hover {
  background: var(--accent-alt);
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(0,0,0,0.25);
}
.btn.secondary {
  background: rgba(16,185,129,0.1);
  color: var(--accent-alt);
  border: 1px solid var(--accent-alt);
}
.btn.secondary:hover { background: var(--accent-alt); color: #fff; }

/* === BADGES / META === */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(16,185,129,0.15);
  border: 1px solid var(--accent);
  color: var(--accent-alt);
  font-size: 13px;
  margin: 2px 4px 0 0;
}
.meta { color: var(--muted); font-size: 13px; }

/* === SELECT === */
select {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: 8px;
  padding: 6px 8px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .hero h1 { font-size: 26px; }
  .brand { font-size: 20px; }
  .nav a { margin-left: 12px; font-size: 14px; }
}
/* === EXAM LAYOUT STYLING (scoped safely) === */
.exam-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 20px 20px 120px;
  background: var(--bg);
  min-height: calc(100vh - 150px);
}

/* cards inside exam layout */
.exam-layout .card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.25);
  padding: 30px 36px;
  max-width: 800px;
  width: 100%;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.25s ease;
  min-height: auto !important;
}
.exam-layout .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.25);
}

/* first card (exam header info) */
.exam-layout .card:first-of-type {
  text-align: center;
}
.exam-layout .card:first-of-type h2 {
  color: var(--accent);
  font-size: 28px;
  margin-bottom: 10px;
}
.exam-layout .card:first-of-type .meta {
  font-size: 14px;
  color: var(--muted);
}

/* form question card */
.exam-layout form.card fieldset {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 22px;
  background: rgba(255,255,255,0.03);
}
.exam-layout form.card legend {
  font-weight: 700;
  color: var(--accent);
  font-size: 15px;
}
.exam-layout form.card p {
  font-size: 16px;
  line-height: 1.5;
  margin: 0;
}

/* answers as selectable cards */
.exam-layout form.card fieldset label {
  display: flex;
  align-items: center;
  background: rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 10px;
  padding: 10px 10px;
  margin:0;
  cursor: pointer;
  transition: all 0.2s ease;
}
.exam-layout form.card fieldset label:hover {
  background: rgba(16,185,129,0.15);
  border-color: var(--accent);
}
.exam-layout form.card fieldset input[type="radio"] {
  margin-right: 10px;
  accent-color: var(--accent);
  transform: scale(1.2);
}

/* explanation / hint section */
.exam-layout details.meta {
  background: rgba(0,0,0,0.05);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

/* buttons row */
.exam-layout form.card div[style*="margin-top"] {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
}

/* results table or summary cards */
.exam-layout .result-box {
  background: rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 14px;
  padding: 26px 32px;
  width: 100%;
  max-width: 800px;
}
.exam-layout .result-box h3 {
  color: var(--accent);
  margin-bottom: 10px;
  font-weight: 700;
}

/* responsive tweaks */
@media (max-width: 768px) {
  .exam-layout .card {
    padding: 22px 20px;
    max-width: 95%;
  }
  .exam-layout form.card fieldset label {
    font-size: 14px;
  }
}
/* === RESULT PAGE === */
.result-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: var(--bg);
  padding: 70px 20px 120px;
  min-height: calc(100vh - 120px);
}

/* === CARD BASE === */
.result-layout .summary-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  padding: 40px 48px;
  width: 100%;
  max-width: 950px;
  margin-bottom: 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all 0.25s ease;
}
.result-layout .summary-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.15);
}

/* === DASHBOARD === */
.result-layout .result-dashboard h2 {
  color: #655596;
  font-size: 28px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 30px;
  letter-spacing: -0.5px;
}
.result-layout .dashboard-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
  align-items: center;
}
.result-layout .chart-box {
  position: relative;
  width: 100%;
  height: 220px;
}

/* === EVEN GRID TILES === */
.result-layout .stats-box {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  width: 100%;
  justify-items: stretch;
  align-items: stretch;
}
.result-layout .stat-item {
  background: rgba(202, 212, 222, 0.15);
  border: 1px solid rgba(202, 212, 222, 0.4);
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.05);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 120px;
}
.result-layout .stat-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}
.result-layout .stat-item .label {
  font-size: 14px;
  color: #555;
  margin-bottom: 6px;
}
.result-layout .stat-item .value {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  color: #655596;
}
.result-layout .stat-item .value.green { color: #34B34A; }
.result-layout .stat-item .value.red { color: #DC2626; }
.result-layout .stat-item .value.accent { color: #655596; }

/* === DIFFICULTY SECTION === */
.difficulty-bar { margin-top: 40px; }
.difficulty-bar h4 {
  color: #655596;
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 16px;
  text-align: center;
}
.difficulty-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.difficulty-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.difficulty-item .label {
  width: 70px;
  font-weight: 600;
  color: #655596;
}
.difficulty-item .bar {
  flex: 1;
  height: 12px;
  background: rgba(202, 212, 222, 0.4);
  border-radius: 999px;
  overflow: hidden;
}
.difficulty-item .fill {
  height: 100%;
  background: linear-gradient(90deg, #655596, #34B34A);
  border-radius: 999px;
  transition: width 0.6s ease;
}
.difficulty-item .count {
  width: 90px;
  font-size: 13px;
  color: var(--muted);
  text-align: right;
}

/* === BREAKDOWN SECTION === */
.result-layout .summary-card h3 {
  color: #655596;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
}
.result-layout .question-item {
  background: rgba(0,0,0,0.03);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 18px;
  transition: all 0.25s ease;
}
.result-layout .question-item.correct { border-left: 5px solid #34B34A; }
.result-layout .question-item.wrong { border-left: 5px solid #DC2626; }
.result-layout .question-item h4 {
  color: #655596;
  margin-bottom: 6px;
  font-size: 16px;
  font-weight: 600;
}
.result-layout .question-item p {
  margin: 4px 0;
  font-size: 14px;
  color: var(--fg);
  line-height: 1.5;
}
.result-layout .badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.1);
  font-size: 13px;
  color: #655596;
  font-weight: 600;
  margin-right: 8px;
}
.result-layout .correct-badge {
  background: #34B34A;
  color: #fff;
  border-color: #14532d;
}
.result-layout .wrong-badge {
  background: #DC2626;
  color: #fff;
  border-color: #7f1d1d;
}
/* === RESPONSIVE === */
@media (max-width: 900px) {
  .result-layout .summary-card { padding: 28px 20px; }
  .result-layout .dashboard-grid { grid-template-columns: 1fr; gap: 24px; }
  .result-layout .chart-box { max-width: 220px; margin: 0 auto; }
  .result-layout .stats-box { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .result-layout .stats-box { grid-template-columns: 1fr; }
}



