/* ── style.css ── */
:root {
  --forest: #0a2818;
  --forest-mid: #0f3b2c;
  --forest-light: #1a5c42;
  --sage: #4a8c6a;
  --mint: #7ecba1;
  --pale: #e8f5ee;
  --cream: #f7faf8;
  --white: #ffffff;
  --ink: #0d1f16;
  --muted: #4a6358;
  --border: #d0e6da;
  --warn: #f59e0b;
  --danger: #ef4444;
  --success: #10b981;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 2px 12px rgba(10, 40, 24, 0.08);
  --shadow-md: 0 4px 24px rgba(10, 40, 24, 0.12);
  --shadow-lg: 0 8px 40px rgba(10, 40, 24, 0.16);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

::selection {
  background: var(--mint);
  color: var(--forest);
}

::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: var(--pale);
}

::-webkit-scrollbar-thumb {
  background: var(--sage);
  border-radius: 3px;
}

/* ── HEADER ── */
.header {
  background: var(--forest);
  color: var(--white);
  padding: 0;
  position: relative;
  overflow: hidden;
}

.header-bg {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 50%, rgba(126, 203, 161, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(74, 140, 106, 0.12) 0%, transparent 40%);
  pointer-events: none;
}

.header-dots {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(126, 203, 161, 0.15) 1px, transparent 1px);
  background-size: 28px 28px;
}

.header-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 3.5rem 2rem 3rem;
  position: relative;
  z-index: 1;
  text-align: center;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(126, 203, 161, 0.12);
  border: 1px solid rgba(126, 203, 161, 0.25);
  color: var(--mint);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.35rem 1rem;
  border-radius: 2rem;
  margin-bottom: 1.5rem;
}

.badge-dot {
  width: 6px;
  height: 6px;
  background: var(--mint);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

.header h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 8vw, 4.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -1px;
  color: var(--white);
  margin-bottom: 0.75rem;
}

.header h1 em {
  font-style: italic;
  color: var(--mint);
}

.header-sub {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.65);
  max-width: 480px;
  margin: 0 auto 1.5rem;
  line-height: 1.7;
}

.header-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-item {
  text-align: center;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--mint);
  display: block;
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.2rem;
  display: block;
}

.stat-label i {
  margin-right: 4px;
}

.install-btn {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
  border-radius: var(--radius);
  cursor: pointer;
  margin-top: 1rem;
  font-family: var(--font-body);
  transition: all 0.2s;
}

.install-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.btn-skip {
  background: rgba(126, 203, 161, 0.15);
  border: 1px solid rgba(126, 203, 161, 0.3);
  color: var(--mint);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.6rem 1.5rem;
  border-radius: 2rem;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.2s;
}

.btn-skip:hover {
  background: rgba(126, 203, 161, 0.25);
}

/* ── PROGRESS BAR ── */
.progress-wrap {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 2rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.progress-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--pale);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--forest-light), var(--mint));
  border-radius: 3px;
  transition: width 0.5s ease;
  width: 0%;
}

.progress-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

/* ── CONTENT ── */
.content {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ── SECTION CARDS ── */
.section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}

.section:hover {
  box-shadow: var(--shadow-md);
}

.section-header {
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.15s;
  user-select: none;
}

.section-header:hover {
  background: var(--pale);
}

.section-header-left {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.section-num {
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: var(--forest);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-display);
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--forest);
}

.toggle-icon {
  width: 28px;
  height: 28px;
  background: var(--pale);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--forest);
  transition: transform 0.3s, background 0.15s;
  flex-shrink: 0;
}

.section-header.open .toggle-icon {
  transform: rotate(180deg);
  background: var(--pale);
}

.section-content {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  display: none;
  animation: slideDown 0.25s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ── INTRO TEXT ── */
.section-intro {
  font-size: 0.95rem;
  color: var(--muted);
  background: var(--pale);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  border-left: 3px solid var(--sage);
}

/* ── TERM BOXES ── */
.term-box {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  position: relative;
}

.term-box strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--forest);
  font-weight: 600;
  font-size: 0.95rem;
}

.term-box strong i {
  margin-right: 6px;
  color: var(--sage);
  width: 1.2rem;
}

.term-box p,
.term-box>*:not(strong) {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.7;
}

/* ── QUIZ ── */
.quiz-block {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-top: 1.25rem;
  box-shadow: var(--shadow);
}

.quiz-q {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  margin-bottom: 1rem;
  line-height: 1.5;
  display: flex;
  gap: 0.5rem;
}

.quiz-q-num {
  background: var(--forest);
  color: var(--white);
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  margin-top: 1px;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.option-btn {
  background: var(--cream);
  border: 1.5px solid var(--border);
  color: var(--ink);
  padding: 0.7rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.875rem;
  text-align: left;
  transition: all 0.15s;
  line-height: 1.4;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--sage);
  background: var(--pale);
  color: var(--forest);
}

.option-btn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.option-btn.correct-ans {
  background: #d1fae5;
  border-color: var(--success);
  color: #065f46;
}

.option-btn.wrong-ans {
  background: #fee2e2;
  border-color: var(--danger);
  color: #991b1b;
}

.feedback {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  display: none;
  line-height: 1.5;
}

.feedback.correct {
  background: #d1fae5;
  border-left: 3px solid var(--success);
  color: #065f46;
  display: block;
}

.feedback.incorrect {
  background: #fee2e2;
  border-left: 3px solid var(--danger);
  color: #991b1b;
  display: block;
}

/* ── MASTERY TEST ── */
.test-section .section-header {
  background: var(--forest);
}

.test-section .section-header:hover {
  background: var(--forest-light);
}

.test-section .section-num {
  background: var(--mint);
  color: var(--forest);
}

.test-section .section-title {
  color: var(--white);
}

.test-section .toggle-icon {
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
}

.test-setup {
  background: var(--pale);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
}

.test-setup p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  line-height: 1.7;
}

.test-setup p i {
  color: var(--sage);
  margin-right: 6px;
}

.name-field {
  width: 100%;
  max-width: 360px;
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--white);
  outline: none;
  margin-bottom: 1rem;
  transition: border-color 0.15s;
}

.name-field:focus {
  border-color: var(--sage);
}

.btn-forest {
  background: var(--forest);
  color: var(--white);
  border: none;
  padding: 0.8rem 2rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 2rem;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-forest:hover {
  background: var(--forest-light);
  transform: translateY(-1px);
}

.test-progress {
  background: var(--pale);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ── CERTIFICATE ── */
.cert-wrap {
  background: var(--pale);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
}

.cert-announce {
  background: var(--forest);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.cert-announce h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.cert-announce p {
  font-size: 0.88rem;
  opacity: 0.75;
}

#certificateCard {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: 1rem 0;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.cert-institute {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--sage);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.cert-shield {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.cert-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--forest);
  margin-bottom: 0.25rem;
}

.cert-subtitle {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.cert-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 1rem 0;
}

.cert-awarded {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.cert-name {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  font-style: italic;
  color: var(--forest);
  margin-bottom: 0.5rem;
}

.cert-desc {
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 340px;
  margin: 0 auto 1.25rem;
  line-height: 1.6;
}

.cert-meta {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.cert-meta-item {
  background: var(--pale);
  border-radius: var(--radius);
  padding: 0.6rem 1.25rem;
  text-align: center;
}

.cert-meta-item .val {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--forest);
  display: block;
}

.cert-meta-item .key {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.cert-id {
  font-family: monospace;
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--cream);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  display: inline-block;
  margin-top: 0.5rem;
}

.btn-download {
  background: var(--forest);
  color: var(--white);
  border: none;
  padding: 0.8rem 2rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 2rem;
  cursor: pointer;
  margin-top: 0.75rem;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-download:hover {
  background: var(--forest-light);
  transform: translateY(-1px);
}

.notice {
  background: #fffbeb;
  border-left: 3px solid var(--warn);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.82rem;
  color: #92400e;
  margin-bottom: 1rem;
  text-align: left;
}

/* ── GLOSSARY ── */
.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.75rem;
}

.glossary-item {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}

.glossary-item strong {
  display: block;
  color: var(--forest);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.glossary-item strong i {
  margin-right: 6px;
  color: var(--sage);
  width: 1.2rem;
}

.glossary-item p {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ── DOWNLOAD ── */
.download-block {
  background: var(--forest);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  margin-top: 2rem;
  position: relative;
  overflow: hidden;
}

.download-block::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(126, 203, 161, 0.1) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

.download-block h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  position: relative;
}

.download-block h3 i {
  margin-right: 8px;
}

.download-block p {
  font-size: 0.88rem;
  opacity: 0.7;
  margin-bottom: 1.25rem;
  position: relative;
}

.btn-download-white {
  background: var(--white);
  color: var(--forest);
  border: none;
  padding: 0.8rem 2rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 2rem;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-download-white:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* ── FOOTER ── */
.footer {
  background: var(--forest);
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8rem;
}

.footer strong {
  color: rgba(255, 255, 255, 0.9);
}

/* ── MOBILE ── */
@media (max-width: 600px) {
  .header-inner {
    padding: 2.5rem 1.25rem 2rem;
  }
  .header h1 {
    font-size: 2.5rem;
  }
  .content {
    padding: 1.25rem 1rem 3rem;
  }
  .section-title {
    font-size: 0.95rem;
  }
  .cert-name {
    font-size: 1.5rem;
  }
  .glossary-grid {
    grid-template-columns: 1fr;
  }
  .header-stats {
    gap: 1.25rem;
  }
}

/* ── REVIEW WRONG ANSWERS ── */
.review-block {
  margin-top: 1.5rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.review-header {
  background: #fff8f0;
  border-bottom: 1px solid #fde8cc;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.review-header h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: #92400e;
}

.review-item {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.review-item:last-child {
  border-bottom: none;
}

.review-q {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.6rem;
  display: flex;
  gap: 0.5rem;
}

.review-q-num {
  background: #f59e0b;
  color: var(--white);
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  margin-top: 1px;
  flex-shrink: 0;
}

.review-your {
  font-size: 0.82rem;
  color: var(--danger);
  background: #fee2e2;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.review-correct {
  font-size: 0.82rem;
  color: #065f46;
  background: #d1fae5;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.verify-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--sage);
  text-decoration: none;
  margin-top: 0.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: color 0.15s;
}

.verify-link:hover {
  color: var(--forest);
}
