/* ============================================================
   Learn With Asif — design system
   Friendly, large, high-contrast, beginner-first.
   ============================================================ */

:root {
  --purple: #6C5CE7;
  --purple-d: #5848c2;
  --teal: #00b894;
  --teal-d: #009e80;
  --amber: #fdaa2c;
  --coral: #e17055;
  --blue: #0984e3;
  --ink: #2d2a45;
  --ink-soft: #5b577a;
  --muted: #8e8aa8;
  --line: #e9e6f5;
  --bg: #f6f4fc;
  --card: #ffffff;
  --good: #00b894;
  --bad: #e1556b;
  --lock: #b9b5cf;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(70, 50, 160, 0.08);
  --shadow-lg: 0 18px 50px rgba(70, 50, 160, 0.16);
  --font: "Segoe UI", "Trebuchet MS", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}
h1, h2, h3, h4 { line-height: 1.25; color: var(--ink); margin: 0 0 .4em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
a { color: var(--purple); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- Top bar ---------- */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto; padding: 10px 18px;
  display: flex; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; color: var(--ink); font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
.brand-mark { font-size: 1.5rem; }
.mainnav { display: flex; gap: 6px; margin-left: 8px; flex: 1; flex-wrap: wrap; }
.mainnav a {
  color: var(--ink-soft); font-weight: 600; padding: 8px 14px; border-radius: 999px;
}
.mainnav a:hover { background: var(--bg); text-decoration: none; }
.mainnav a.is-active { background: var(--purple); color: #fff; }
.mainnav a.nav-mentor { color: var(--coral); }
.mainnav a.nav-mentor.is-active { background: var(--coral); color: #fff; }
.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.levelchip {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px;
  background: var(--bg); border-radius: 999px; color: var(--ink); font-weight: 700; font-size: .85rem;
}
.levelchip:hover { text-decoration: none; box-shadow: var(--shadow); }
.levelchip-lvl { color: var(--purple); }
.levelchip-bar { width: 70px; height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.levelchip-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--purple), var(--teal)); }
.levelchip-xp { color: var(--ink-soft); }

/* ---------- Layout ---------- */
.page { max-width: 1080px; margin: 0 auto; padding: 28px 18px 60px; }
.page-narrow { max-width: 760px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---------- Cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.card-pad-lg { padding: 30px; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 30px 0 14px; }
.section-title .emoji { font-size: 1.6rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-weight: 700; font-size: 1rem; cursor: pointer;
  padding: 12px 22px; border-radius: 999px; border: 2px solid transparent;
  transition: transform .05s ease, box-shadow .15s ease, background .15s ease;
  text-decoration: none; line-height: 1.1;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--purple); color: #fff; }
.btn-primary:hover { background: var(--purple-d); box-shadow: var(--shadow); }
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { background: var(--teal-d); box-shadow: var(--shadow); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--purple); color: var(--purple); }
.btn-lg { padding: 16px 30px; font-size: 1.1rem; }
.btn-sm { padding: 8px 16px; font-size: .9rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; }
.field .hint { font-size: .88rem; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], textarea, select {
  width: 100%; font-family: inherit; font-size: 1rem; color: var(--ink);
  padding: 12px 14px; border: 2px solid var(--line); border-radius: var(--radius-sm); background: #fff;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--purple); }
textarea { min-height: 120px; resize: vertical; }
.input-file { font-size: .95rem; }

/* ---------- Flash / alerts ---------- */
.flash-wrap { max-width: 1080px; margin: 14px auto 0; padding: 0 18px; }
.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 10px; font-weight: 600; }
.flash-info { background: #eef2ff; color: #3b46b8; }
.flash-success { background: #e4faf3; color: #07845f; }
.flash-error { background: #fdeaed; color: #c0334a; }

/* ---------- Hero / auth ---------- */
.hero { text-align: center; padding: 40px 0 20px; }
.hero h1 { font-size: 2.6rem; }
.hero p.lead { font-size: 1.25rem; color: var(--ink-soft); max-width: 620px; margin: 0 auto 24px; }
.auth-card { max-width: 440px; margin: 30px auto; }

/* ---------- Dashboard ---------- */
.welcome { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 8px; }
.welcome h1 { margin: 0; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0 8px; }
@media (max-width: 680px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; text-align: center; }
.stat .num { font-size: 1.8rem; font-weight: 800; color: var(--purple); }
.stat .lbl { font-size: .85rem; color: var(--muted); font-weight: 600; }

.today-card { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.today-card .today-icon { font-size: 2.6rem; }
.today-card .today-body { flex: 1; min-width: 220px; }
.today-card .today-body .eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--teal); }

/* ---------- XP / progress bar ---------- */
.bigbar { height: 16px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bigbar span { display: block; height: 100%; background: linear-gradient(90deg, var(--purple), var(--teal)); }

/* ---------- Journey map ---------- */
.module-block { margin-bottom: 30px; }
.module-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.module-head .m-emoji { font-size: 1.8rem; }
.module-head .m-sub { color: var(--muted); font-size: .92rem; }
.lesson-list { display: grid; gap: 12px; }
.lesson-row {
  display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px 16px; box-shadow: var(--shadow);
}
.lesson-row .ls-day { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; font-weight: 800; background: var(--bg); color: var(--ink-soft); }
.lesson-row .ls-body { flex: 1; min-width: 0; }
.lesson-row .ls-title { font-weight: 700; }
.lesson-row .ls-meta { font-size: .85rem; color: var(--muted); }
.lesson-row .ls-state { font-size: 1.5rem; flex: none; }
.lesson-row.is-locked { opacity: .65; box-shadow: none; }
.lesson-row.is-completed .ls-day { background: var(--teal); color: #fff; }
.lesson-row.is-available .ls-day { background: var(--purple); color: #fff; }
.lesson-row a.stretched { color: inherit; }
.lesson-row a.stretched:hover { text-decoration: none; }

.badge-pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .75rem; font-weight: 700; }
.badge-completed { background: #e4faf3; color: var(--teal-d); }
.badge-available { background: #eef0ff; color: var(--purple-d); }
.badge-locked { background: #f1f0f6; color: var(--lock); }
.badge-submitted { background: #fff3e0; color: #c87b1a; }

/* ---------- Lesson page ---------- */
.lesson-header { margin-bottom: 18px; }
.lesson-header .crumb { font-size: .85rem; color: var(--muted); font-weight: 600; }
.lesson-steps { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 24px; }
.lesson-steps .step { padding: 7px 14px; border-radius: 99px; background: #fff; border: 1px solid var(--line); font-weight: 700; font-size: .85rem; color: var(--ink-soft); }
.lesson-steps .step .n { color: var(--purple); }

.learn-body { font-size: 1.05rem; }
.learn-body h3 { margin-top: 1.4em; }
.learn-body ul, .learn-body ol { padding-left: 1.3em; }
.learn-body li { margin-bottom: .4em; }
.learn-body img, .learn-body svg { border-radius: var(--radius-sm); }

.callout { border-radius: var(--radius-sm); padding: 14px 16px; margin: 16px 0; border-left: 5px solid; }
.callout-urdu { background: #f3f0ff; border-color: var(--purple); }
.callout-tip { background: #e4faf3; border-color: var(--teal); }
.callout-warn { background: #fff3e0; border-color: var(--amber); }
.callout .callout-label { font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; display: block; margin-bottom: 2px; }

.stuck {
  margin: 18px 0; border: 2px dashed var(--line); border-radius: var(--radius-sm); padding: 4px 18px; background: #fff;
}
.stuck summary { cursor: pointer; font-weight: 700; padding: 12px 0; color: var(--purple); }
.stuck .search-terms { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 14px; }
.stuck .search-terms a { background: var(--bg); padding: 6px 12px; border-radius: 99px; font-weight: 600; font-size: .9rem; }

/* ---------- Tasks (Do It) ---------- */
.task { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: none; }
.task .task-check { flex: none; padding-top: 2px; }
.task .task-check input { width: 22px; height: 22px; accent-color: var(--teal); }
.task .task-body { flex: 1; }
.task .kind-tag { display: inline-block; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; padding: 2px 8px; border-radius: 99px; margin-bottom: 4px; }
.kind-create { background: #eef0ff; color: var(--purple-d); }
.kind-research { background: #fff3e0; color: #c87b1a; }
.kind-guided { background: #e4faf3; color: var(--teal-d); }
.task .proof { margin-top: 8px; }
.task .proof-have { font-size: .85rem; color: var(--teal-d); font-weight: 700; }

/* ---------- Quiz ---------- */
.quiz-q { margin-bottom: 22px; }
.quiz-q .q-prompt { font-weight: 700; margin-bottom: 8px; }
.quiz-opt { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 2px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 8px; cursor: pointer; }
.quiz-opt:hover { border-color: var(--purple); }
.quiz-opt input { accent-color: var(--purple); width: 18px; height: 18px; }
.quiz-opt.correct { border-color: var(--good); background: #e4faf3; }
.quiz-opt.wrong { border-color: var(--bad); background: #fdeaed; }
.quiz-result { font-weight: 800; font-size: 1.1rem; }
.q-status { font-size: .78rem; font-weight: 800; padding: 2px 10px; border-radius: 99px; margin-left: 8px; white-space: nowrap; }
.q-status.good { background: #e4faf3; color: var(--teal-d); }
.q-status.bad { background: #fdeaed; color: var(--bad); }
.quiz-q { scroll-margin-top: 90px; }   /* keep clear of the sticky top bar when scrolled to */
.quiz-q.flash-target { animation: qflash 1.4s ease; border-radius: var(--radius-sm); }
@keyframes qflash { 0%, 60% { box-shadow: 0 0 0 3px rgba(225,85,107,.45); } 100% { box-shadow: 0 0 0 0 rgba(225,85,107,0); } }

/* ---------- Vocab / voice ---------- */
.vocab-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.vocab-item:last-child { border-bottom: none; }
.vocab-en { font-weight: 800; font-size: 1.15rem; }
.vocab-ur { color: var(--ink-soft); }
.vocab-mean { color: var(--muted); font-size: .9rem; }
.speak-btn, .mic-btn {
  flex: none; width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--line);
  background: #fff; cursor: pointer; font-size: 1.2rem; display: grid; place-items: center;
}
.speak-btn:hover { border-color: var(--purple); }
.mic-btn:hover { border-color: var(--teal); }
.mic-btn.is-listening { border-color: var(--teal); background: var(--teal); color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { transform: scale(1);} 50% { transform: scale(1.08);} }
.say-score { font-size: .85rem; font-weight: 700; }
.say-score.good { color: var(--good); }
.say-score.bad { color: var(--bad); }

/* ---------- Challenge ---------- */
.challenge { background: #fbfaff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 14px; }
.challenge .ch-prompt { font-weight: 700; margin-bottom: 8px; }
.ch-graded { font-weight: 700; color: var(--teal-d); }

/* ---------- Celebrate ---------- */
.celebrate { text-align: center; padding: 30px; }
.celebrate .big { font-size: 4rem; }
.xp-pop { display: inline-block; background: var(--amber); color: #fff; font-weight: 800; padding: 6px 16px; border-radius: 99px; font-size: 1.2rem; }

/* ---------- Badges ---------- */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; }
.badge-card { text-align: center; padding: 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fff; }
.badge-card .b-emoji { font-size: 2.4rem; }
.badge-card.locked { opacity: .4; filter: grayscale(1); }
.badge-card .b-name { font-weight: 700; font-size: .9rem; }

/* ---------- Tables (mentor) ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; background: #fff; }
table.data th, table.data td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); }
table.data th { font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
table.data tr:hover td { background: var(--bg); }

/* ---------- AI tutor (only shown when enabled) ---------- */
.ai-fab { position: fixed; right: 22px; bottom: 22px; z-index: 60; border-radius: 999px; box-shadow: var(--shadow-lg); }

/* ---------- Footer ---------- */
.sitefooter { border-top: 1px solid var(--line); background: #fff; }
.sitefooter-inner { max-width: 1080px; margin: 0 auto; padding: 20px 18px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--ink-soft); font-size: .9rem; }

/* ---------- Utilities ---------- */
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 10px; } .mt-2 { margin-top: 20px; } .mt-3 { margin-top: 30px; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 20px; }
.flex { display: flex; } .between { justify-content: space-between; } .items-center { align-items: center; }
.gap { gap: 12px; } .wrap { flex-wrap: wrap; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .78rem; font-weight: 700; background: var(--bg); color: var(--ink-soft); }
.text-teal { color: var(--teal-d); } .text-purple { color: var(--purple); }
