/* SadaLearn styles — teal & orange, matching the original Lovable design */

:root {
  color-scheme: light;
  --bg: oklch(0.985 0.008 180);
  --ink: oklch(0.24 0.035 200);
  --card: #fff;
  --teal: oklch(0.66 0.13 180);
  --teal-deep: oklch(0.42 0.09 195);
  --teal-soft: oklch(0.955 0.025 180);
  --orange: oklch(0.68 0.16 40);
  --orange-soft: oklch(0.95 0.04 45);
  --muted: oklch(0.96 0.012 190);
  --muted-ink: oklch(0.5 0.03 200);
  --line: oklch(0.91 0.018 190);
  --success: oklch(0.55 0.13 160);
  --danger: oklch(0.56 0.2 25);
  --radius: 14px;
  --gradient: linear-gradient(135deg, oklch(0.66 0.13 180), oklch(0.72 0.16 40));
  --surface: linear-gradient(160deg, oklch(0.97 0.03 180) 0%, oklch(0.985 0.008 180) 45%, oklch(0.97 0.035 45) 100%);
  --shadow: 0 1px 2px oklch(0.42 0.09 195 / 0.06), 0 12px 30px -18px oklch(0.42 0.09 195 / 0.35);
  --shadow-lift: 0 24px 50px -28px oklch(0.42 0.09 195 / 0.5);
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Sora", "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { background: var(--bg); }
body {
  min-height: 100vh;
  background: var(--bg) var(--surface) fixed;
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.02em; line-height: 1.2; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 6px; }

.muted { color: var(--muted-ink); }
.small { font-size: 13px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
}
.lift { transition: transform .25s ease, box-shadow .25s ease; }
.lift:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 10px; padding: 10px 18px; font-size: 14px; font-weight: 600;
  border: 1px solid var(--line); background: var(--card); cursor: pointer;
  transition: background-color .15s, opacity .15s;
}
.btn:hover { background: var(--teal-soft); }
.btn-primary { background: var(--gradient); border-color: transparent; color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--gradient); opacity: .9; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.link-back { font-size: 14px; color: var(--muted-ink); }
.link-back:hover { color: var(--ink); }

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600;
  background: var(--teal-soft); color: var(--teal-deep);
}
.tag-orange { background: var(--orange-soft); color: oklch(0.52 0.15 40); }

/* Brand */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 36px; height: 36px; object-fit: contain; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; background: var(--gradient);
  display: grid; place-items: center; color: #fff; font-family: var(--display); font-weight: 700; font-size: 17px;
}
.brand-name { display: block; font-weight: 700; font-size: 16px; line-height: 1.2; }
.brand-name span { color: var(--orange); }
.brand-sub { display: block; font-size: 12px; color: var(--muted-ink); }

/* Progress bar */
.bar { height: 8px; width: 100%; border-radius: 999px; background: var(--muted); overflow: hidden; }
.bar > div { height: 100%; border-radius: 999px; background: var(--gradient); transition: width .5s ease; }
.bar.done > div { background: var(--teal); }
.bar.warn > div { background: var(--orange); }
.bar-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted-ink); margin-bottom: 8px; }
.bar-meta strong { color: var(--ink); }

/* Login */
.login { display: grid; min-height: 100vh; }
.login-side { display: none; }
.login-main { display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; padding: 32px; }
.login-card h2 { font-size: 26px; margin-top: 24px; }
.field { display: block; margin-top: 16px; }
.field span { font-size: 14px; font-weight: 600; }
.field input {
  display: block; width: 100%; margin-top: 6px; padding: 11px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); outline: none;
}
.field input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px oklch(0.66 0.13 180 / .2); }
.form-error { margin-top: 14px; font-size: 13px; color: var(--danger); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 40px; }
.stat { padding: 12px 16px; }
.stat b { display: block; font-family: var(--display); font-size: 24px; }
@media (min-width: 960px) {
  .login { grid-template-columns: 1fr 1fr; }
  .login-side { display: flex; flex-direction: column; justify-content: space-between; padding: 48px; }
  .login-card .brand { display: none; }
  .login-card h2 { margin-top: 0; }
}
.login-side h1 { font-size: 38px; max-width: 460px; }

/* App shell */
.header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: oklch(1 0 0 / .82); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner, .main { max-width: 1120px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.header-inner { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.user { display: flex; align-items: center; gap: 12px; }
.user-name { font-size: 14px; color: var(--muted-ink); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--teal-soft); color: var(--teal-deep); font-weight: 700; font-size: 14px;
}
.btn-sm { padding: 6px 12px; font-size: 13px; font-weight: 500; color: var(--muted-ink); }
.main { padding-top: 40px; padding-bottom: 64px; }
@media (max-width: 600px) { .user-name { display: none; } .main { padding-top: 28px; } }

/* Dashboard */
.hero { display: grid; gap: 24px; padding: 28px; align-items: center; }
@media (min-width: 800px) { .hero { grid-template-columns: 1.4fr 1fr; } }
.hero h1 { font-size: 30px; }
.hero p { margin-top: 8px; max-width: 520px; }
.overall { background: var(--teal-soft); border-radius: 14px; padding: 20px; }
.overall-top { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 12px; }
.overall .bar { background: #fff; }
.overall-top b { font-family: var(--display); font-size: 26px; }
.section-title { font-size: 18px; margin: 40px 0 16px; }
.grid { display: grid; gap: 20px; }
@media (min-width: 760px) { .grid { grid-template-columns: 1fr 1fr; } }
.course-card { display: flex; flex-direction: column; padding: 24px; }
.course-card h3 { font-size: 20px; margin-top: 16px; }
.course-card p { flex: 1; margin: 6px 0 20px; font-size: 14px; }

/* Course page */
.course-head { margin-top: 16px; padding: 28px; }
.course-head h1 { font-size: 30px; margin-top: 16px; }
.course-head > p { margin-top: 8px; max-width: 640px; }
.course-head .progress { margin-top: 24px; max-width: 440px; }
.lessons { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.lesson-row { display: flex; align-items: center; gap: 16px; padding: 20px; }
.num {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; background: var(--teal-soft); color: var(--teal-deep);
}
.num.done { background: var(--teal); color: #fff; }
.lesson-row .info { flex: 1; min-width: 0; }
.lesson-row .info b { display: block; }
.lesson-row .info span { display: block; font-size: 14px; color: var(--muted-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lesson-row .meta { text-align: right; font-size: 12px; color: var(--muted-ink); flex-shrink: 0; }
.lesson-row .meta .score { color: var(--success); font-weight: 700; margin-top: 4px; }
@media (max-width: 600px) { .lesson-row .meta { display: none; } }

/* Lesson page */
.lesson-top { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 13px; }
.lesson-title { font-size: 30px; margin-top: 12px; }
.lesson-summary { margin-top: 8px; max-width: 640px; }
.ok { color: var(--success); font-weight: 700; }
.video { margin-top: 28px; overflow: hidden; }
.video-frame { aspect-ratio: 16 / 9; background: var(--teal-deep); }
.video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.video-empty {
  min-height: 200px; display: grid; place-items: center; text-align: center; padding: 24px;
  background: var(--teal-deep) linear-gradient(135deg, oklch(0.42 0.09 195), oklch(0.36 0.07 205)); color: #fff;
}
.video-empty .play {
  width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%;
  border: 2px solid oklch(1 0 0 / .5); display: grid; place-items: center;
}
.video-empty .play::after {
  content: ""; margin-left: 5px; border-style: solid; border-width: 11px 0 11px 18px;
  border-color: transparent transparent transparent oklch(1 0 0 / .8);
}
.video-empty p { opacity: .8; font-size: 14px; }
.article { margin-top: 24px; padding: 28px; display: grid; gap: 28px; }
.article h2 { font-size: 18px; }
.article ul { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.article li { display: flex; gap: 12px; font-size: 15px; color: oklch(0.38 0.03 200); max-width: 74ch; }
.article li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); flex-shrink: 0; margin-top: 9px; }
.actions { margin-top: 28px; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 12px; }

/* Quiz */
.quiz { margin-top: 28px; display: grid; gap: 16px; }
.quiz-status { padding: 20px; }
.question { padding: 24px; }
.question legend { font-weight: 600; padding: 0; }
.question fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.q-num { color: var(--muted-ink); margin-right: 6px; }
.options { display: grid; gap: 8px; margin-top: 16px; }
.option {
  display: flex; gap: 10px; align-items: flex-start; text-align: left; width: 100%;
  border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 12px 16px;
  font-size: 14px; cursor: pointer; transition: background-color .15s, border-color .15s;
}
.option:hover { background: var(--muted); }
.option[aria-pressed="true"] { border-color: var(--teal); background: var(--teal-soft); color: var(--teal-deep); font-weight: 600; }
.option .letter { color: var(--muted-ink); font-weight: 500; }

/* Results */
.result { padding: 36px 28px; text-align: center; }
.result .verdict { font-weight: 700; font-size: 14px; }
.result .verdict.pass { color: var(--success); }
.result .verdict.fail { color: oklch(0.55 0.16 40); }
.result .big { font-family: var(--display); font-size: 52px; font-weight: 700; margin-top: 8px; }
.result .bar { max-width: 380px; margin: 20px auto 0; }
.result .actions { justify-content: center; }
.review { padding: 8px; }
.review-item { padding: 18px 20px; font-size: 14px; }
.review-item + .review-item { border-top: 1px solid var(--line); }
.review-item .q { font-weight: 600; }
.review-item .right { color: var(--success); margin-top: 6px; }
.review-item .wrong { color: var(--danger); margin-top: 6px; }
.review-item .explain { color: var(--muted-ink); margin-top: 4px; }

.empty { padding: 40px 28px; text-align: center; }
.empty h1 { font-size: 24px; }
.empty .actions { justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
