@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&display=swap');

:root {
  color-scheme: light;
  --paper: #f5f3ed;
  --panel: #fffefa;
  --ink: #20261f;
  --muted: #85877c;
  --green: #3d5945;
  --green-dark: #2e4836;
  --lime: #d4e69b;
  --line: #e7e5dc;
  --good: #eaf3e7;
  --bad: #faeeea;
  font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--ink); background: var(--paper); }
button { font: inherit; }
.page-shell { width: min(1040px, calc(100% - 64px)); margin: 0 auto; }
.topbar { height: 90px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e5e2d8; }
.wordmark { display: inline-flex; gap: 11px; align-items: center; color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 700; }
.wordmark-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 11px; color: var(--lime); background: var(--green); font: 700 17px 'DM Sans', sans-serif; }
.wordmark-light { color: #85877c; font-weight: 500; }
.lesson-tag { display: flex; align-items: center; gap: 8px; color: #6e756c; font-size: 12px; }
.tag-dot { width: 7px; height: 7px; border-radius: 50%; background: #9bb76d; }
.quiz-layout { display: grid; grid-template-columns: 282px 1fr; margin: 42px 0 28px; border: 1px solid #e8e6de; border-radius: 20px; overflow: hidden; background: var(--panel); box-shadow: 0 18px 55px #3e453014; min-height: 510px; }
.lesson-rail { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; padding: 38px 32px; color: #f8f6ee; background: var(--green); }
.eyebrow { display: flex; width: 100%; justify-content: space-between; margin: 0 0 31px; color: #ced9c8; font-size: 11px; }
.eyebrow span { color: #a5b8a1; direction: ltr; }
.lesson-rail h2 { margin: 0; font-size: 30px; font-weight: 600; line-height: 1.45; }
.rail-copy { max-width: 190px; margin: 14px 0 0; color: #d5ded2; font-size: 13px; line-height: 1.9; }
.rail-rule { width: 39px; height: 2px; margin: 25px 0 18px; background: var(--lime); }
.rail-note { position: relative; z-index: 1; margin: 0; color: #cad7c8; font-size: 12px; line-height: 2; }
.rail-note strong { color: #f3f3e9; font: 600 13px 'DM Sans', sans-serif; direction: ltr; }
.note-mark { display: block; height: 20px; color: var(--lime); font: 700 34px Georgia, serif; }
.rail-decoration { position: absolute; left: -12px; bottom: -31px; color: #ffffff0c; font: 700 126px 'DM Sans', sans-serif; letter-spacing: -12px; }
.main-panel { display: flex; min-width: 0; align-items: center; padding: 49px 58px; }
.screen { width: 100%; }
.screen[hidden] { display: none; }
.start-kicker { display: flex; align-items: center; gap: 9px; margin: 0 0 19px; color: var(--green); font-size: 12px; font-weight: 600; }
.sparkle { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; color: var(--green); background: #eff3dd; font-size: 15px; }
h1 { margin: 0; font-size: clamp(31px, 4vw, 44px); line-height: 1.38; letter-spacing: -1.3px; font-weight: 600; }
.start-screen h1 span { color: var(--green); }
.intro-copy { max-width: 445px; margin: 15px 0 0; color: #777a70; font-size: 14px; line-height: 2; }
.topic-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 23px; }
.topic-pills span { padding: 7px 11px; border: 1px solid #e8e9df; border-radius: 7px; color: #647261; background: #fcfcf7; font: 500 11px 'DM Sans', sans-serif; direction: ltr; }
.primary-button { display: inline-flex; min-width: 181px; align-items: center; justify-content: center; gap: 20px; margin-top: 29px; padding: 14px 19px; border: 0; border-radius: 9px; color: #fff; background: var(--green); cursor: pointer; font-size: 14px; font-weight: 600; transition: background .18s ease, transform .18s ease; }
.primary-button:hover { background: var(--green-dark); transform: translateY(-1px); }
.primary-button:focus-visible, .next-button:focus-visible, .answer-option:focus-visible { outline: 3px solid #aecb76; outline-offset: 3px; }
.button-arrow { display: inline-grid; width: 25px; height: 25px; place-items: center; border-radius: 7px; color: var(--green); background: var(--lime); font-size: 17px; }
.tiny-note { margin: 11px 0 0; color: #a1a197; font-size: 10px; }
.quiz-meta { display: flex; justify-content: space-between; color: #74786f; font-size: 12px; }
#score-counter { color: var(--green); font-weight: 600; }
.progress-track { height: 5px; margin: 13px 0 30px; overflow: hidden; border-radius: 10px; background: #efeee7; direction: ltr; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: #94ad68; transition: width .28s ease; }
.question-category { margin: 0 0 10px; color: #869078; font-size: 11px; }
.question-text { margin: 0 0 20px; color: #222a24; font: 600 clamp(23px, 3vw, 30px)/1.5 'DM Sans', sans-serif; text-align: left; letter-spacing: -.5px; }
.answer-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; direction: ltr; }
.answer-option { min-height: 54px; padding: 11px 14px; border: 1px solid #e8e7df; border-radius: 9px; color: #424940; background: #fff; cursor: pointer; font: 500 14px 'DM Sans', sans-serif; text-align: left; transition: border .16s, background .16s, transform .16s; }
.answer-option:hover:not(:disabled) { border-color: #9cad87; background: #fbfcf5; transform: translateY(-1px); }
.answer-option:disabled { cursor: default; }
.answer-option.correct { border-color: #a9c39b; background: var(--good); color: #38553c; }
.answer-option.incorrect { border-color: #e0b5a8; background: var(--bad); color: #925743; }
.feedback { margin-top: 13px; padding: 10px 12px; border-radius: 8px; color: #596651; background: #f3f5ed; font-size: 12px; line-height: 1.7; }
.feedback.wrong { color: #8b5949; background: #fbf1ed; }
.quiz-footer { display: flex; justify-content: space-between; align-items: center; min-height: 53px; margin-top: 14px; color: #a0a196; font-size: 10px; }
.next-button { display: inline-flex; min-width: 112px; align-items: center; justify-content: center; gap: 16px; padding: 10px 13px; border: 1px solid #d8dfd1; border-radius: 8px; color: var(--green); background: #fbfcf7; cursor: pointer; font-size: 12px; font-weight: 600; }
.next-button:disabled { opacity: .38; cursor: not-allowed; }
.next-button span { font-size: 16px; }
.result-screen { text-align: center; }
.result-stamp { display: grid; width: 62px; height: 62px; margin: 0 auto 20px; place-items: center; border-radius: 22px; color: var(--green); background: #edf2df; font-size: 28px; }
.result-screen .start-kicker { justify-content: center; }
.result-screen h1 { font-size: 38px; }
.result-screen .intro-copy { margin: 9px auto 0; }
.result-score { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 25px auto 2px; color: #818479; font-size: 12px; }
.result-score strong { color: var(--green); font: 700 27px 'DM Sans', sans-serif; }
.result-screen .primary-button { margin-top: 23px; }
.page-footer { display: flex; justify-content: space-between; padding: 3px 3px 22px; color: #98998e; font-size: 10px; }
.page-footer span:last-child { direction: ltr; font-family: 'DM Sans', sans-serif; }

@media (max-width: 720px) {
  .page-shell { width: min(100% - 30px, 520px); }
  .topbar { height: 68px; }
  .lesson-tag { font-size: 10px; }
  .quiz-layout { display: flex; flex-direction: column; margin: 18px 0 17px; border-radius: 15px; min-height: 0; }
  .lesson-rail { min-height: 136px; padding: 17px 21px; }
  .eyebrow { margin: 0 0 7px; font-size: 10px; }
  .lesson-rail h2 { font-size: 22px; line-height: 1.35; }
  .rail-copy { max-width: 250px; margin: 6px 0 0; font-size: 11px; line-height: 1.55; }
  .rail-rule, .rail-note, .rail-decoration { display: none; }
  .main-panel { min-height: 405px; padding: 30px 23px; }
  h1 { font-size: 35px; }
  .intro-copy { font-size: 13px; }
  .topic-pills { gap: 6px; margin-top: 18px; }
  .topic-pills span { padding: 6px 8px; font-size: 10px; }
  .primary-button { width: 100%; margin-top: 23px; }
  .quiz-screen { align-self: flex-start; }
  .answer-list { grid-template-columns: 1fr; gap: 8px; }
  .answer-option { min-height: 48px; }
  .progress-track { margin-bottom: 23px; }
  .question-text { margin-bottom: 16px; font-size: 26px; }
  .quiz-footer { margin-top: 10px; }
  .page-footer { padding-bottom: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}


.notification-region {
  position: fixed;
  z-index: 30;
  inset-inline-start: 22px;
  bottom: 22px;
  width: min(410px, calc(100vw - 44px));
  pointer-events: none;
}

.site-toast {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid #d9dfd0;
  border-radius: 12px;
  color: #354b38;
  background: #fffefa;
  box-shadow: 0 12px 36px #26342126;
  pointer-events: auto;
  animation: toast-enter .2s ease-out both;
  transition: opacity .18s ease, transform .18s ease;
}

.site-toast[data-type="success"] { border-color: #bfd1b2; background: #f5f8ef; }
.site-toast[data-type="error"] { border-color: #e3c2b7; color: #7d493b; background: #fff7f3; }
.site-toast__icon { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; color: #fff; background: #6c8758; font: 700 14px 'DM Sans', sans-serif; }
.site-toast[data-type="error"] .site-toast__icon { background: #b96c56; }
.site-toast[data-type="info"] .site-toast__icon { color: var(--green); background: #e8eedb; }
.site-toast__message { font-size: 12px; font-weight: 500; line-height: 1.7; }
.site-toast__close { display: grid; width: 29px; height: 29px; place-items: center; padding: 0; border: 0; border-radius: 7px; color: #777a70; background: transparent; cursor: pointer; font-size: 21px; line-height: 1; }
.site-toast__close:hover { color: var(--ink); background: #eeeee7; }
.site-toast__close:focus-visible { outline: 2px solid #9bb76d; outline-offset: 2px; }
.site-toast.is-leaving { opacity: 0; transform: translateY(8px); }

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

@media (max-width: 720px) {
  .notification-region { inset-inline: 15px; bottom: 15px; width: auto; }
  .site-toast { padding: 11px 12px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .site-toast { animation: none; transition: none; }
}
