/* ================================================
   CogitaVerse Academy — Main Stylesheet
   Deep Navy + Electric Blue + Clean White
   ================================================ */

:root {
  --cva-primary:  #1B2E6B;
  --cva-accent:   #3B6FE8;
  --cva-green:    #16A34A;
  --cva-red:      #DC2626;
  --cva-amber:    #D97706;
  --cva-bg:       #F4F6FC;
  --cva-white:    #FFFFFF;
  --cva-border:   #E2E8F0;
  --cva-text:     #1A1A2E;
  --cva-muted:    #64748B;
  --cva-radius:   10px;
  --cva-shadow:   0 2px 12px rgba(27,46,107,0.08);
}

/* ── Base ── */
.cva-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 60px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--cva-text);
  background: var(--cva-bg);
  min-height: 100vh;
}

/* ── Urdu RTL ── */
.cva-ur {
  direction: rtl;
  font-family: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', serif;
  line-height: 2;
}

/* ── Cards ── */
.cva-card {
  background: var(--cva-white);
  border: 1px solid var(--cva-border);
  border-radius: var(--cva-radius);
  box-shadow: var(--cva-shadow);
  padding: 20px;
  margin-bottom: 16px;
}

/* ── Buttons ── */
.cva-btn {
  display: inline-block;
  padding: 9px 20px;
  border-radius: 7px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all .15s;
}
.cva-btn-primary { background: var(--cva-accent);  color: #fff; }
.cva-btn-dark    { background: var(--cva-primary); color: #fff; }
.cva-btn-success { background: var(--cva-green);   color: #fff; }
.cva-btn-outline { background: transparent; border: 1.5px solid var(--cva-accent); color: var(--cva-accent); }
.cva-btn-primary:hover { background: #2d5ccc; color: #fff; }
.cva-btn-dark:hover    { background: #142255; color: #fff; }

/* ── Progress bar ── */
.cva-progress { height: 8px; background: var(--cva-border); border-radius: 4px; }
.cva-progress-fill { height: 8px; border-radius: 4px; transition: width .4s; }
.cva-fill-blue  { background: var(--cva-accent); }
.cva-fill-green { background: var(--cva-green);  }
.cva-fill-amber { background: var(--cva-amber);  }

/* ── Badges ── */
.cva-badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}
.cva-badge-blue  { background: #DBEAFE; color: #1E40AF; }
.cva-badge-green { background: #DCFCE7; color: #166534; }
.cva-badge-amber { background: #FEF3C7; color: #92400E; }
.cva-badge-gray  { background: #F1F5F9; color: #475569; }
.cva-badge-red   { background: #FEE2E2; color: #991B1B; }

/* ── Hero banner ── */
.cva-hero {
  background: linear-gradient(135deg, var(--cva-primary) 0%, var(--cva-accent) 100%);
  color: #fff;
  padding: 3rem 2rem;
  border-radius: var(--cva-radius);
  text-align: center;
  margin-bottom: 2rem;
}
.cva-hero h1 { font-size: 2.2rem; font-weight: 800; margin: 0 0 .5rem; }
.cva-hero p  { font-size: 1.05rem; opacity: .88; margin: 0; }

/* ── Category grid ── */
.cva-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 2rem;
}
.cva-cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 1rem;
  background: var(--cva-white);
  border: 1.5px solid var(--cva-border);
  border-radius: var(--cva-radius);
  text-decoration: none;
  transition: all .15s;
  cursor: pointer;
}
.cva-cat-card:hover {
  border-color: var(--cva-accent);
  box-shadow: var(--cva-shadow);
  transform: translateY(-2px);
}
.cva-cat-icon { font-size: 2.2rem; margin-bottom: .6rem; }
.cva-cat-name { font-weight: 700; color: var(--cva-text);  font-size: .95rem; }
.cva-cat-ur   { font-size: .82rem; color: var(--cva-muted); margin-top: 2px; direction: rtl; }

/* ── Subject list ── */
.cva-subject-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--cva-white);
  border: 1px solid var(--cva-border);
  border-radius: var(--cva-radius);
  text-decoration: none;
  margin-bottom: 10px;
  transition: all .15s;
}
.cva-subject-row:hover {
  border-color: var(--cva-accent);
  box-shadow: var(--cva-shadow);
}
.cva-sub-icon {
  width: 44px; height: 44px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
  background: #DBEAFE; color: var(--cva-accent);
}
.cva-sub-info   { flex: 1; }
.cva-sub-title  { font-weight: 600; color: var(--cva-text); font-size: .95rem; }
.cva-sub-meta   { font-size: .78rem; color: var(--cva-muted); margin-top: 3px; }

/* ── Stats row ── */
.cva-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px,1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.cva-stat {
  background: var(--cva-white);
  border: 1px solid var(--cva-border);
  border-radius: var(--cva-radius);
  padding: 16px 12px;
  text-align: center;
}
.cva-stat-num   { font-size: 2rem; font-weight: 700; color: var(--cva-accent); }
.cva-stat-label { font-size: .75rem; color: var(--cva-muted); margin-top: 4px; }

/* ── Quiz screen ── */
.cva-quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.cva-timer {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--cva-accent);
  background: #DBEAFE;
  padding: 6px 18px;
  border-radius: 8px;
  min-width: 90px;
  text-align: center;
}
.cva-timer.warning { color: var(--cva-red); background: #FEE2E2; }
.cva-question-box {
  background: var(--cva-white);
  border: 1.5px solid var(--cva-border);
  border-radius: var(--cva-radius);
  padding: 22px 26px;
  margin-bottom: 16px;
  font-size: 1.05rem;
  line-height: 1.8;
  width: 100%;
  box-sizing: border-box;
}
.cva-question-text    { font-weight: 600; color: var(--cva-text);  margin-bottom: 6px; }
.cva-question-text-ur { color: var(--cva-muted); direction: rtl; font-size: 1rem; }
.cva-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 13px 18px;
  border: 1.5px solid var(--cva-border);
  border-radius: 8px;
  background: var(--cva-white);
  font-size: .95rem;
  color: var(--cva-text);
  cursor: pointer;
  margin-bottom: 10px;
  transition: all .12s;
  line-height: 1.7;
  box-sizing: border-box;
}
.cva-option:hover    { border-color: var(--cva-accent); background: #EFF6FF; }
.cva-option.selected { border-color: var(--cva-accent); background: #DBEAFE; color: #1E40AF; font-weight: 600; }
.cva-option.correct  { border-color: var(--cva-green);  background: #DCFCE7; color: #166534; font-weight: 600; }
.cva-option.wrong    { border-color: var(--cva-red);    background: #FEE2E2; color: #991B1B; }

/* ── Result screen ── */
.cva-result       { text-align: center; padding: 2rem 1rem; }
.cva-result-score { font-size: 4.5rem; font-weight: 800; color: var(--cva-accent); line-height: 1; }
.cva-result-pct   { font-size: 1.1rem; color: var(--cva-muted); margin-top: 6px; }
.cva-result-msg   { font-size: 1.2rem; font-weight: 600; margin: 1rem 0; color: var(--cva-text); }

/* ── Back link ── */
.cva-back {
  display: inline-block;
  color: var(--cva-accent);
  text-decoration: none;
  margin-bottom: 1rem;
  font-size: .9rem;
  font-weight: 500;
}
.cva-back:hover { text-decoration: underline; }

/* ── Section title ── */
.cva-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--cva-text);
  margin: 1.5rem 0 .8rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--cva-border);
}

/* ── Login / register message ── */
.cva-login-msg {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 1rem 1.2rem;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .cva-hero h1        { font-size: 1.5rem; }
  .cva-cat-grid       { grid-template-columns: repeat(2,1fr); }
  .cva-stats-grid     { grid-template-columns: repeat(2,1fr); }
  .cva-quiz-header    { flex-direction: column; gap: 10px; align-items: flex-start; }
  .cva-result-score   { font-size: 3rem; }
  .cva-question-box   { padding: 16px; }
  .cva-option         { padding: 10px 14px; }
}
/* ================================================
   Auth Pages — Register & Login
   ================================================ */

.cva-auth-box {
  max-width: 480px;
  margin: 2rem auto;
  background: var(--cva-white);
  border: 1px solid var(--cva-border);
  border-radius: var(--cva-radius);
  box-shadow: var(--cva-shadow);
  padding: 2.5rem 2rem;
}

.cva-auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.cva-auth-logo h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--cva-primary);
  margin: 0 0 .4rem;
}
.cva-auth-logo p {
  color: var(--cva-muted);
  font-size: .9rem;
  margin: 0;
  direction: rtl;
}

/* ── Form fields ── */
.cva-field {
  margin-bottom: 1.2rem;
}
.cva-field label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--cva-text);
  margin-bottom: .4rem;
}
.cva-field input,
.cva-field select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--cva-border);
  border-radius: 7px;
  font-size: .95rem;
  color: var(--cva-text);
  background: var(--cva-white);
  box-sizing: border-box;
  transition: border-color .12s;
}
.cva-field input:focus,
.cva-field select:focus {
  outline: none;
  border-color: var(--cva-accent);
  box-shadow: 0 0 0 3px rgba(59,111,232,.1);
}
.cva-field input::placeholder {
  color: #b0b8c9;
}

/* ── Remember me checkbox ── */
.cva-remember label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  cursor: pointer;
}
.cva-remember input[type=checkbox] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ── Full width button ── */
.cva-btn-full {
  width: 100%;
  text-align: center;
  padding: 12px;
  font-size: 1rem;
  margin-top: .5rem;
}

/* ── Messages ── */
.cva-msg {
  padding: 12px 16px;
  border-radius: 7px;
  font-size: .9rem;
  margin-bottom: 1.2rem;
  text-align: center;
}
.cva-msg-success {
  background: #DCFCE7;
  color: #166534;
  border: 1px solid #86EFAC;
}
.cva-msg-error {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FCA5A5;
}

/* ── Switch link ── */
.cva-auth-switch {
  text-align: center;
  font-size: .85rem;
  color: var(--cva-muted);
  margin-top: 1.2rem;
}
.cva-auth-switch a {
  color: var(--cva-accent);
  font-weight: 600;
  text-decoration: none;
}
.cva-auth-switch a:hover {
  text-decoration: underline;
}

/* ── Mobile auth ── */
@media (max-width: 520px) {
  .cva-auth-box {
    padding: 1.5rem 1rem;
    margin: 1rem auto;
  }
}
/* ── Required and optional markers ── */
.cva-required { color: #DC2626; font-weight: 700; }
.cva-optional { color: #888; font-weight: 400; font-size: .78rem; }
/* ================================================
   Phase 3 — Courses, Categories, Dashboard
   ================================================ */

/* ── Search bar ── */
.cva-search-wrap {
  margin-bottom: 1.5rem;
}
.cva-search-form {
  display: flex;
  gap: 10px;
}
.cva-search-input {
  flex: 1;
  padding: 10px 16px;
  border: 1.5px solid var(--cva-border);
  border-radius: 8px;
  font-size: .95rem;
  color: var(--cva-text);
  background: var(--cva-white);
  box-sizing: border-box;
}
.cva-search-input:focus {
  outline: none;
  border-color: var(--cva-accent);
  box-shadow: 0 0 0 3px rgba(59,111,232,.1);
}

/* ── Filter buttons ── */
.cva-filter-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}
.cva-filter-label {
  font-size: .85rem;
  color: var(--cva-muted);
  font-weight: 600;
}
.cva-filter-btn {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid var(--cva-border);
  color: var(--cva-muted);
  background: var(--cva-white);
  transition: all .12s;
}
.cva-filter-btn:hover,
.cva-filter-btn.active {
  border-color: var(--cva-accent);
  color: var(--cva-accent);
  background: #EFF6FF;
}

/* ── Category card count ── */
.cva-cat-count {
  font-size: .75rem;
  color: var(--cva-muted);
  margin-top: 4px;
}

/* ── Empty state ── */
.cva-empty {
  color: var(--cva-muted);
  font-style: italic;
  padding: 1.5rem 0;
  text-align: center;
}

/* ── Page title ── */
.cva-page-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--cva-primary);
  margin-bottom: 1.2rem;
}
.cva-page-title .cva-ur {
  font-size: 1rem;
  color: var(--cva-muted);
  font-weight: 400;
  margin-left: 8px;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .cva-search-form  { flex-direction: column; }
  .cva-filter-wrap  { gap: 6px; }
  .cva-page-title   { font-size: 1.3rem; }
}