/* ──────────────────────────────────────────────
   COBRA BACK FOUNDATION — Financial Literacy Program
   Light Theme — matching CobraBack.org
   Brand Colors: Navy #0a1628 | Green #22c55e | Cream #f5f4f0
   ────────────────────────────────────────────── */

:root {
  --navy:        #0a1628;
  --navy-mid:    #112240;
  --navy-light:  #1e3a5f;
  --green:       #22c55e;
  --green-dark:  #16a34a;
  --green-light: #4ade80;
  --green-glow:  #86efac;
  --silver:      #64748b;
  --silver-light:#94a3b8;
  --bg:          #f5f4f0;
  --bg-alt:      #eeecea;
  --white:       #ffffff;
  --gold:        #f59e0b;
  --gold-light:  #fbbf24;
  --red:         #ef4444;
  --card-bg:     #ffffff;
  --border:      #e2e8f0;
  --text:        #1e293b;
  --text-muted:  #64748b;
  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 4px 24px rgba(0,0,0,0.07);
  --shadow-green:0 0 20px rgba(34,197,94,0.18);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── TYPOGRAPHY ── */
h1,h2,h3,h4,h5 { color: var(--navy); font-weight: 700; line-height: 1.3; }
h1 { font-size: clamp(1.8rem, 4vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.6rem); }
p  { color: var(--text); line-height: 1.7; }
a  { color: var(--green-dark); text-decoration: none; transition: color .2s; }
a:hover { color: var(--green); }
strong { color: var(--navy); }
em { color: var(--green-dark); }
blockquote {
  border-left: 4px solid var(--green);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: rgba(34,197,94,0.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--green-dark);
}

/* ── LAYOUT ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.section    { padding: 5rem 0; }
.section-sm { padding: 3rem 0; }

/* ── NAVBAR ── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
  transition: all .3s;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .65rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  cursor: pointer;
}
.nav-logo img { height: 44px; width: auto; }
.nav-logo-text { display: flex; flex-direction: column; }
.nav-logo-text .brand { font-size: .95rem; font-weight: 800; color: var(--navy); letter-spacing: .5px; }
.nav-logo-text .sub   { font-size: .65rem; color: var(--green-dark); letter-spacing: 1px; text-transform: uppercase; }
.nav-links { display: flex; gap: .15rem; align-items: center; }
.nav-links a {
  color: var(--navy);
  font-size: .9rem;
  font-weight: 500;
  padding: .5rem .9rem;
  border-radius: var(--radius-sm);
  transition: all .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--navy); background: var(--bg-alt); }
.nav-cta {
  background: var(--green) !important;
  color: #fff !important;
  font-weight: 700 !important;
  padding: .5rem 1.2rem !important;
  border-radius: var(--radius-sm) !important;
}
.nav-cta:hover { background: var(--green-dark) !important; color: #fff !important; }
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
}
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--navy); border-radius: 2px; transition: all .3s; }

/* ── MOBILE NAV ── */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: 65px; left: 0; right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 1rem;
    gap: .5rem;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    transform: translateY(-110%);
    transition: transform .3s;
    z-index: 999;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { width: 100%; text-align: center; padding: .75rem; }
}

/* ── HERO ── */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 50%, #0d2137 100%);
  position: relative;
  overflow: hidden;
  padding-top: 80px;
}
#hero::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(ellipse at 30% 40%, rgba(34,197,94,0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 60%, rgba(30,58,95,0.4) 0%, transparent 60%);
  pointer-events: none;
}
.hero-content {
  text-align: center;
  position: relative;
  z-index: 1;
  width: 100%;
}
/* override heading color inside hero */
#hero h1, #hero h2, #hero h3, #hero h4 { color: #fff; }
#hero p { color: #cbd5e1; }
.hero-logo { width: min(320px, 85vw); margin: 0 auto 2rem; display: block; filter: drop-shadow(0 0 30px rgba(34,197,94,0.25)); }
.hero-title { margin-bottom: 1rem; }
.hero-title .accent { color: var(--green-light); }
.hero-subtitle { font-size: clamp(1rem, 2.5vw, 1.3rem); color: #94a3b8; max-width: 600px; margin: 0 auto 2.5rem; }
.hero-badges { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; margin-bottom: 2.5rem; }
.badge {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.25);
  color: #e2e8f0;
  padding: .4rem 1rem;
  border-radius: 50px;
  font-size: .85rem;
  font-weight: 600;
}
.hero-ctas { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .85rem 2rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all .25s;
  text-decoration: none;
}
.btn-primary {
  background: var(--green);
  color: #fff;
}
.btn-primary:hover { background: var(--green-dark); transform: translateY(-2px); box-shadow: 0 8px 25px rgba(34,197,94,0.3); color: #fff; }
.btn-secondary {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.4);
}
.btn-secondary:hover { border-color: var(--green-light); color: var(--green-light); transform: translateY(-2px); }
/* secondary on light backgrounds */
.btn-secondary.light {
  color: var(--navy);
  border-color: var(--navy);
}
.btn-secondary.light:hover { border-color: var(--green); color: var(--green-dark); }
.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { background: #dc2626; transform: translateY(-2px); }
.btn-sm { padding: .5rem 1.2rem; font-size: .85rem; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ── CARDS ── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: all .3s;
  box-shadow: var(--shadow);
}
.card:hover { border-color: rgba(34,197,94,0.35); box-shadow: var(--shadow-green); transform: translateY(-3px); }
.card-grid { display: grid; gap: 1.5rem; }
.card-grid-2 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card-grid-3 { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

/* ── SECTION HEADERS ── */
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header .label {
  display: inline-block;
  background: rgba(34,197,94,0.1);
  color: var(--green-dark);
  border: 1px solid rgba(34,197,94,0.3);
  padding: .3rem .9rem;
  border-radius: 50px;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.section-header p { color: var(--silver); max-width: 600px; margin: .75rem auto 0; font-size: 1.1rem; }

/* ── STATS BAR ── */
.stats-bar {
  background: var(--white);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 2rem 0;
}
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; text-align: center; }
.stat-num { font-size: 2.5rem; font-weight: 900; color: var(--green-dark); line-height: 1; }
.stat-label { color: var(--silver); font-size: .85rem; margin-top: .25rem; }

/* ── FORMS ── */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; color: var(--navy); font-size: .85rem; font-weight: 600; margin-bottom: .5rem; letter-spacing: .3px; }
.form-control {
  width: 100%;
  padding: .8rem 1rem;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .95rem;
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(34,197,94,0.1); }
.form-control::placeholder { color: var(--silver-light); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-hint { font-size: .78rem; color: var(--silver); margin-top: .4rem; }
select.form-control { cursor: pointer; }
select.form-control option { background: var(--white); color: var(--text); }

/* ── ALERTS ── */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: .9rem;
  display: flex;
  align-items: flex-start;
  gap: .75rem;
}
.alert-error   { background: rgba(239,68,68,0.08);  border: 1px solid rgba(239,68,68,0.25);  color: #b91c1c; }
.alert-success { background: rgba(34,197,94,0.08);  border: 1px solid rgba(34,197,94,0.25);  color: #15803d; }
.alert-warning { background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.25); color: #b45309; }
.alert-info    { background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.25); color: #1e40af; }

/* ── PROGRESS BAR ── */
.progress-track {
  background: var(--bg-alt);
  border-radius: 50px;
  height: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-dark), var(--green));
  border-radius: 50px;
  transition: width 1s ease;
  position: relative;
}
.progress-fill::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 20px; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
  border-radius: 50px;
}
.progress-label { display: flex; justify-content: space-between; margin-top: .5rem; }
.progress-label span { font-size: .8rem; color: var(--silver); }
.progress-label .pct { color: var(--green-dark); font-weight: 700; }

/* ── CHAPTER LIST ── */
.chapter-list { display: flex; flex-direction: column; gap: .75rem; }
.chapter-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.chapter-item:hover:not(.locked) { border-color: var(--green); background: rgba(34,197,94,0.04); }
.chapter-item.locked { opacity: .55; cursor: not-allowed; }
.chapter-item.completed { border-color: rgba(34,197,94,0.4); }
.chapter-num {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: .9rem;
  flex-shrink: 0;
}
.chapter-num.unlocked  { background: rgba(34,197,94,0.15);  color: var(--green-dark); }
.chapter-num.completed { background: var(--green); color: #fff; }
.chapter-num.locked    { background: var(--bg-alt); color: var(--silver); border: 1px solid var(--border); }
.chapter-num.in-progress { background: rgba(245,158,11,0.15); color: #b45309; }
.chapter-info { flex: 1; min-width: 0; }
.chapter-info h4 { font-size: .95rem; color: var(--navy); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chapter-info span { font-size: .78rem; color: var(--silver); }
.chapter-icon { font-size: 1.2rem; flex-shrink: 0; }

/* ── QUIZ ── */
.quiz-question {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}
.quiz-question p { font-weight: 600; color: var(--navy); margin-bottom: 1rem; font-size: 1.05rem; }
.quiz-options { display: flex; flex-direction: column; gap: .6rem; }
.quiz-option {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .2s;
  font-size: .95rem;
  color: var(--text);
}
.quiz-option:hover { border-color: var(--green); background: rgba(34,197,94,0.05); }
.quiz-option.selected { border-color: var(--green); background: rgba(34,197,94,0.08); }
.quiz-option.correct  { border-color: var(--green-dark); background: rgba(34,197,94,0.15); color: #15803d; }
.quiz-option.wrong    { border-color: var(--red); background: rgba(239,68,68,0.08); color: #b91c1c; }
.quiz-option input { accent-color: var(--green); }

/* ── EXERCISE PANELS ── */
.exercise-panel {
  background: linear-gradient(135deg, rgba(34,197,94,0.05), rgba(245,250,255,0.8));
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: var(--radius);
  padding: 2rem;
  margin: 2rem 0;
}
.exercise-panel h3 { color: var(--green-dark); margin-bottom: 1rem; }
.drag-zone {
  min-height: 80px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-content: flex-start;
  transition: border-color .2s;
  background: var(--white);
}
.drag-zone.drag-over { border-color: var(--green); background: rgba(34,197,94,0.04); }
.drag-item {
  padding: .5rem 1rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 50px;
  cursor: grab;
  font-size: .85rem;
  color: var(--navy);
  user-select: none;
  transition: all .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.drag-item:hover { border-color: var(--green); color: var(--green-dark); }
.drag-item.dragging { opacity: .5; }
.budget-bar { height: 8px; border-radius: 50px; background: var(--bg-alt); margin: .5rem 0; overflow: hidden; border: 1px solid var(--border); }
.budget-fill { height: 100%; border-radius: 50px; transition: width .5s; }
.scenario-choice {
  padding: 1rem 1.25rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-bottom: .75rem;
  transition: all .2s;
  background: var(--white);
  color: var(--text);
}
.scenario-choice:hover { border-color: var(--green); background: rgba(34,197,94,0.04); }
.scenario-choice.correct { border-color: var(--green-dark); background: rgba(34,197,94,0.12); }
.scenario-choice.wrong { border-color: var(--red); background: rgba(239,68,68,0.06); }

/* ── VIDEO EMBED ── */
.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-alt);
  border: 1px solid var(--border);
}
.video-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--silver);
  gap: 1rem;
  font-size: .9rem;
}
.video-placeholder .icon { font-size: 3rem; }

/* ── CERTIFICATE ── */
#certificate-view {
  background: #f8f4e8;
  border: 3px solid #b8960c;
  border-radius: 4px;
  padding: 4rem;
  text-align: center;
  color: #1a1a2e;
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  font-family: 'Georgia', serif;
}
#certificate-view::before,
#certificate-view::after {
  content: '';
  position: absolute;
  top: 12px; left: 12px; right: 12px; bottom: 12px;
  border: 1px solid rgba(184,150,12,0.4);
  pointer-events: none;
}
.cert-logo { width: 120px; margin: 0 auto 1.5rem; display: block; }
.cert-title { font-size: 2rem; color: #0a1628; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; margin-bottom: .5rem; }
.cert-subtitle { font-size: 1rem; color: #555; margin-bottom: 1rem; }
.cert-name { font-size: 2.5rem; color: #b8960c; font-weight: 700; margin: 1rem 0; font-style: italic; }
.cert-course { font-size: 1.1rem; color: #0a1628; margin-bottom: 1.5rem; }
.cert-meta { display: flex; justify-content: space-around; margin: 1.5rem 0; }
.cert-meta-item { text-align: center; }
.cert-meta-item .label { font-size: .75rem; color: #777; text-transform: uppercase; letter-spacing: 1px; }
.cert-meta-item .value { font-size: .95rem; color: #0a1628; font-weight: 700; margin-top: .25rem; }
.cert-quote { font-style: italic; color: #444; font-size: .95rem; margin: 1.5rem 0; border-top: 1px solid rgba(184,150,12,0.3); border-bottom: 1px solid rgba(184,150,12,0.3); padding: 1rem; }
.cert-sig { margin-top: 1.5rem; }
.cert-sig .sig-name { font-size: 1.3rem; font-weight: 700; color: #0a1628; }
.cert-sig .sig-title { font-size: .85rem; color: #666; }

/* ── ADMIN PANEL ── */
.admin-layout { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; padding-top: 65px; }
.admin-sidebar {
  background: var(--navy);
  border-right: 1px solid rgba(255,255,255,0.08);
  padding: 1.5rem 0;
  position: sticky;
  top: 65px;
  height: calc(100vh - 65px);
  overflow-y: auto;
}
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1.5rem;
  color: #94a3b8;
  font-size: .9rem;
  cursor: pointer;
  transition: all .2s;
  border-left: 3px solid transparent;
}
.admin-nav-item:hover, .admin-nav-item.active {
  background: rgba(34,197,94,0.12);
  color: var(--green-light);
  border-left-color: var(--green);
}
.admin-nav-item .icon { font-size: 1.1rem; }
.admin-content { padding: 2rem; overflow-x: hidden; background: var(--bg); }
.admin-section { display: none; }
.admin-section.active { display: block; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-card .num { font-size: 2.5rem; font-weight: 900; color: var(--green-dark); }
.stat-card .lbl { color: var(--silver); font-size: .85rem; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; background: var(--white); }
thead tr { background: var(--bg-alt); }
th { padding: .85rem 1rem; text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; color: var(--navy); white-space: nowrap; }
td { padding: .85rem 1rem; border-top: 1px solid var(--border); font-size: .88rem; color: var(--text); }
tr:hover td { background: rgba(34,197,94,0.03); }
.badge-status {
  display: inline-flex;
  padding: .25rem .7rem;
  border-radius: 50px;
  font-size: .75rem;
  font-weight: 600;
}
.badge-green  { background: rgba(34,197,94,0.12);  color: #15803d; }
.badge-yellow { background: rgba(245,158,11,0.12); color: #b45309; }
.badge-red    { background: rgba(239,68,68,0.12);  color: #b91c1c; }
.badge-silver { background: rgba(100,116,139,0.12);color: var(--silver); }

/* ── STORE ── */
.product-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all .3s;
  box-shadow: var(--shadow);
}
.product-card:hover { border-color: rgba(34,197,94,0.35); transform: translateY(-4px); box-shadow: var(--shadow-green); }
.product-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--silver);
}
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.product-info { padding: 1.25rem; }
.product-info h4 { color: var(--navy); margin-bottom: .5rem; }
.product-info p { color: var(--silver); font-size: .85rem; margin-bottom: 1rem; }
.product-price { font-size: 1.4rem; font-weight: 800; color: var(--green-dark); margin-bottom: 1rem; }
.cart-badge {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--green);
  color: #fff;
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(34,197,94,0.4);
  z-index: 500;
  transition: all .2s;
}
.cart-badge:hover { transform: scale(1.1); }
.cart-count {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--red);
  color: white;
  width: 20px; height: 20px;
  border-radius: 50%;
  font-size: .7rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(.95);
  transition: transform .25s;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.modal-close { background: none; border: none; color: var(--silver); font-size: 1.5rem; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--navy); }

/* ── DONATION ── */
.donation-amounts { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; }
.donation-amt {
  padding: .6rem 1.2rem;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--navy);
  cursor: pointer;
  font-weight: 600;
  font-size: .95rem;
  transition: all .2s;
}
.donation-amt:hover, .donation-amt.active { border-color: var(--green); color: var(--green-dark); background: rgba(34,197,94,0.06); }

/* ── LOADING ── */
.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  flex-direction: column;
  gap: 1rem;
  color: var(--silver);
}
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── MILESTONE ── */
.milestone-banner {
  background: linear-gradient(135deg, rgba(34,197,94,0.1), rgba(34,197,94,0.05));
  border: 1px solid rgba(34,197,94,0.35);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  animation: glow 2s ease-in-out infinite alternate;
}
@keyframes glow {
  from { box-shadow: 0 0 10px rgba(34,197,94,0.15); }
  to   { box-shadow: 0 0 25px rgba(34,197,94,0.35); }
}

/* ── TABS ── */
.tabs { display: flex; gap: .25rem; border-bottom: 2px solid var(--border); margin-bottom: 1.5rem; flex-wrap: wrap; }
.tab {
  padding: .75rem 1.25rem;
  color: var(--silver);
  font-size: .9rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.tab:hover { color: var(--navy); }
.tab.active { color: var(--green-dark); border-bottom-color: var(--green); }

/* ── PAGE SECTIONS ── */
#page-home,#page-about,#page-course-overview,#page-shop,#page-donate,
#page-login,#page-register,#page-pretest,#page-dashboard,
#page-chapter,#page-quiz,#page-certificate,#page-admin,#page-videos {
  min-height: 100vh;
  padding-top: 80px;
}
/* give inner app pages white cards area a slight contrast from cream body */
#page-pretest .container,
#page-dashboard .container,
#page-chapter .container,
#page-quiz .container,
#page-certificate .container { max-width: 860px; }

/* ── ABOUT PAGE ── */
.about-mission {
  background: linear-gradient(135deg, var(--navy), var(--navy-mid));
  border-radius: var(--radius);
  padding: 3rem;
  border: none;
  text-align: center;
}
.about-mission h2, .about-mission h3, .about-mission h4, .about-mission p { color: #e2e8f0; }
.mission-quote {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: var(--green-light);
  font-style: italic;
  font-weight: 700;
  margin: 2rem 0;
}

/* ── FILL IN BLANK ── */
.blank-input {
  display: inline-block;
  min-width: 120px;
  border-bottom: 2px solid var(--green);
  background: transparent;
  color: var(--navy);
  text-align: center;
  padding: .2rem .5rem;
  font-size: .95rem;
  border-top: none;
  border-left: none;
  border-right: none;
  outline: none;
}
.blank-input.correct { color: var(--green-dark); }
.blank-input.wrong { color: #b91c1c; border-bottom-color: var(--red); }

/* ── FOOTER ── */
footer {
  background: var(--navy);
  border-top: none;
  padding: 3rem 0 1.5rem;
  margin-top: auto;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3rem; margin-bottom: 2rem; }
.footer-logo { width: 100px; margin-bottom: 1rem; }
.footer-desc { color: #94a3b8; font-size: .9rem; line-height: 1.7; }
.footer-col h4 { color: #fff; font-size: .9rem; margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 1px; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.footer-links a { color: #94a3b8; font-size: .85rem; transition: color .2s; }
.footer-links a:hover { color: var(--green-light); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 1.5rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.footer-bottom p { color: #64748b; font-size: .8rem; }
.footer-bottom .heart { color: var(--green-light); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; height: auto; display: flex; flex-wrap: wrap; padding: .5rem; overflow-x: auto; }
  .admin-nav-item { border-left: none; border-bottom: 3px solid transparent; flex-direction: column; padding: .5rem .75rem; font-size: .75rem; gap: .25rem; }
  .admin-nav-item.active, .admin-nav-item:hover { border-left: none; border-bottom-color: var(--green); }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
}
@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .hero-ctas { flex-direction: column; align-items: center; }
  #certificate-view { padding: 2rem 1rem; }
  .cert-title { font-size: 1.3rem; }
  .cert-name { font-size: 1.8rem; }
}

/* ── PRINT (Certificate) ── */
@media print {
  body * { visibility: hidden; }
  #certificate-view, #certificate-view * { visibility: visible; }
  #certificate-view { position: fixed; inset: 0; width: 100%; background: white !important; border: 3px solid #b8960c !important; }
  .no-print { display: none !important; }
}

/* ── ANIMATIONS ── */
.fade-in { animation: fadeIn .4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.slide-up { animation: slideUp .5s ease; }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }

/* ── TOOLTIP ── */
[data-tip] { position: relative; cursor: help; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 100%; left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: #e2e8f0;
  padding: .4rem .8rem;
  border-radius: var(--radius-sm);
  font-size: .75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  border: 1px solid rgba(255,255,255,0.1);
  z-index: 100;
}
[data-tip]:hover::after { opacity: 1; }
