/* Learning Quizzes: lesson cards, name bar, theory pages, leaderboard. */

.lesson-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 20px; }
.lesson-card { display: block; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px; text-decoration: none; color: inherit; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.lesson-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(49, 49, 49, .1); border-color: var(--brand); }
.lesson-icon { font-size: 28px; margin-bottom: 8px; }
.lesson-card h2 { font-size: 17px; margin: 0 0 6px; color: var(--ink); }
.lesson-card p { font-size: 13.5px; color: var(--muted); margin: 0 0 10px; min-height: 36px; }
.lesson-meta { font-size: 12.5px; color: var(--brand-dark); font-weight: 600; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 8px 10px; border-bottom: 1px solid #e4e9ef; text-align: left; }
th { background: #eef3fa; color: var(--brand-dark); }

.learn-name-bar { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.learn-name-bar label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.learn-name-bar input { padding: 10px; border: 1px solid #cfcfcf; border-radius: 8px; font-size: 15px; min-width: 240px; }
.learn-name-bar .field-err { flex-basis: 100%; }

.theory-card h2 { font-size: 18px; margin: 4px 0 10px; color: var(--ink); }
.theory-body { font-size: 14.5px; line-height: 1.6; color: var(--ink); }
.theory-body ul { margin: 6px 0; padding-left: 20px; }
.theory-body li { margin: 4px 0; }

/* Theory content rises in one block after another. */
.step.active .theory-body > * { animation: theoryRise .45s cubic-bezier(.2, .7, .3, 1) both; }
.step.active .theory-body > *:nth-child(2) { animation-delay: .08s; }
.step.active .theory-body > *:nth-child(3) { animation-delay: .16s; }
.step.active .theory-body > *:nth-child(4) { animation-delay: .24s; }
.step.active .theory-body > *:nth-child(5) { animation-delay: .32s; }
.step.active .theory-body > *:nth-child(n+6) { animation-delay: .4s; }
@keyframes theoryRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Lesson cards on the index page appear with a stagger. */
.lesson-grid .lesson-card { animation: lessonIn .45s ease both; }
.lesson-grid .lesson-card:nth-child(2) { animation-delay: .05s; }
.lesson-grid .lesson-card:nth-child(3) { animation-delay: .1s; }
.lesson-grid .lesson-card:nth-child(4) { animation-delay: .15s; }
.lesson-grid .lesson-card:nth-child(5) { animation-delay: .2s; }
.lesson-grid .lesson-card:nth-child(6) { animation-delay: .25s; }
.lesson-grid .lesson-card:nth-child(7) { animation-delay: .3s; }
.lesson-grid .lesson-card:nth-child(8) { animation-delay: .35s; }
.lesson-grid .lesson-card:nth-child(9) { animation-delay: .4s; }
.lesson-grid .lesson-card:nth-child(n+10) { animation-delay: .45s; }
@keyframes lessonIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---- theory illustrations: pure CSS + emoji, no external images ---- */

/* Fake e-mail mock-up for phishing / email lessons. */
.mail-mock { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 14px 0; background: #fff; box-shadow: 0 6px 18px rgba(49, 49, 49, 0.07); font-size: 13.5px; }
.mail-mock .mm-head { background: #f6f8fb; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.mail-mock .mm-row { margin: 3px 0; color: var(--muted); }
.mail-mock .mm-row b { color: var(--ink); font-weight: 600; }
.mail-mock .mm-body { padding: 12px 14px; line-height: 1.55; }
.mail-mock .mm-flag { background: var(--redt); border: 1px dashed var(--red); border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.mail-mock .mm-link { color: #1a6fd4; text-decoration: underline; word-break: break-all; }

/* Messenger chat mock-up for social-engineering lessons. */
.chat-mock { max-width: 440px; margin: 14px 0; }
.chat-mock .bubble { border-radius: 14px; padding: 10px 14px; margin: 6px 0; font-size: 13.5px; line-height: 1.5; }
.chat-mock .bubble.them { background: #eef1f5; border-top-left-radius: 4px; margin-right: 40px; }
.chat-mock .bubble.me { background: var(--tint); border-top-right-radius: 4px; margin-left: 40px; }
.chat-mock .who { font-size: 11.5px; color: var(--muted); margin-top: 10px; }

/* Two-column "do / don't" grid. */
.do-dont { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
.do-dont .do, .do-dont .dont { border-radius: 12px; padding: 12px 14px; font-size: 13.5px; }
.do-dont .do { background: var(--tint); border: 1px solid rgba(109, 172, 58, 0.4); }
.do-dont .dont { background: var(--redt); border: 1px solid rgba(241, 30, 30, 0.3); }
.do-dont h4 { margin: 0 0 8px; font-size: 13.5px; }
.do-dont .do h4 { color: var(--brand-dark); }
.do-dont .dont h4 { color: var(--red); }
.do-dont ul { margin: 0; padding-left: 18px; }
.do-dont li { margin: 4px 0; }

/* Callout tip box. */
.tipbox { display: flex; gap: 12px; align-items: flex-start; background: #eef6ff; border: 1px solid #c4dcf5; border-radius: 12px; padding: 12px 14px; margin: 14px 0; font-size: 13.5px; line-height: 1.55; }
.tipbox .ti { font-size: 22px; line-height: 1; }

/* Password strength meter rows. */
.meter { margin: 14px 0; }
.meter-row { display: flex; align-items: center; gap: 10px; margin: 7px 0; font-size: 13px; }
.meter-row code { flex: 0 0 210px; background: #f4f4f4; border-radius: 6px; padding: 3px 8px; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meter-bar { flex: 1; height: 10px; border-radius: 6px; background: #eee; overflow: hidden; }
.meter-bar i { display: block; height: 100%; border-radius: 6px; }
.meter-bar .weak { width: 15%; background: var(--red); }
.meter-bar .fair { width: 45%; background: var(--yellow); }
.meter-bar .strong { width: 100%; background: var(--brand); }
.meter-row .mlabel { flex: 0 0 90px; text-align: right; font-weight: 600; }
.meter-row .mlabel.weak { color: var(--red); }
.meter-row .mlabel.fair { color: var(--yellow); }
.meter-row .mlabel.strong { color: var(--brand-dark); }

/* Numbered mini-flow: what to do, in order. */
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0; }
.flow span { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 6px 12px; font-size: 13px; white-space: nowrap; }
.flow span b { color: var(--brand-dark); }
.flow .arr { border: none; background: none; color: var(--muted); padding: 0 2px; }

@media (max-width: 560px) {
  .do-dont { grid-template-columns: 1fr; }
  .meter-row code { flex-basis: 140px; }
}

@media (prefers-reduced-motion: reduce) {
  .step.active .theory-body > *, .lesson-grid .lesson-card { animation: none; }
}
