/* ============================================
   درسِ نظامی — Prototype Stylesheet
   Aesthetic: classical scholarly, warm parchment,
   restrained ornament, generous typography
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Nastaliq+Urdu:wght@400;500;600;700&family=Amiri:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  /* Warm parchment palette */
  --bg: #f5efe1;
  --bg-elev: #faf5e8;
  --bg-card: #fffbf0;
  --ink: #2a2218;
  --ink-soft: #5a4a36;
  --ink-faded: #8a7a62;
  --rule: #d9cdb0;
  --rule-soft: #e8dfc8;

  /* Accents — used sparingly, with intent */
  --accent: #6b4226;          /* deep walnut, primary action */
  --accent-deep: #4a2d18;
  --accent-soft: #c89464;     /* warm tan, hover */
  --gold: #a07c2c;            /* manuscript gold, ornament only */

  /* Status colours — muted, not loud */
  --status-good: #5b7a3a;     /* olive green */
  --status-good-bg: #e6ecd7;
  --status-warn: #a86b1d;     /* amber */
  --status-warn-bg: #f3e3c4;
  --status-neutral: #8a7a62;
  --status-neutral-bg: #ede5d0;
  --status-pending: #7a6235;
  --status-pending-bg: #efe6cc;

  /* Type scale */
  --font-urdu: 'Noto Nastaliq Urdu', serif;
  --font-arabic: 'Amiri', serif;

  /* Spacing */
  --gutter: 1.25rem;
  --rhythm: 1.6;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  direction: rtl;
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at top, rgba(255, 251, 240, 0.5), transparent 60%),
    radial-gradient(ellipse at bottom, rgba(217, 205, 176, 0.2), transparent 50%);
  color: var(--ink);
  font-family: var(--font-urdu);
  line-height: 2;
  min-height: 100vh;
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ============================================
   Layout primitives
   ============================================ */

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem var(--gutter) 4rem;
}

.page--narrow {
  max-width: 820px;
}

.divider {
  border: none;
  height: 1px;
  background: linear-gradient(to left, transparent, var(--rule), transparent);
  margin: 2.5rem 0;
}

.divider--ornament {
  height: 24px;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 2.5rem 0;
}
.divider--ornament::before,
.divider--ornament::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to var(--dir, left), transparent, var(--rule));
}
.divider--ornament span {
  padding: 0 1.25rem;
  color: var(--gold);
  font-size: 1.2rem;
  letter-spacing: 0.5em;
}

/* ============================================
   Header / nav
   ============================================ */

.site-header {
  background: var(--bg-elev);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
  background-color: rgba(250, 245, 232, 0.92);
}

.site-header__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.85rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink);
}

.brand__mark {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-arabic);
  font-size: 1.3rem;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(106, 66, 38, 0.25);
}

.brand__title {
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.3;
}

.brand__subtitle {
  font-size: 0.85rem;
  color: var(--ink-faded);
  line-height: 1.3;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nav__link {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.nav__link:hover {
  background: var(--rule-soft);
  color: var(--ink);
}

.nav__link--active {
  background: var(--accent);
  color: var(--bg-elev);
}

.nav__link--active:hover {
  background: var(--accent-deep);
  color: var(--bg-elev);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.85rem 0.35rem 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 0.95rem;
}

.user-chip__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
}

/* ============================================
   Page heads
   ============================================ */

.page-head {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule-soft);
}

.page-head__eyebrow {
  font-size: 0.95rem;
  color: var(--gold);
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.page-head__title {
  font-size: 2.2rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.page-head__subtitle {
  font-size: 1.1rem;
  color: var(--ink-soft);
  line-height: 1.8;
  max-width: 60ch;
}

/* ============================================
   Cards
   ============================================ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 2px rgba(74, 45, 24, 0.04);
  transition: all 0.25s ease;
}

.card--hover:hover {
  box-shadow: 0 4px 12px rgba(74, 45, 24, 0.1);
  border-color: var(--accent-soft);
  transform: translateY(-1px);
}

.card__title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card__meta {
  font-size: 0.9rem;
  color: var(--ink-faded);
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border: 1px solid transparent;
  border-radius: 6px;
  font-family: var(--font-urdu);
  font-size: 1rem;
  line-height: 1.5;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  background: none;
}

.btn--primary {
  background: var(--accent);
  color: var(--bg-elev);
}

.btn--primary:hover {
  background: var(--accent-deep);
}

.btn--secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
}

.btn--secondary:hover {
  background: var(--rule-soft);
  border-color: var(--accent-soft);
}

.btn--ghost {
  background: transparent;
  color: var(--accent);
  padding: 0.5rem 0.75rem;
}

.btn--ghost:hover {
  background: var(--rule-soft);
}

.btn--block {
  width: 100%;
}

.btn--small {
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
}

/* ============================================
   Status badges (sequence flag, review status)
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.6;
}

.badge__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.badge--good {
  background: var(--status-good-bg);
  color: var(--status-good);
}

.badge--warn {
  background: var(--status-warn-bg);
  color: var(--status-warn);
}

.badge--neutral {
  background: var(--status-neutral-bg);
  color: var(--status-neutral);
}

.badge--pending {
  background: var(--status-pending-bg);
  color: var(--status-pending);
}

.badge--reviewed {
  background: var(--status-good-bg);
  color: var(--status-good);
}

/* ============================================
   Login page
   ============================================ */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem var(--gutter);
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 3rem 2.5rem;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: 0 8px 30px rgba(74, 45, 24, 0.08);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(to left, var(--accent), var(--gold), var(--accent));
}

.login-card__brand {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg-elev);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-arabic);
  font-size: 2rem;
  margin: 0 auto 1.5rem;
  box-shadow: 0 4px 12px rgba(106, 66, 38, 0.25);
}

.login-card__title {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.login-card__subtitle {
  color: var(--ink-soft);
  margin-bottom: 2rem;
  line-height: 1.8;
}

.input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-family: var(--font-urdu);
  font-size: 1rem;
  color: var(--ink);
  text-align: right;
  direction: ltr; /* email is LTR */
  transition: border-color 0.2s ease;
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(106, 66, 38, 0.1);
}

.input--urdu {
  direction: rtl;
  text-align: right;
}

.field {
  margin-bottom: 1.25rem;
  text-align: right;
}

.field__label {
  display: block;
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}

/* ============================================
   Dashboard / progress
   ============================================ */

.grid {
  display: grid;
  gap: 1.25rem;
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 800px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

.stat {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
}

.stat__label {
  font-size: 0.95rem;
  color: var(--ink-faded);
  margin-bottom: 0.4rem;
  line-height: 1.5;
}

.stat__value {
  font-size: 2.2rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--accent-deep);
}

.stat__sub {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-top: 0.3rem;
  line-height: 1.5;
}

.progress {
  background: var(--rule-soft);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  margin-top: 0.75rem;
}

.progress__fill {
  height: 100%;
  background: linear-gradient(to left, var(--accent), var(--accent-soft));
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* ============================================
   Course / week / chapter list
   ============================================ */

.week-section {
  margin-bottom: 2.5rem;
}

.week-section__head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule-soft);
}

.week-section__number {
  font-family: var(--font-arabic);
  font-size: 1.4rem;
  color: var(--gold);
  font-weight: 700;
}

.week-section__title {
  font-size: 1.3rem;
  font-weight: 600;
}

.week-section__meta {
  margin-right: auto;
  font-size: 0.9rem;
  color: var(--ink-faded);
}

.chapter-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chapter-row {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: var(--ink);
  transition: all 0.2s ease;
}

.chapter-row:hover {
  border-color: var(--accent-soft);
  background: var(--bg-elev);
}

.chapter-row__index {
  font-family: var(--font-arabic);
  font-size: 1.1rem;
  color: var(--ink-faded);
  min-width: 2.5rem;
  text-align: center;
  flex-shrink: 0;
}

.chapter-row__main {
  flex: 1;
  min-width: 0;
}

.chapter-row__title {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 0.2rem;
  line-height: 1.6;
}

.chapter-row__meta {
  font-size: 0.85rem;
  color: var(--ink-faded);
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.chapter-row__check {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
}

.chapter-row__check--done {
  background: var(--status-good);
  border-color: var(--status-good);
  color: var(--bg-elev);
}

/* ============================================
   Chapter page (the heart of the system)
   ============================================ */

.chapter-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .chapter-layout { grid-template-columns: 1fr; }
}

.chapter-aside {
  position: sticky;
  top: 5rem;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1.25rem;
}

.chapter-aside__title {
  font-size: 0.95rem;
  color: var(--ink-faded);
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}

.toc {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.toc a {
  display: block;
  padding: 0.4rem 0.6rem;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.95rem;
  border-radius: 4px;
  border-right: 2px solid transparent;
  line-height: 1.6;
}

.toc a:hover {
  background: var(--rule-soft);
  color: var(--ink);
}

.toc a.active {
  border-right-color: var(--accent);
  background: var(--rule-soft);
  color: var(--accent-deep);
  font-weight: 500;
}

.section-block {
  margin-bottom: 2.5rem;
}

.section-block__head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule-soft);
}

.section-block__icon {
  font-family: var(--font-arabic);
  color: var(--gold);
  font-size: 1.4rem;
}

.section-block__title {
  font-size: 1.4rem;
  font-weight: 600;
}

/* PDF viewer mock */
.pdf-mock {
  background:
    repeating-linear-gradient(
      to bottom,
      var(--bg-card) 0,
      var(--bg-card) 32px,
      transparent 32px,
      transparent 33px
    ),
    var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 2rem 2.5rem;
  min-height: 380px;
  position: relative;
  font-family: var(--font-arabic);
  font-size: 1.4rem;
  line-height: 2.2;
  color: var(--ink);
}

.pdf-mock::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  right: 1.5rem;
  width: 1px;
  background: var(--rule);
}

.pdf-mock__page-num {
  position: absolute;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-urdu);
  font-size: 0.85rem;
  color: var(--ink-faded);
}

.pdf-toolbar {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  padding: 0.5rem 0.75rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--ink-faded);
}

.pdf-toolbar + .pdf-mock {
  border-radius: 0 0 6px 6px;
}

/* Audio player */
.audio-player {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.audio-player__btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg-elev);
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}

.audio-player__btn:hover { background: var(--accent-deep); }

.audio-player__main {
  flex: 1;
}

.audio-player__title {
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
  color: var(--ink-soft);
}

.audio-track {
  background: var(--rule-soft);
  border-radius: 999px;
  height: 4px;
  overflow: hidden;
  position: relative;
}

.audio-track__fill {
  height: 100%;
  width: 32%;
  background: var(--accent);
}

.audio-time {
  font-size: 0.8rem;
  color: var(--ink-faded);
  font-family: var(--font-arabic);
  flex-shrink: 0;
}

/* Teacher notes — formatted prose */
.notes {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1.5rem 1.75rem;
  position: relative;
}

.notes::before {
  content: '';
  position: absolute;
  top: 1rem;
  bottom: 1rem;
  right: 0.4rem;
  width: 3px;
  background: var(--gold);
  border-radius: 2px;
}

.notes p {
  margin-bottom: 1rem;
  line-height: 2.1;
}

.notes p:last-child { margin-bottom: 0; }

.notes .arabic-inline {
  font-family: var(--font-arabic);
  font-size: 1.15em;
  color: var(--accent-deep);
}

/* Glossary inline */
.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}

.gloss-item {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.gloss-item:hover {
  border-color: var(--accent-soft);
  background: var(--bg-elev);
}

.gloss-item__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.3rem;
}

.gloss-item__term {
  font-family: var(--font-arabic);
  font-size: 1.3rem;
  color: var(--accent-deep);
  font-weight: 700;
}

.gloss-item__category {
  font-size: 0.75rem;
  color: var(--ink-faded);
  background: var(--rule-soft);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.gloss-item__meaning {
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.7;
}

.gloss-item__details {
  display: none;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--rule);
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.8;
}

.gloss-item.expanded .gloss-item__details { display: block; }

.gloss-item__example {
  font-family: var(--font-arabic);
  font-size: 1.1rem;
  color: var(--ink);
  margin-top: 0.4rem;
}

/* Self-check questions */
.quiz {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1.5rem;
}

.quiz__question {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 1rem;
  line-height: 1.8;
}

.quiz__options {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quiz__option {
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.quiz__option:hover {
  border-color: var(--accent-soft);
  background: var(--bg-card);
}

.quiz__option.selected {
  border-color: var(--accent);
  background: var(--rule-soft);
}

.quiz__option.correct {
  border-color: var(--status-good);
  background: var(--status-good-bg);
}

.quiz__option.incorrect {
  border-color: var(--status-warn);
  background: var(--status-warn-bg);
}

.quiz__radio {
  width: 18px;
  height: 18px;
  border: 2px solid var(--rule);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}

.quiz__option.selected .quiz__radio::after {
  content: '';
  position: absolute;
  inset: 3px;
  background: var(--accent);
  border-radius: 50%;
}

.quiz__feedback {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 6px;
  font-size: 0.95rem;
  line-height: 1.8;
  display: none;
}

.quiz__feedback.show { display: block; }

.quiz__feedback--correct {
  background: var(--status-good-bg);
  color: var(--status-good);
}

.quiz__feedback--incorrect {
  background: var(--status-warn-bg);
  color: var(--status-warn);
}

/* Submission area */
.submit-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.submit-tab {
  padding: 0.65rem 1.25rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: var(--font-urdu);
  font-size: 1rem;
  color: var(--ink-faded);
  margin-bottom: -1px;
  transition: all 0.2s;
}

.submit-tab:hover { color: var(--ink); }

.submit-tab.active {
  border-bottom-color: var(--accent);
  color: var(--accent-deep);
  font-weight: 500;
}

.submit-panel { display: none; }
.submit-panel.active { display: block; }

.upload-zone {
  border: 2px dashed var(--rule);
  border-radius: 8px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: var(--bg-elev);
  cursor: pointer;
  transition: all 0.2s ease;
}

.upload-zone:hover {
  border-color: var(--accent);
  background: var(--bg-card);
}

.upload-zone__icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  color: var(--ink-faded);
}

.upload-zone__text {
  font-size: 1rem;
  color: var(--ink-soft);
  margin-bottom: 0.4rem;
}

.upload-zone__hint {
  font-size: 0.85rem;
  color: var(--ink-faded);
}

.recorder {
  text-align: center;
  padding: 2rem 1rem;
}

.recorder__mic {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg-elev);
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(106, 66, 38, 0.25);
}

.recorder__mic:hover {
  background: var(--accent-deep);
  transform: scale(1.05);
}

.recorder__hint {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.textarea {
  width: 100%;
  min-height: 100px;
  padding: 0.85rem 1rem;
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-family: var(--font-urdu);
  font-size: 1rem;
  line-height: 1.9;
  color: var(--ink);
  resize: vertical;
}

.textarea:focus {
  outline: none;
  border-color: var(--accent);
}

/* ============================================
   Submission history / past attempts
   ============================================ */

.attempt-card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.attempt-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule-soft);
  flex-wrap: wrap;
}

.attempt-card__title {
  font-size: 1.05rem;
  font-weight: 500;
}

.attempt-card__date {
  font-size: 0.85rem;
  color: var(--ink-faded);
}

.attempt-card__feedback {
  background: var(--bg-elev);
  border-right: 3px solid var(--gold);
  padding: 0.85rem 1rem;
  margin-top: 0.75rem;
  border-radius: 4px;
  font-size: 0.95rem;
  line-height: 1.8;
}

.attempt-card__feedback-label {
  font-size: 0.85rem;
  color: var(--gold);
  margin-bottom: 0.4rem;
  font-weight: 500;
}

/* ============================================
   Teacher review queue
   ============================================ */

.review-row {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1.1rem 1.4rem;
  margin-bottom: 0.75rem;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 1.25rem;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  transition: all 0.2s ease;
}

@media (max-width: 700px) {
  .review-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
}

.review-row:hover {
  border-color: var(--accent-soft);
  background: var(--bg-elev);
}

.review-row__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
}

.review-row__info {
  min-width: 0;
}

.review-row__learner {
  font-size: 1.05rem;
  font-weight: 500;
  margin-bottom: 0.15rem;
}

.review-row__chapter {
  font-size: 0.9rem;
  color: var(--ink-faded);
}

.review-row__type {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.review-row__since {
  font-size: 0.85rem;
  color: var(--ink-faded);
  white-space: nowrap;
}

/* ============================================
   Modal (sequence warning)
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(42, 34, 24, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
  backdrop-filter: blur(2px);
}

.modal-overlay.show {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 2rem 2rem 1.5rem;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(74, 45, 24, 0.25);
  border-top: 4px solid var(--status-warn);
  animation: slideUp 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal__icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--status-warn-bg);
  color: var(--status-warn);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.modal__title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.modal__body {
  color: var(--ink-soft);
  line-height: 1.9;
  margin-bottom: 1.5rem;
}

.modal__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-start;
}

/* ============================================
   Toast notifications
   ============================================ */

.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg-elev);
  padding: 0.85rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 200;
  display: none;
  font-size: 0.95rem;
}

.toast.show {
  display: block;
  animation: slideUp 0.25s ease;
}

/* ============================================
   Footer
   ============================================ */

.footer {
  text-align: center;
  padding: 2rem var(--gutter);
  color: var(--ink-faded);
  font-size: 0.85rem;
  border-top: 1px solid var(--rule-soft);
  margin-top: 4rem;
}

.footer__arabic {
  font-family: var(--font-arabic);
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

/* ============================================
   Utility
   ============================================ */

.text-center { text-align: center; }
.text-end { text-align: end; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

.notice {
  background: var(--status-warn-bg);
  border-right: 3px solid var(--status-warn);
  color: var(--status-warn);
  padding: 0.85rem 1rem;
  border-radius: 6px;
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.notice--info {
  background: var(--status-pending-bg);
  border-right-color: var(--gold);
  color: var(--ink-soft);
}

.prototype-banner {
  background: var(--ink);
  color: var(--bg-elev);
  text-align: center;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.prototype-banner strong {
  color: var(--accent-soft);
}

/* Bismillah ornament */
.bismillah {
  text-align: center;
  font-family: var(--font-arabic);
  font-size: 1.6rem;
  color: var(--gold);
  margin: 2rem 0;
  line-height: 2;
}
