/* =============================================
   CBT APP — GLOBAL DESIGN SYSTEM
   Nigerian Academic Excellence Theme
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&family=Nunito:wght@400;500;600&display=swap');

/* === CSS Variables === */
:root {
  --green:       #0a6640;
  --green-light: #12875a;
  --green-pale:  #e8f5ee;
  --navy:        #1a2744;
  --navy-light:  #253563;
  --gold:        #d4a017;
  --gold-light:  #f5c842;
  --red:         #c0392b;
  --red-light:   #e74c3c;
  --orange:      #d35400;
  --purple:      #6c3483;
  --bg:          #f0f4f8;
  --card:        #ffffff;
  --border:      #dce3ec;
  --text:        #1a2744;
  --text-muted:  #6b7a99;
  --text-light:  #9aa5bc;
  --shadow-sm:   0 2px 8px rgba(0,0,0,0.07);
  --shadow-md:   0 4px 20px rgba(0,0,0,0.10);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.13);
  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   20px;
  --transition:  all 0.22s ease;
}

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

/* === Base === */
body {
  font-family: 'Nunito', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  color: var(--navy);
}

/* === Top Navigation Header === */
.app-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  padding: 0 20px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.app-logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--green), var(--green-light));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 2px 8px rgba(10,102,64,0.4);
}

.app-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.app-logo-name {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: #ffffff;
  letter-spacing: 0.3px;
}

.app-logo-tagline {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.header-user {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.75);
  text-align: right;
}

.header-user strong {
  display: block;
  color: #fff;
  font-size: 0.82rem;
}

/* === Page Layout === */
.page-wrapper {
  max-width: 540px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.page-wrapper.centered {
  min-height: calc(100vh - 62px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

/* === Cards === */
.card {
  background: var(--card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 28px 24px;
  width: 100%;
}

.card-sm {
  background: var(--card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 16px;
}

/* === Section Headers === */
.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--green-pale);
}

.section-header h3 {
  font-size: 1rem;
  color: var(--navy);
}

.section-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--green-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

/* === Page Title === */
.page-title {
  text-align: center;
  margin-bottom: 6px;
  font-size: 1.4rem;
  color: var(--navy);
}

.page-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 24px;
}

/* === Form Elements === */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-input,
.form-select {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: 'Nunito', sans-serif;
  color: var(--text);
  background: #f8fafc;
  transition: var(--transition);
  outline: none;
}

.form-input:focus,
.form-select:focus {
  border-color: var(--green);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(10,102,64,0.1);
}

.form-input::placeholder { color: var(--text-light); }

/* === Buttons === */
.btn {
  display: block;
  width: 100%;
  padding: 13px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  letter-spacing: 0.2px;
  margin-bottom: 10px;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-light) 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(10,102,64,0.35);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(10,102,64,0.45);
  transform: translateY(-1px);
}

.btn-navy {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(26,39,68,0.3);
}

.btn-navy:hover {
  box-shadow: 0 6px 20px rgba(26,39,68,0.4);
  transform: translateY(-1px);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(212,160,23,0.35);
}

.btn-red {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-light) 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(192,57,43,0.3);
}

.btn-ghost {
  background: var(--bg);
  color: var(--text-muted);
  border: 2px solid var(--border);
  box-shadow: none;
}

.btn-ghost:hover {
  background: var(--border);
  transform: none;
}

.btn-sm {
  width: auto;
  display: inline-block;
  padding: 7px 14px;
  font-size: 0.82rem;
  margin-bottom: 0;
}

/* === Alert / Message Box === */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-top: 12px;
  display: none;
  font-weight: 500;
}

.alert.show { display: block; }
.alert-success { background: #e8f5ee; color: #0a6640; border-left: 4px solid var(--green); }
.alert-error   { background: #fdecea; color: #c0392b; border-left: 4px solid var(--red); }
.alert-warning { background: #fff8e6; color: #b7770d; border-left: 4px solid var(--gold); }
.alert-info    { background: #e8f0ff; color: #1a2744; border-left: 4px solid var(--navy); }

/* === Stat Boxes === */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-box {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--green);
}

.stat-box.navy  { border-top-color: var(--navy); }
.stat-box.gold  { border-top-color: var(--gold); }
.stat-box.red   { border-top-color: var(--red); }

.stat-number {
  font-family: 'Poppins', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--navy);
  display: block;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* === Badges === */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.badge-pass   { background: #e8f5ee; color: #0a6640; }
.badge-fail   { background: #fdecea; color: #c0392b; }
.badge-gold   { background: #fff8e6; color: #b7770d; }
.badge-navy   { background: #e8f0ff; color: #1a2744; }

/* === Tables === */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

.data-table th {
  background: var(--navy);
  color: rgba(255,255,255,0.9);
  padding: 10px 10px;
  text-align: left;
  font-family: 'Poppins', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.data-table th:first-child { border-radius: 6px 0 0 0; }
.data-table th:last-child  { border-radius: 0 6px 0 0; }

.data-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f8fafc; }

/* === Select / Option Buttons === */
.option-btn {
  display: block;
  width: 100%;
  padding: 13px 16px;
  margin-bottom: 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  font-size: 0.93rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.option-btn:hover,
.option-btn.selected {
  border-color: var(--green);
  background: var(--green-pale);
  color: var(--green);
}

.option-btn.selected {
  box-shadow: 0 0 0 3px rgba(10,102,64,0.12);
}

/* === Category Cards === */
.category-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px;
  margin-bottom: 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.category-card:hover {
  border-color: var(--green);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.category-card-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.cat-jamb     { background: linear-gradient(135deg,#e8f5ee,#c6e9d7); }
.cat-waec     { background: linear-gradient(135deg,#e8f0ff,#c8d9ff); }
.cat-neco     { background: linear-gradient(135deg,#fff8e6,#fce5a0); }
.cat-postutme { background: linear-gradient(135deg,#fdecea,#fac5c0); }

.category-card-body { flex: 1; }

.category-card-name {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--navy);
  display: block;
}

.category-card-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.category-card-arrow {
  color: var(--text-light);
  font-size: 1.1rem;
}

/* === Progress Bar === */
.progress-wrap {
  background: var(--border);
  border-radius: 20px;
  height: 8px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--green), var(--green-light));
  transition: width 0.4s ease;
}

/* === Timer === */
.timer-display {
  text-align: center;
  font-family: 'Poppins', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--green);
  background: var(--green-pale);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  margin-bottom: 16px;
  transition: var(--transition);
}

.timer-display.warning { background: #fff8e6; color: var(--orange); }
.timer-display.danger  { background: #fdecea; color: var(--red); }

/* === Instruction Box === */
.instruction-box {
  background: #fffbeb;
  border: 1.5px solid #f6d860;
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 14px;
  font-size: 0.87rem;
  color: #7d5a00;
  line-height: 1.8;
}

.instruction-box strong {
  display: block;
  margin-bottom: 6px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.93rem;
  color: var(--navy);
}

.instruction-box.green {
  background: var(--green-pale);
  border-color: #8fd4ae;
  color: #0a5c36;
}

/* === Back Link === */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 18px;
  background: none;
  border: none;
  padding: 0;
  transition: var(--transition);
}

.back-link:hover { color: var(--green); }

/* === Breadcrumb === */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.breadcrumb span {
  color: var(--green);
  font-weight: 700;
}

/* === Score Badge === */
.score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-family: 'Poppins', sans-serif;
  box-shadow: var(--shadow-md);
}

.score-circle.pass {
  background: linear-gradient(135deg, var(--green), var(--green-light));
  color: white;
}

.score-circle.fail {
  background: linear-gradient(135deg, var(--red), var(--red-light));
  color: white;
}

.score-circle .score-number {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
}

.score-circle .score-label {
  font-size: 0.7rem;
  opacity: 0.85;
}

/* === Divider === */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

.divider-text {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  margin: 16px 0;
  position: relative;
}

.divider-text::before,
.divider-text::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 35%;
  height: 1px;
  background: var(--border);
}

.divider-text::before { left: 0; }
.divider-text::after  { right: 0; }

/* === Forgot password link === */
.text-link {
  background: none;
  border: none;
  color: var(--green);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  display: block;
  text-align: center;
  margin-bottom: 12px;
  transition: var(--transition);
}

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

/* === Welcome Banner === */
.welcome-banner {
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
  color: white;
  display: none;
}

.welcome-banner.show { display: block; }

.welcome-banner h3 {
  color: white;
  font-size: 1rem;
  margin-bottom: 4px;
}

.welcome-banner p {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.65);
}

/* === Nav Menu (logged in) === */
.nav-menu {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.nav-menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 18px 10px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  background: var(--card);
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--navy);
  text-decoration: none;
}

.nav-menu-item:hover {
  border-color: var(--green);
  background: var(--green-pale);
  color: var(--green);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.nav-menu-item .nav-icon { font-size: 1.6rem; }

.nav-menu-item.full-width {
  grid-column: span 2;
}

/* === Loading State === */
.loading-text {
  text-align: center;
  color: var(--text-muted);
  padding: 30px 0;
  font-size: 0.9rem;
}

/* === Access Denied === */
.access-denied {
  text-align: center;
  color: var(--red);
  padding: 40px 0;
  display: none;
}

.access-denied .icon { font-size: 3rem; margin-bottom: 10px; }

/* === Footer === */
.app-footer {
  text-align: center;
  color: var(--text-light);
  font-size: 0.75rem;
  padding: 20px 16px;
  margin-top: 10px;
}

/* === Animations === */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeInUp 0.35s ease both;
}

.animate-in-delay-1 { animation-delay: 0.05s; }
.animate-in-delay-2 { animation-delay: 0.10s; }
.animate-in-delay-3 { animation-delay: 0.15s; }
.animate-in-delay-4 { animation-delay: 0.20s; }

/* === Responsive === */
@media (max-width: 400px) {
  .card { padding: 20px 16px; }
  .stats-row { gap: 8px; }
  .stat-number { font-size: 1.3rem; }
  .nav-menu-item { padding: 14px 8px; }
}