﻿:root {
  --green: #58cc02; --green-d: #46a302;
  --blue: #1cb0f6; --blue-d: #1899d6; --blue-l: #ddf4ff;
  --orange: #ff9600; --purple: #ce82ff;
  --red: #ff4b4b; --ink: #3c3c3c; --muted: #7a7a7a;
  --bg: #f7f9fc; --line: #e5e5e5;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Nunito", system-ui, Segoe UI, Roboto, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.5; }
h1, h2, h3 { line-height: 1.2; }
h1 { font-weight: 900; margin: .6rem 0; }
h2 { font-weight: 800; font-size: 1.3rem; }
main { max-width: 1040px; margin: 1.5rem auto; padding: 0 1rem 4rem; }

/* Top bar */
.topbar { display: flex; align-items: center; gap: 1rem; padding: .7rem 1.2rem; background: #fff; border-bottom: 2px solid var(--line); position: sticky; top: 0; z-index: 10; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: .5rem; font-weight: 900; font-size: 1.2rem; color: var(--green-d); text-decoration: none; }
.logo-mark { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--green); color: #fff; font-weight: 900; }
#nav { flex: 1; display: flex; gap: 1rem; }
#nav a { color: var(--ink); font-weight: 800; text-decoration: none; }
#nav a:hover { color: var(--blue-d); }
#stats { display: flex; gap: .4rem; }
#userbox { display: flex; align-items: center; gap: .5rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; }
.avatar.initial { display: inline-grid; place-items: center; background: var(--blue); color: #fff; font-weight: 900; }
.chip { padding: .2rem .65rem; border-radius: 999px; font-weight: 800; font-size: .9rem; }
.chip.xp { background: #fff4d6; color: #b67800; }
.chip.streak { background: #ffe9d6; color: #c25e00; }

/* Cards */
.card-lg { background: #fff; border: 2px solid var(--line); border-radius: 20px; padding: 1.25rem 1.4rem; margin: 1rem 0; }
.link { display: block; color: inherit; text-decoration: none; transition: transform .1s, border-color .1s; }
.link:hover { border-color: var(--blue); transform: translateY(-2px); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; }
.hero { display: flex; justify-content: space-between; align-items: center; gap: 1rem; background: linear-gradient(135deg, #e9ffd1, #ddf4ff); border-color: transparent; }
.course-card h3 { margin: .6rem 0 .2rem; }
.course-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--green); color: #fff; font-size: 1.6rem; font-weight: 900; }
.search { width: 100%; padding: .85rem 1rem; border: 2px solid var(--line); border-radius: 16px; font: inherit; margin-top: .5rem; }
.module { display: flex; justify-content: space-between; align-items: center; margin: .6rem 0; }
.module.locked, .module.soon { opacity: .6; }
.module.done { border-color: var(--green); }
.upsell { display: flex; justify-content: space-between; align-items: center; gap: 1rem; background: #fff4d6; border-color: #ffd46b; }
.upsell p { margin: 0; font-weight: 800; }
.row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.split { display: grid; grid-template-columns: 1fr 300px; gap: 1rem; align-items: start; }
.tutor { position: sticky; top: 90px; }
.locked { opacity: .75; }
.tiers .tier { display: flex; flex-direction: column; gap: .4rem; }
.tier.current { border-color: var(--green); }
.price { font-size: 1.8rem; font-weight: 900; margin: 0; color: var(--blue-d); }

/* Mascot and logo placeholders */
.mascot-ph { width: 120px; height: 120px; border: 2px dashed #b9c4d0; border-radius: 24px; display: grid; place-items: center; color: #9aa6b2; font-weight: 800; font-size: .8rem; background: #fff; }

/* Buttons */
button { font: inherit; cursor: pointer; }
.btn-primary { display: inline-block; background: var(--green); color: #fff; border: 0; border-bottom: 4px solid var(--green-d); border-radius: 16px; padding: .7rem 1.3rem; font-weight: 900; text-decoration: none; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:active { transform: translateY(2px); border-bottom-width: 2px; }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.btn-ghost { background: #fff; color: var(--ink); border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 14px; padding: .5rem 1rem; font-weight: 800; }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue-d); }
.small { font-size: .85rem; }
.actions { display: flex; justify-content: space-between; align-items: center; margin-top: 1.5rem; }

/* Auth */
.auth { max-width: 440px; margin: 2rem auto; text-align: center; }
.auth .mascot-ph { margin: 0 auto 1rem; }
.tabs { display: flex; gap: .5rem; margin: 1rem 0; }
.tab { flex: 1; padding: .6rem; border-radius: 14px; border: 2px solid var(--line); background: #fff; font-weight: 800; }
.tab.on { border-color: var(--blue); color: var(--blue-d); background: var(--blue-l); }
.gbtn { display: flex; justify-content: center; min-height: 44px; }
.or { display: flex; align-items: center; gap: .6rem; color: var(--muted); margin: 1rem 0; font-weight: 800; }
.or::before, .or::after { content: ""; flex: 1; height: 2px; background: var(--line); }
.stack { display: flex; flex-direction: column; gap: .75rem; }
input, textarea { font: inherit; padding: .75rem .9rem; border: 2px solid var(--line); border-radius: 14px; width: 100%; }
input:focus, textarea:focus { outline: none; border-color: var(--blue); }
.row-form { display: flex; gap: .75rem; align-items: center; }
.row-form input { flex: 1; }

/* Wizard */
.wizard { max-width: 760px; margin: 1rem auto; }
.bar { height: 14px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar > div { height: 100%; background: var(--green); border-radius: 999px; transition: width .3s; }
.pick { display: flex; flex-direction: column; align-items: flex-start; gap: .25rem; text-align: left; background: #fff; color: var(--ink); border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 16px; padding: .9rem 1rem; font-weight: 800; }
.pick:hover { border-color: var(--blue); }
.pick.on { border-color: var(--blue); background: var(--blue-l); color: var(--blue-d); }
.flag { font-size: 1.4rem; }

/* Quizzes and feedback */
.quiz fieldset { border: 2px solid var(--line); border-radius: 16px; margin: .8rem 0; padding: .7rem 1rem; }
.quiz legend { font-weight: 800; padding: 0 .3rem; }
.choice { display: block; padding: .35rem .2rem; cursor: pointer; }
.result { margin-top: .8rem; }
.score { padding: .8rem 1rem; border-radius: 14px; font-weight: 700; }
.score.pass { background: #e9ffd1; color: var(--green-d); }
.score.fail { background: #ffe5e5; color: #c62828; }
.explain { padding-left: 1.2rem; }
.ok, .pass { color: var(--green-d); }
.bad, .fail { color: var(--red); }
.badge { font-size: .8rem; font-weight: 800; padding: .2rem .65rem; border-radius: 999px; background: var(--line); }
.badge.ok { background: #e9ffd1; color: var(--green-d); }
.error { color: var(--red); font-weight: 800; }

/* Tutor chat */
.chat { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: .5rem; margin: .6rem 0; }
.bubble { padding: .6rem .8rem; border-radius: 16px; max-width: 92%; white-space: pre-wrap; }
.bubble.you { align-self: flex-end; background: var(--blue); color: #fff; }
.bubble.ai { align-self: flex-start; background: #f0f0f0; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); background: var(--ink); color: #fff; padding: .8rem 1.2rem; border-radius: 14px; font-weight: 800; z-index: 50; box-shadow: 0 6px 20px rgba(0,0,0,.2); }

@media (max-width: 800px) {
  .split { grid-template-columns: 1fr; }
  .tutor { position: static; }
  #nav { order: 3; width: 100%; }
}
