/* ==========================================================================
   English Easy — main stylesheet
   Palette: warm cream + deep teal + amber
   Layout uses logical properties so RTL and LTR share the same rules.
   ========================================================================== */

@font-face {
  font-family: "Cairo";
  src: url("../fonts/Cairo-Variable.ttf") format("truetype");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0d2b26;
  --ink-2: #1b443c;
  --muted: #647a74;
  --muted-2: #8a9a95;
  --brand: #0f8a70;
  --brand-600: #0b7660;
  --brand-700: #095c4c;
  --brand-soft: #e6f5f0;
  --brand-softer: #f1faf7;
  --accent: #f0b429;
  --accent-strong: #d99a12;
  --accent-soft: #fdf2d6;
  --cream: #faf7f0;
  --surface: #ffffff;
  --surface-2: #f5f1e7;
  --line: #e9e3d5;
  --line-strong: #d9d2c1;
  --danger: #bf4238;
  --danger-soft: #fbecea;
  --success: #12805f;
  --success-soft: #e5f6ef;
  --navy: #14384c;
  --radius-lg: 26px;
  --radius: 20px;
  --radius-sm: 14px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(13, 43, 38, 0.05), 0 8px 24px -18px rgba(13, 43, 38, 0.35);
  --shadow: 0 24px 60px -34px rgba(13, 43, 38, 0.45), 0 4px 12px -8px rgba(13, 43, 38, 0.15);
  --shadow-lg: 0 40px 90px -40px rgba(13, 43, 38, 0.5);
  --font: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
  --header-h: 76px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background-color: var(--cream);
  background-image:
    radial-gradient(circle at 12% 4%, rgba(15, 138, 112, 0.06), transparent 32%),
    radial-gradient(circle at 88% 0%, rgba(240, 180, 41, 0.08), transparent 30%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

main {
  flex: 1 0 auto;
}

h1, h2, h3, h4, h5 {
  margin: 0 0 0.6em;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--ink);
}

h1 { font-size: clamp(2rem, 4.4vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.45rem); }

p { margin: 0 0 1rem; }
a { color: var(--brand-600); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--brand-700); }
img { max-width: 100%; height: auto; display: block; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; }

[dir="ltr"] .en,
.en {
  font-family: var(--font);
  letter-spacing: -0.01em;
}

:focus-visible {
  outline: 3px solid rgba(15, 138, 112, 0.35);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection {
  background: rgba(240, 180, 41, 0.35);
}

.shell {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 28px);
}

.shell-narrow { max-width: 860px; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed;
  inset-block-start: -60px;
  inset-inline-start: 16px;
  z-index: 2000;
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: 0 0 12px 12px;
  transition: inset-block-start 0.2s ease;
}
.skip-link:focus { inset-block-start: 0; color: #fff; }

.muted { color: var(--muted); }
.tiny { font-size: 0.78rem; }
.small { font-size: 0.88rem; }
.strong { font-weight: 700; }
.text-brand { color: var(--brand-600); }
.text-accent { color: var(--accent-strong); }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 2.5rem !important; }
.w-100 { width: 100%; }
.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.4rem; }
.gap-2 { gap: 0.75rem; }
.gap-3 { gap: 1.25rem; }

.ic { flex: 0 0 auto; vertical-align: -0.18em; }

/* ------------------------------------------------------------------ buttons */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink);
  --btn-border: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 10px 22px;
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
  cursor: pointer;
  text-align: center;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); color: var(--btn-fg); }
.btn:active { transform: translateY(0) scale(0.99); }

.btn-brand {
  --btn-bg: linear-gradient(135deg, #14a184 0%, #0b7660 100%);
  --btn-fg: #fff;
  --btn-border: transparent;
  box-shadow: 0 14px 30px -14px rgba(11, 118, 96, 0.75);
}
.btn-brand:hover { box-shadow: 0 18px 34px -14px rgba(11, 118, 96, 0.85); color: #fff; }

.btn-accent {
  --btn-bg: linear-gradient(135deg, #f7c94e, #efa91b);
  --btn-fg: #3c2c00;
  --btn-border: transparent;
  box-shadow: 0 14px 30px -16px rgba(239, 169, 27, 0.9);
}

.btn-outline { --btn-bg: transparent; --btn-fg: var(--ink); }
.btn-outline:hover { background: var(--surface); }

.btn-soft {
  --btn-bg: var(--brand-soft);
  --btn-fg: var(--brand-700);
  --btn-border: transparent;
}
.btn-soft:hover { background: #d9efe8; }

.btn-ghost {
  --btn-bg: transparent;
  --btn-fg: var(--muted);
  --btn-border: transparent;
  min-height: 40px;
  padding: 8px 14px;
}
.btn-ghost:hover { background: rgba(13, 43, 38, 0.05); color: var(--ink); }

.btn-danger { --btn-bg: var(--danger-soft); --btn-fg: var(--danger); --btn-border: transparent; }

.btn-lg { min-height: 54px; padding: 14px 30px; font-size: 1.02rem; }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: 0.84rem; gap: 6px; }
.btn-icon { width: 46px; height: 46px; padding: 0; border-radius: 50%; }
.btn-icon.btn-sm { width: 36px; height: 36px; }

.btn:disabled, .btn.is-disabled { opacity: 0.55; pointer-events: none; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.icon-btn:hover { border-color: var(--brand); color: var(--brand-600); transform: translateY(-1px); }
.icon-btn.is-on { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.icon-btn.is-on .ic { fill: currentColor; }
.icon-btn.is-playing { background: var(--brand); border-color: var(--brand); color: #fff; }
.icon-btn.is-playing .ic { fill: currentColor; }

/* ------------------------------------------------------------------ badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.5;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-brand { background: var(--brand-soft); color: var(--brand-700); }
.badge-accent { background: var(--accent-soft); color: #8a5b00; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-navy { background: #e7eef3; color: var(--navy); }
.badge-ghost { background: rgba(255, 255, 255, 0.16); color: #fff; }
.badge-outline { background: transparent; border-color: var(--line-strong); color: var(--muted); }
.badge .ic { width: 14px; height: 14px; }

.level-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  margin-inline-end: 2px;
}

/* ------------------------------------------------------------------ header */
.announcement {
  background: linear-gradient(90deg, var(--brand-700), var(--brand));
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
}
.announcement .shell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-block: 8px;
  text-align: center;
}
.announcement a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(250, 247, 240, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background: rgba(250, 247, 240, 0.95);
  box-shadow: 0 12px 30px -26px rgba(13, 43, 38, 0.5);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  flex: 0 0 auto;
}
.brand:hover { color: var(--ink); }
.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: linear-gradient(145deg, #12a184, #0a5f4e);
  color: #fff;
  box-shadow: 0 10px 22px -12px rgba(10, 95, 78, 0.9);
  overflow: hidden;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset-block-start: -12px;
  inset-inline-end: -12px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(240, 180, 41, 0.55);
}
.brand-mark .ic { position: relative; z-index: 1; width: 24px; height: 24px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1.02rem; font-weight: 800; letter-spacing: -0.02em; }
.brand-text small { font-size: 0.68rem; color: var(--muted); font-weight: 600; }

.nav-main {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-inline-start: 18px;
}
.nav-main a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 0.92rem;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.nav-main a:hover { background: rgba(15, 138, 112, 0.08); color: var(--brand-700); }
.nav-main a.is-active { background: var(--brand-soft); color: var(--brand-700); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-inline-start: auto;
}
.header-actions .icon-btn { border-color: transparent; background: transparent; width: 40px; height: 40px; }
.header-actions .icon-btn:hover { background: rgba(15, 138, 112, 0.08); }

.lang-switch { display: inline-flex; }
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-2);
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.lang-btn:hover { background: var(--surface); border-color: var(--brand); color: var(--brand-700); }
.lang-btn span { font-size: 0.82rem; letter-spacing: 0.02em; }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  cursor: pointer;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.88rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
[dir="rtl"] .user-chip { padding: 4px 4px 4px 12px; }
.user-chip:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(145deg, #f2c14e, #eaa214);
  color: #442f00;
  font-weight: 800;
  font-size: 0.78rem;
  object-fit: cover;
  overflow: hidden;
  flex: 0 0 auto;
}
.avatar-lg { width: 76px; height: 76px; font-size: 1.5rem; }
.avatar-sm { width: 28px; height: 28px; font-size: 0.7rem; }

.user-menu-wrap { position: relative; }
.user-menu {
  position: absolute;
  inset-block-start: calc(100% + 10px);
  inset-inline-end: 0;
  min-width: 240px;
  padding: 8px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: none;
  z-index: 50;
}
.user-menu.is-open { display: block; animation: dropIn 0.18s var(--ease); }
.user-menu-head {
  padding: 10px 12px 12px;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 6px;
}
.user-menu-head strong { display: block; font-size: 0.92rem; }
.user-menu-head span { font-size: 0.76rem; color: var(--muted); }
.user-menu a,
.user-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--ink-2);
  font-size: 0.88rem;
  font-weight: 600;
  text-align: start;
  cursor: pointer;
}
.user-menu a:hover,
.user-menu button:hover { background: var(--brand-softer); color: var(--brand-700); }
.user-menu .danger { color: var(--danger); }
.user-menu .danger:hover { background: var(--danger-soft); color: var(--danger); }
.user-menu hr { margin: 6px 0; border: 0; border-top: 1px solid var(--line); }

.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  cursor: pointer;
}

.mobile-nav {
  display: none;
  position: fixed;
  inset: var(--header-h) 0 0;
  z-index: 890;
  background: var(--cream);
  padding: 22px clamp(16px, 5vw, 28px) 40px;
  overflow-y: auto;
  animation: slideDown 0.25s var(--ease);
}
body.nav-open .mobile-nav { display: block; }
body.nav-open { overflow: hidden; }
.mobile-nav a.m-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 14px;
  color: var(--ink);
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}
.mobile-nav a.m-link:hover,
.mobile-nav a.m-link.is-active { background: var(--brand-soft); border-color: transparent; color: var(--brand-700); }
.mobile-nav .m-actions { display: grid; gap: 10px; margin-top: 22px; }
.mobile-nav .m-lang { display: flex; gap: 8px; margin-top: 14px; }
.mobile-nav .m-lang form { flex: 1; }
.mobile-nav .m-lang .lang-btn { width: 100%; justify-content: center; background: var(--surface); }

/* -------------------------------------------------------------------- hero */
.hero {
  position: relative;
  padding: clamp(36px, 6vw, 72px) 0 clamp(28px, 4vw, 44px);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset-block-start: -180px;
  inset-inline-end: -160px;
  width: 520px; height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 138, 112, 0.13), transparent 65%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  inset-block-end: -220px;
  inset-inline-start: -140px;
  width: 460px; height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 180, 41, 0.16), transparent 65%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.03fr 0.97fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
}
.hero-copy { max-width: 620px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--brand-700);
  font-weight: 700;
  font-size: 0.8rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.eyebrow .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(240, 180, 41, 0.2);
}

.hero-title {
  font-size: clamp(2.15rem, 5.3vw, 4rem);
  font-weight: 900;
  line-height: 1.22;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}
.hero-title .hl {
  position: relative;
  white-space: nowrap;
  color: var(--brand-700);
  background: linear-gradient(180deg, transparent 64%, rgba(240, 180, 41, 0.42) 64%);
  padding-inline: 2px;
}
.hero-title .hl-line { display: block; }
.hero-sub {
  font-size: clamp(1rem, 1.5vw, 1.1rem);
  color: var(--muted);
  line-height: 1.9;
  max-width: 54ch;
  margin-bottom: 26px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}
.hero-trust span { display: inline-flex; align-items: center; gap: 6px; }
.hero-trust .ic { color: var(--brand); }

.hero-visual {
  position: relative;
  min-height: 460px;
  display: grid;
  place-items: center;
  isolation: isolate;
}
.hero-visual::before {
  content: "";
  position: absolute;
  width: min(430px, 90%);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.9), transparent 48%),
    linear-gradient(145deg, rgba(15, 138, 112, 0.16), rgba(240, 180, 41, 0.2));
  filter: blur(2px);
  z-index: -1;
}
.hero-visual::after {
  content: "";
  position: absolute;
  inset: 12% 14%;
  border-radius: 50%;
  border: 1px dashed rgba(15, 138, 112, 0.25);
  z-index: -1;
  animation: spin 40s linear infinite;
}

.sentence-preview {
  position: relative;
  width: min(410px, 100%);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 28px;
  padding: 24px 24px 30px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(8px);
  animation: floatY 7s ease-in-out infinite;
}
.sp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.sp-ar { font-size: 1.22rem; font-weight: 800; margin-bottom: 10px; padding-inline-end: 56px; }
.sp-en {
  font-size: clamp(1.35rem, 2.2vw, 1.65rem);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: 14px;
  padding-inline-end: 56px;
}
.sp-pron {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: #7a5200;
  font-size: 0.85rem;
  font-weight: 700;
}
.sp-play {
  position: absolute;
  inset-block-end: 22px;
  inset-inline-end: 22px;
  width: 54px; height: 54px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(145deg, #14a184, #0a6b57);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 14px 26px -12px rgba(10, 107, 87, 0.85);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.sp-play:hover { transform: scale(1.06); }
.sp-play .ic { width: 22px; height: 22px; fill: currentColor; }
.sp-hint { font-size: 0.72rem; color: var(--muted-2); margin-top: 14px; display: inline-flex; gap: 5px; align-items: center; }

.floating-card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-2);
  z-index: 2;
}
.floating-card .fc-icon {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--brand-700);
}
.floating-card small { display: block; font-size: 0.68rem; color: var(--muted); font-weight: 600; }
.float-quiz { inset-block-start: 6%; inset-inline-start: -4%; animation: floatY 6s ease-in-out infinite reverse; }
.float-score { inset-block-end: 8%; inset-inline-start: 0; animation: floatY 8s ease-in-out infinite; }
.float-audio { inset-block-start: 12%; inset-inline-end: -2%; animation: floatY 9s ease-in-out infinite 1s; }
.float-streak { inset-block-end: 14%; inset-inline-end: 2%; animation: floatY 7.5s ease-in-out infinite 0.5s; }

.mini-ring {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: conic-gradient(var(--brand) 72%, var(--surface-2) 0);
  display: grid; place-items: center;
}
.mini-ring::before {
  content: "72%";
  display: grid; place-items: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #fff;
  font-size: 0.55rem;
  font-weight: 800;
  color: var(--brand-700);
}

/* ------------------------------------------------------------------- stats */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-top: clamp(20px, 3vw, 34px);
  overflow: hidden;
}
.stat-cell {
  padding: 22px 20px;
  text-align: center;
  border-inline-start: 1px solid var(--line);
}
.stat-cell:first-child { border-inline-start: 0; }
.stat-num {
  display: block;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 900;
  color: var(--brand-700);
  line-height: 1.2;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stat-num .plus { color: var(--accent-strong); }
.stat-label { font-size: 0.82rem; color: var(--muted); font-weight: 600; }

.home-cats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
.home-cats .tiny { margin-inline-end: 2px; }

/* ----------------------------------------------------------------- sections */
.section { padding: clamp(46px, 7vw, 82px) 0; }
.section-tight { padding: clamp(30px, 4vw, 50px) 0; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: clamp(24px, 3vw, 38px);
}
.section-head .sh-copy { max-width: 640px; }
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-600);
  margin-bottom: 8px;
}
.section-title { font-size: clamp(1.55rem, 3vw, 2.25rem); margin-bottom: 8px; }
.section-sub { color: var(--muted); margin: 0; font-size: 0.98rem; max-width: 60ch; }
.section-link { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 0.9rem; white-space: nowrap; }

/* ------------------------------------------------------------------ tracks */
.track-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.track-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: clamp(24px, 3vw, 34px);
  border-radius: var(--radius-lg);
  color: #fff;
  overflow: hidden;
  min-height: 260px;
  box-shadow: var(--shadow);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.track-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); color: #fff; }
.track-card.track-spoken { background: linear-gradient(145deg, #12a184 0%, #0a6b57 55%, #084d40 100%); }
.track-card.track-business { background: linear-gradient(145deg, #1d4f67 0%, #14384c 55%, #0b2434 100%); }
.track-card::before {
  content: "";
  position: absolute;
  inset-block-start: -70px;
  inset-inline-end: -50px;
  width: 240px; height: 240px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 34px rgba(255, 255, 255, 0.05), 0 0 0 70px rgba(255, 255, 255, 0.03);
}
.track-card::after {
  content: "";
  position: absolute;
  inset-block-end: -60px;
  inset-inline-start: -40px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}
.track-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 58px; height: 58px;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  margin-bottom: 8px;
}
.track-icon .ic { width: 28px; height: 28px; }
.track-title { position: relative; z-index: 1; font-size: 1.45rem; margin: 0; color: #fff; }
.track-title small { display: block; font-size: 0.8rem; font-weight: 600; opacity: 0.75; letter-spacing: 0.04em; margin-top: 2px; }
.track-desc { position: relative; z-index: 1; margin: 0; font-size: 0.92rem; color: rgba(255, 255, 255, 0.85); max-width: 42ch; }
.track-foot { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 18px; }
.track-count { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 700; color: rgba(255, 255, 255, 0.92); }
.track-go {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #fff;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.track-card:hover .track-go { background: var(--accent); color: #3c2c00; transform: translateX(-3px); }
[dir="ltr"] .track-card:hover .track-go { transform: translateX(3px); }

/* ------------------------------------------------------------------- steps */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  counter-reset: step;
}
.step-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}
.step-card:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.step-num {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand-700);
  font-weight: 900;
  font-size: 1.1rem;
  margin-bottom: 14px;
  font-variant-numeric: tabular-nums;
}
.step-card h3 { font-size: 1.02rem; margin-bottom: 6px; }
.step-card p { margin: 0; color: var(--muted); font-size: 0.87rem; line-height: 1.7; }
.step-icon {
  position: absolute;
  inset-block-start: 22px;
  inset-inline-end: 20px;
  color: var(--brand);
  opacity: 0.35;
}

/* -------------------------------------------------------------- lesson cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.lesson-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease), border-color 0.28s var(--ease);
  height: 100%;
}
.lesson-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
  color: var(--ink);
}
.lc-cover {
  position: relative;
  height: 138px;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  overflow: hidden;
  background: linear-gradient(140deg, #e9f6f1, #d3ebe3);
}
.lc-cover.tone-business { background: linear-gradient(140deg, #e7eef3, #cfdde7); }
.lc-cover::before {
  content: "";
  position: absolute;
  inset-block-start: -40px;
  inset-inline-end: -30px;
  width: 150px; height: 150px;
  border-radius: 50%;
  border: 1px solid rgba(13, 43, 38, 0.1);
  box-shadow: 0 0 0 22px rgba(255, 255, 255, 0.18), 0 0 0 44px rgba(255, 255, 255, 0.1);
}
.lc-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.9; }
.lc-cover .lc-icon {
  position: relative;
  z-index: 1;
  display: grid; place-items: center;
  width: 52px; height: 52px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--brand-700);
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 20px -16px rgba(13, 43, 38, 0.6);
}
.lc-cover.tone-business .lc-icon { color: var(--navy); }
.lc-cover .lc-icon .ic { width: 26px; height: 26px; }
.lc-badges {
  position: absolute;
  inset-block-start: 12px;
  inset-inline-end: 12px;
  z-index: 2;
  display: flex;
  gap: 6px;
}
.lc-body { display: flex; flex-direction: column; flex: 1; padding: 18px 20px 20px; }
.lc-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 5px;
}
.lc-title { font-size: 1.14rem; margin: 0 0 2px; }
.lc-title-alt { font-size: 0.86rem; color: var(--muted); margin: 0 0 10px; direction: ltr; text-align: start; }
[dir="rtl"] .lc-title-alt { text-align: start; }
.lc-summary {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lc-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: auto;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
}
.lc-meta span { display: inline-flex; align-items: center; gap: 5px; }
.lc-meta .ic { color: var(--brand); }
.lc-progress { margin-top: 12px; }
.lc-progress .bar { height: 6px; }
.lc-progress-label { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--muted); margin-bottom: 5px; font-weight: 600; }

.bar {
  position: relative;
  height: 8px;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #14a184, #0a6b57);
  transition: width 0.5s var(--ease);
}
.bar.accent > span { background: linear-gradient(90deg, #f7c94e, #e6a210); }
.bar.light { background: rgba(255, 255, 255, 0.2); }
.bar.light > span { background: rgba(255, 255, 255, 0.9); }

/* -------------------------------------------------------------- levels band */
.levels-band {
  position: relative;
  background: linear-gradient(160deg, #f1faf7, #fdf8ea);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 42px);
  overflow: hidden;
}
.levels-band::before {
  content: "";
  position: absolute;
  inset-block-start: -80px;
  inset-inline-end: -60px;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 180, 41, 0.22), transparent 68%);
}
.levels-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; position: relative; z-index: 1; }
.level-card {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.level-card .level-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.level-medal {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-700);
}
.level-card h3 { margin: 0; font-size: 1rem; }
.level-card p { margin: 0; font-size: 0.84rem; color: var(--muted); line-height: 1.7; }

/* ---------------------------------------------------------------- cta panel */
.cta-panel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: linear-gradient(140deg, #0c4a3e 0%, #0a3b32 50%, #082c26 100%);
  color: #fff;
  padding: clamp(34px, 6vw, 68px);
  text-align: center;
  box-shadow: var(--shadow);
}
.cta-panel::before,
.cta-panel::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
}
.cta-panel::before {
  width: 420px; height: 420px;
  inset-block-start: -190px;
  inset-inline-start: -110px;
  box-shadow: 0 0 0 50px rgba(255, 255, 255, 0.03), 0 0 0 100px rgba(255, 255, 255, 0.02);
}
.cta-panel::after {
  width: 300px; height: 300px;
  inset-block-end: -170px;
  inset-inline-end: -80px;
  background: radial-gradient(circle, rgba(240, 180, 41, 0.24), transparent 70%);
  border: 0;
}
.cta-panel h2 { color: #fff; font-size: clamp(1.6rem, 3.4vw, 2.5rem); position: relative; z-index: 1; }
.cta-panel p { color: rgba(255, 255, 255, 0.78); max-width: 56ch; margin: 0 auto 26px; position: relative; z-index: 1; }
.cta-panel .hero-actions { justify-content: center; position: relative; z-index: 1; margin-bottom: 14px; }
.cta-note { position: relative; z-index: 1; font-size: 0.76rem; color: rgba(255, 255, 255, 0.55); margin: 0; }

/* --------------------------------------------------------------- page header */
.page-head {
  padding: clamp(30px, 5vw, 56px) 0 clamp(18px, 3vw, 30px);
}
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 14px;
}
.breadcrumb a { color: var(--muted); font-weight: 600; }
.breadcrumb a:hover { color: var(--brand-700); }
.breadcrumb .sep { opacity: 0.5; }
.page-title { font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: 8px; }
.page-sub { color: var(--muted); max-width: 62ch; margin: 0; }
.page-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* ----------------------------------------------------------------- filters */
.filter-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 26px;
}
.filter-form { display: grid; grid-template-columns: 1.4fr 0.8fr 0.8fr auto; gap: 10px; align-items: end; }
.filter-field label { display: block; font-size: 0.72rem; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.filter-field .form-control,
.filter-field .form-select { min-height: 44px; }
.filter-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  transition: all 0.2s var(--ease);
}
.filter-tab:hover { border-color: var(--brand); color: var(--brand-700); }
.filter-tab.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.filter-tab .count { font-size: 0.7rem; opacity: 0.7; }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--brand-soft);
  color: var(--brand-700);
  font-size: 0.76rem;
  font-weight: 700;
}
[dir="rtl"] .chip { padding: 5px 12px 5px 10px; }
.chip a { color: inherit; display: grid; place-items: center; opacity: 0.65; }
.chip a:hover { opacity: 1; }

/* ------------------------------------------------------------ lesson detail */
.lesson-hero {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 26px;
  align-items: start;
  margin-bottom: 32px;
}
.lesson-intro {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 3.4vw, 34px);
  box-shadow: var(--shadow-sm);
}
.lesson-intro .badges { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.lesson-intro h1 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin-bottom: 4px; }
.lesson-alt-title { font-size: 1rem; color: var(--muted); margin-bottom: 14px; direction: ltr; text-align: start; }
.lesson-summary { color: var(--muted); max-width: 62ch; margin-bottom: 18px; }
.lesson-meta { display: flex; flex-wrap: wrap; gap: 9px 18px; font-size: 0.82rem; font-weight: 600; color: var(--muted); margin-bottom: 18px; }
.lesson-meta span { display: inline-flex; align-items: center; gap: 6px; }
.lesson-meta .ic { color: var(--brand); }
.lesson-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.aside-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.aside-card h3 { font-size: 0.95rem; margin-bottom: 12px; display: flex; align-items: center; gap: 7px; }
.aside-card h3 .ic { color: var(--brand); }
.aside-progress { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.aside-progress strong { font-size: 1.5rem; color: var(--brand-700); font-variant-numeric: tabular-nums; line-height: 1; }
.aside-progress small { color: var(--muted); font-size: 0.74rem; }
.aside-tip { background: var(--accent-soft); border-color: transparent; }
.aside-tip p { font-size: 0.82rem; color: #6b4a00; margin: 0; line-height: 1.75; }
.aside-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.aside-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.aside-list a { font-weight: 600; font-size: 0.86rem; }
.aside-list .score { font-size: 0.72rem; font-weight: 700; color: var(--muted); }
.aside-list .score.is-pass { color: var(--success); }

.sentence-toolbar {
  position: sticky;
  top: calc(var(--header-h) + 10px);
  z-index: 50;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
}
.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: var(--brand-soft);
  color: var(--brand-700);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.toolbar-btn:hover { background: #d9efe8; }
.toolbar-btn.ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.toolbar-btn.ghost:hover { color: var(--ink); background: var(--surface-2); }
.toolbar-btn.is-active { background: var(--ink); color: #fff; }
.speed-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-inline-start: auto;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted);
}
.speed-control input[type="range"] {
  width: 92px;
  accent-color: var(--brand);
  cursor: pointer;
}
.sentence-count-label { font-size: 0.76rem; font-weight: 700; color: var(--muted); }

.sentences { display: flex; flex-direction: column; gap: 12px; }
.sentence-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
  scroll-margin-top: 150px;
}
.sentence-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.sentence-card.is-current {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(15, 138, 112, 0.1);
  transform: translateY(-1px);
}
.sentence-card.is-learned { background: var(--brand-softer); border-color: #c6e8dd; }
.sentence-card.is-hidden-en .sc-en,
.sentence-card.is-hidden-en .sc-pron { filter: blur(7px); opacity: 0.6; user-select: none; transition: filter 0.2s; }
.sentence-card.is-hidden-en.reveal-en .sc-en,
.sentence-card.is-hidden-en.reveal-en .sc-pron { filter: none; opacity: 1; }
.sc-index {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 800;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}
.sentence-card.is-learned .sc-index { background: var(--brand); color: #fff; }
.sentence-card.is-learned .sc-index::after {
  content: "";
  position: absolute;
}
.sc-main { min-width: 0; }
.sc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.sc-pos { font-size: 0.74rem; font-weight: 700; color: var(--muted); letter-spacing: 0.02em; }
.sc-ar { font-size: 1.06rem; font-weight: 800; margin: 0 0 3px; }
.sc-en {
  direction: ltr;
  text-align: start;
  font-size: clamp(1.12rem, 1.9vw, 1.34rem);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.5;
  margin: 0 0 8px;
  letter-spacing: -0.015em;
}
.sc-pron {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: #7a5200;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.sc-pron .ic { width: 14px; height: 14px; opacity: 0.75; }
.sc-note { display: flex; gap: 6px; align-items: flex-start; font-size: 0.8rem; color: var(--muted); margin: 4px 0 0; line-height: 1.7; }
.sc-note .ic { color: var(--accent-strong); margin-top: 4px; }
.sc-image { margin-top: 10px; border-radius: 12px; max-height: 180px; object-fit: cover; }
.sc-actions { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.learn-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}
.learn-btn:hover { border-color: var(--brand); color: var(--brand-700); }
.learn-btn.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.learn-btn.is-on .ic { fill: currentColor; }

.lesson-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 26px;
}
.lesson-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.lesson-nav a:hover { border-color: var(--brand); transform: translateY(-2px); color: var(--ink); }
.lesson-nav .ln-label { font-size: 0.7rem; color: var(--muted); font-weight: 700; display: block; }
.lesson-nav .ln-title { font-weight: 800; font-size: 0.9rem; }
.lesson-nav .next { justify-content: flex-end; text-align: end; margin-inline-start: auto; }
.lesson-nav .next .ln-text { margin-inline-start: auto; }

/* --------------------------------------------------------------- practice */
.practice-wrap { padding: clamp(24px, 5vw, 50px) 0; }
.practice-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.practice-counter { font-size: 0.82rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.flashcard {
  max-width: 660px;
  margin: 0 auto;
  perspective: 1400px;
  min-height: 400px;
}
.fc-inner {
  position: relative;
  width: 100%;
  min-height: 400px;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.3, 0.8, 0.3, 1);
}
.flashcard.is-flipped .fc-inner { transform: rotateY(180deg); }
.fc-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  padding: clamp(24px, 4vw, 44px);
  border-radius: 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.fc-back {
  transform: rotateY(180deg);
  background: linear-gradient(160deg, #ffffff, #f2faf7);
}
.fc-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-600);
  background: var(--brand-soft);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}
.fc-ar { font-size: clamp(1.5rem, 3.4vw, 2.1rem); font-weight: 800; margin: 0; line-height: 1.6; }
.fc-en { font-size: clamp(1.5rem, 3.6vw, 2.2rem); font-weight: 800; margin: 0; direction: ltr; color: var(--brand-700); line-height: 1.5; }
.fc-pron { font-size: 0.95rem; color: #7a5200; background: var(--accent-soft); padding: 6px 14px; border-radius: var(--radius-pill); font-weight: 700; margin: 0; }
.fc-note { font-size: 0.82rem; color: var(--muted); margin: 0; max-width: 40ch; }
.fc-hint { position: absolute; inset-block-end: 18px; font-size: 0.72rem; color: var(--muted-2); }
.practice-controls {
  max-width: 660px;
  margin: 22px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.practice-progress { max-width: 660px; margin: 18px auto 0; }
.practice-progress .bar { height: 6px; }
.practice-shortcuts { text-align: center; font-size: 0.72rem; color: var(--muted-2); margin-top: 14px; }
kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-2);
}

/* ------------------------------------------------------------------- quiz */
.quiz-card { display: flex; flex-direction: column; height: 100%; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); color: var(--ink); transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease); }
.quiz-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: var(--ink); }
.quiz-card .qc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.quiz-glyph { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--accent-soft); color: #8a5b00; }
.quiz-card h3 { font-size: 1.05rem; margin-bottom: 4px; }
.quiz-card .qc-lesson { font-size: 0.76rem; color: var(--muted); margin-bottom: 10px; }
.quiz-card .qc-desc { font-size: 0.82rem; color: var(--muted); margin-bottom: 14px; }
.quiz-card .qc-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 0.76rem; color: var(--muted); font-weight: 600; margin-top: auto; }
.quiz-card .qc-meta span { display: inline-flex; align-items: center; gap: 5px; }
.quiz-card .qc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.best-score { font-size: 0.78rem; font-weight: 800; color: var(--success); }
.best-score.none { color: var(--muted-2); font-weight: 600; }

.quiz-start-card {
  max-width: 760px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(26px, 5vw, 46px);
  box-shadow: var(--shadow);
  text-align: center;
}
.quiz-start-card .quiz-glyph { margin: 0 auto 16px; width: 64px; height: 64px; border-radius: 20px; }
.quiz-start-card h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.quiz-facts { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 18px 0 22px; }
.quiz-fact { padding: 10px 16px; border-radius: 14px; background: var(--surface-2); font-size: 0.8rem; font-weight: 700; color: var(--ink-2); display: inline-flex; align-items: center; gap: 7px; }
.quiz-rules { text-align: start; max-width: 460px; margin: 0 auto 24px; display: flex; flex-direction: column; gap: 8px; }
.quiz-rules li { display: flex; gap: 9px; font-size: 0.86rem; color: var(--muted); }
.quiz-rules .ic { color: var(--brand); margin-top: 4px; }

.quiz-shell { max-width: 900px; margin: 0 auto; }
.quiz-timer {
  position: sticky;
  top: calc(var(--header-h) + 10px);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 18px;
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  font-size: 0.84rem;
  font-weight: 700;
}
.quiz-timer .timer-clock { display: inline-flex; align-items: center; gap: 7px; font-variant-numeric: tabular-nums; }
.quiz-timer.is-low { border-color: #e9b4ae; background: var(--danger-soft); color: var(--danger); }
.quiz-timer .answered-label { color: var(--muted); font-weight: 600; }
.question-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 30px);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 140px;
}
.q-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.q-index { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--ink); color: #fff; font-weight: 800; font-size: 0.82rem; }
.q-points { margin-inline-start: auto; font-size: 0.74rem; font-weight: 700; color: var(--muted); }
.q-prompt { font-size: clamp(1.02rem, 1.8vw, 1.18rem); margin: 0 0 4px; }
.q-prompt-en { direction: ltr; text-align: start; font-size: 0.9rem; color: var(--muted); margin: 0 0 14px; }
.options { display: flex; flex-direction: column; gap: 9px; margin-top: 14px; }
.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.15s var(--ease);
}
.option:hover { border-color: var(--brand); background: var(--brand-softer); }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option-mark {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  transition: border-color 0.2s var(--ease);
}
.option-mark::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: transparent; transition: background 0.2s; }
.option-text { font-weight: 600; font-size: 0.94rem; }
.option-text[dir="ltr"] { text-align: start; }
.option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.option:has(input:checked) .option-mark { border-color: var(--brand); }
.option:has(input:checked) .option-mark::after { background: var(--brand); }
.option.is-correct { border-color: var(--success); background: var(--success-soft); pointer-events: none; }
.option.is-correct .option-mark { border-color: var(--success); }
.option.is-correct .option-mark::after { background: var(--success); }
.option.is-wrong { border-color: var(--danger); background: var(--danger-soft); pointer-events: none; }
.option.is-wrong .option-mark { border-color: var(--danger); }
.option.is-wrong .option-mark::after { background: var(--danger); }
.quiz-submit {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 18px;
  margin-top: 18px;
  background: rgba(250, 247, 240, 0.94);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  border-radius: 16px;
  z-index: 40;
}
.quiz-submit .answered { font-size: 0.84rem; font-weight: 700; color: var(--muted); }

/* ----------------------------------------------------------------- result */
.result-hero {
  position: relative;
  overflow: hidden;
  max-width: 820px;
  margin: 0 auto 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(26px, 5vw, 46px);
  text-align: center;
  box-shadow: var(--shadow);
}
.result-hero.is-passed { background: linear-gradient(165deg, #ffffff, #f0faf6); }
.result-hero.is-failed { background: linear-gradient(165deg, #ffffff, #fdf3ee); }
.result-hero::before {
  content: "";
  position: absolute;
  inset-block-start: -90px;
  inset-inline-end: -70px;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 138, 112, 0.14), transparent 70%);
}
.score-ring { position: relative; width: 168px; height: 168px; margin: 0 auto 18px; }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring .track { stroke: var(--surface-2); }
.score-ring .value { stroke: url(#scoreGradient); stroke-linecap: round; transition: stroke-dasharray 0.9s var(--ease); }
.score-ring .value.failed { stroke: var(--danger); }
.score-value { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score-value strong { font-size: 2.5rem; font-weight: 900; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.score-value span { font-size: 0.76rem; color: var(--muted); font-weight: 700; }
.result-hero h1 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-bottom: 6px; }
.result-hero p { color: var(--muted); margin-bottom: 18px; }
.result-stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.result-stat { padding: 9px 16px; border-radius: 12px; background: rgba(255, 255, 255, 0.75); border: 1px solid var(--line); font-size: 0.78rem; font-weight: 700; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.result-stat strong { color: var(--ink); }
.review-list { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.review-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.review-card.is-correct { border-inline-start: 4px solid var(--success); }
.review-card.is-wrong { border-inline-start: 4px solid var(--danger); }
.review-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; flex-wrap: wrap; }
.review-verdict { display: inline-flex; align-items: center; gap: 5px; font-size: 0.74rem; font-weight: 800; padding: 3px 10px; border-radius: var(--radius-pill); }
.review-verdict.good { background: var(--success-soft); color: var(--success); }
.review-verdict.bad { background: var(--danger-soft); color: var(--danger); }
.review-answer { font-size: 0.82rem; color: var(--muted); margin: 4px 0; }
.review-answer strong { color: var(--ink); }
.review-explanation { margin-top: 12px; padding: 12px 14px; background: var(--brand-softer); border-radius: 12px; font-size: 0.84rem; color: var(--ink-2); }
.review-explanation b { color: var(--brand-700); }

/* --------------------------------------------------------------- auth pages */
.auth-wrap { padding: clamp(30px, 6vw, 64px) 0; }
.auth-card {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  max-width: 980px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 30px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.auth-form { padding: clamp(26px, 4.5vw, 46px); }
.auth-form h1 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 6px; }
.auth-form .auth-sub { color: var(--muted); font-size: 0.9rem; margin-bottom: 24px; }
.auth-side {
  position: relative;
  background: linear-gradient(155deg, #0d5c4c 0%, #0a3d33 60%, #072a24 100%);
  color: #fff;
  padding: clamp(26px, 4vw, 44px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}
.auth-side::before {
  content: "";
  position: absolute;
  inset-block-start: -70px;
  inset-inline-end: -60px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 180, 41, 0.35), transparent 70%);
}
.auth-side h2 { color: #fff; font-size: 1.35rem; position: relative; }
.auth-side p { color: rgba(255, 255, 255, 0.72); font-size: 0.86rem; position: relative; }
.auth-benefits { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; position: relative; }
.auth-benefits li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.85rem; color: rgba(255, 255, 255, 0.86); }
.auth-benefits .b-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: rgba(255, 255, 255, 0.12); flex: 0 0 auto; color: var(--accent); }
.auth-quote { margin-top: 26px; padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.12); font-size: 0.8rem; color: rgba(255, 255, 255, 0.78); position: relative; }
.auth-foot { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 0.85rem; color: var(--muted); text-align: center; }

/* ----------------------------------------------------------------- profile */
.profile-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
}
.profile-hero .ph-copy { flex: 1; min-width: 200px; }
.profile-hero h1 { font-size: 1.5rem; margin: 0 0 2px; }
.profile-hero .ph-meta { font-size: 0.82rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 12px; }
.profile-hero .ph-meta span { display: inline-flex; gap: 5px; align-items: center; }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.kpi-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.kpi-card .kpi-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-700); margin-bottom: 10px; }
.kpi-card strong { display: block; font-size: 1.6rem; line-height: 1.2; font-weight: 900; font-variant-numeric: tabular-nums; }
.kpi-card span { font-size: 0.78rem; color: var(--muted); font-weight: 600; }

.panel-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); }
.panel-block h2 { font-size: 1.02rem; margin-bottom: 14px; display: flex; align-items: center; gap: 7px; }
.panel-block h2 .ic { color: var(--brand); }
.track-progress { margin-bottom: 16px; }
.track-progress:last-child { margin-bottom: 0; }
.track-progress .tp-head { display: flex; justify-content: space-between; font-size: 0.82rem; font-weight: 700; margin-bottom: 6px; }
.track-progress .tp-head span:last-child { color: var(--muted); font-size: 0.76rem; }

.continue-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: linear-gradient(140deg, #0f8a70, #0a5c4b);
  color: #fff;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.continue-card:hover { color: #fff; }
.continue-card .cc-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: rgba(255, 255, 255, 0.15); flex: 0 0 auto; }
.continue-card .cc-copy { flex: 1; }
.continue-card small { font-size: 0.7rem; color: rgba(255, 255, 255, 0.7); font-weight: 700; display: block; }
.continue-card strong { font-size: 1rem; display: block; }
.continue-card .cc-go { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: #3c2c00; }

.table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.table th { text-align: start; font-size: 0.72rem; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table a { font-weight: 700; }
.table .score-pill { font-weight: 800; font-size: 0.78rem; padding: 2px 9px; border-radius: var(--radius-pill); background: var(--surface-2); }
.table .score-pill.is-pass { background: var(--success-soft); color: var(--success); }
.table .score-pill.is-fail { background: var(--danger-soft); color: var(--danger); }

/* ------------------------------------------------------------- search/about */
.search-hero { max-width: 720px; margin: 0 auto; text-align: center; padding-top: clamp(20px, 4vw, 40px); }
.search-form-lg { position: relative; margin: 22px auto 0; }
.search-form-lg .form-control { height: 58px; padding-inline: 50px 130px; border-radius: var(--radius-pill); font-size: 1rem; box-shadow: var(--shadow-sm); }
.search-form-lg .s-icon { position: absolute; inset-inline-start: 20px; inset-block-start: 50%; transform: translateY(-50%); color: var(--muted); }
.search-form-lg .btn { position: absolute; inset-inline-end: 5px; inset-block-start: 5px; height: 48px; }
[dir="rtl"] .search-form-lg .form-control { padding-inline: 130px 50px; }

.result-group { margin-bottom: 30px; }
.result-group h2 { font-size: 1.1rem; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.result-group h2 .count { font-size: 0.72rem; background: var(--surface-2); color: var(--muted); padding: 2px 8px; border-radius: var(--radius-pill); }
.result-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; margin-bottom: 8px; color: var(--ink); }
.result-row:hover { border-color: var(--brand); color: var(--ink); }
.result-row .rr-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--brand-soft); color: var(--brand-700); flex: 0 0 auto; }
.result-row .rr-copy { flex: 1; min-width: 0; }
.result-row .rr-title { font-weight: 700; font-size: 0.92rem; }
.result-row .rr-sub { font-size: 0.76rem; color: var(--muted); direction: ltr; text-align: start; }

.prose { font-size: 0.95rem; color: var(--ink-2); line-height: 1.95; }
.prose p { margin-bottom: 1.1rem; }
.prose h3 { margin-top: 1.6rem; }

.about-hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 30px;
  align-items: center;
  margin-bottom: 30px;
}
.about-visual { position: relative; min-height: 340px; border-radius: var(--radius-lg); background: linear-gradient(150deg, #0f8a70, #0a4a3d); overflow: hidden; box-shadow: var(--shadow); display: grid; place-items: center; color: #fff; }
.about-visual::before { content: ""; position: absolute; inset-block-start: -60px; inset-inline-end: -40px; width: 220px; height: 220px; border-radius: 50%; border: 1px solid rgba(255,255,255,.2); box-shadow: 0 0 0 40px rgba(255,255,255,.06), 0 0 0 80px rgba(255,255,255,.03); }
.about-visual .big-quote { font-size: 5rem; line-height: 1; color: var(--accent); opacity: .9; }
.about-visual p { position: relative; padding: 0 30px; text-align: center; font-weight: 700; font-size: 1.05rem; color: #fff; }
.about-visual small { display: block; margin-top: 8px; color: rgba(255,255,255,.6); font-weight: 600; font-size: .78rem; }

.value-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.value-card { display: flex; gap: 14px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.value-card .v-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--brand-soft); color: var(--brand-700); flex: 0 0 auto; }
.value-card h3 { font-size: .95rem; margin-bottom: 3px; }
.value-card p { font-size: .82rem; color: var(--muted); margin: 0; line-height: 1.7; }

.contact-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 24px; align-items: start; }
.contact-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(22px, 3.4vw, 34px); box-shadow: var(--shadow-sm); }
.contact-info { background: linear-gradient(155deg, #0f5f4f, #0a3b32); color: #fff; }
.contact-info h2 { color: #fff; font-size: 1.15rem; }
.contact-info p { color: rgba(255, 255, 255, 0.72); font-size: 0.86rem; }
.contact-list { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.contact-list li { display: flex; gap: 12px; align-items: center; font-size: 0.88rem; color: rgba(255, 255, 255, 0.88); }
.contact-list .ci-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: rgba(255, 255, 255, 0.12); flex: 0 0 auto; color: var(--accent); }
.contact-list a { color: #fff; }
.contact-list small { display: block; font-size: 0.7rem; color: rgba(255, 255, 255, 0.55); }
.social-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.social-row a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: rgba(255, 255, 255, 0.1); color: #fff; transition: background .2s var(--ease), color .2s var(--ease); }
.social-row a:hover { background: var(--accent); color: #3c2c00; }

/* ------------------------------------------------------------------ footer */
.site-footer {
  margin-top: clamp(40px, 6vw, 70px);
  background: #0c2823;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.88rem;
  position: relative;
  overflow: hidden;
}
.site-footer::before {
  content: "";
  position: absolute;
  inset-block-start: -160px;
  inset-inline-end: -100px;
  width: 380px; height: 380px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 60px rgba(255, 255, 255, 0.02), 0 0 0 120px rgba(255, 255, 255, 0.015);
  pointer-events: none;
}
.footer-top {
  position: relative;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 30px;
  padding: clamp(36px, 5vw, 58px) 0 30px;
}
.footer-brand .brand { color: #fff; margin-bottom: 14px; }
.footer-brand .brand:hover { color: #fff; }
.footer-brand .brand-text small { color: rgba(255, 255, 255, 0.5); }
.footer-about { font-size: 0.84rem; line-height: 1.8; color: rgba(255, 255, 255, 0.6); max-width: 34ch; }
.footer-col h3 { color: #fff; font-size: 0.88rem; margin-bottom: 14px; font-weight: 700; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: rgba(255, 255, 255, 0.62); font-size: 0.84rem; }
.footer-col a:hover { color: var(--accent); }
.footer-contact li { display: flex; gap: 9px; align-items: flex-start; margin-bottom: 11px; font-size: 0.82rem; }
.footer-contact .ic { color: var(--accent); margin-top: 4px; }
.footer-contact a { color: rgba(255, 255, 255, 0.8); }
.footer-social { display: flex; gap: 8px; margin-top: 16px; }
.footer-social a { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: rgba(255, 255, 255, 0.08); color: #fff; }
.footer-social a:hover { background: var(--accent); color: #3c2c00; }
.footer-bottom {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 0 26px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.45);
}
.footer-bottom a { color: rgba(255, 255, 255, 0.6); }
.footer-bottom .fb-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-credit {
  display: flex;
  justify-content: center;
  padding: 0 0 22px;
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.42);
}
.footer-credit span { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.footer-credit a { color: rgba(255, 255, 255, 0.72); font-weight: 700; }
.footer-credit a:hover { color: var(--accent); }
.footer-credit .ic { opacity: 0.6; }

/* ------------------------------------------------------------------- forms */
.field { margin-bottom: 16px; }
.field > label {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--ink-2);
}
.field .req { color: var(--danger); margin-inline-start: 2px; }
.field .hint { font-size: 0.74rem; color: var(--muted); margin: 5px 0 0; line-height: 1.6; }
.field .error { font-size: 0.76rem; color: var(--danger); margin: 5px 0 0; font-weight: 600; display: flex; gap: 5px; align-items: center; }
.field .error::before { content: "!"; display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: var(--danger); color: #fff; font-size: 0.62rem; font-weight: 800; }
.field.has-error .form-control,
.field.has-error .form-select { border-color: var(--danger); background: #fffafa; }

.form-control,
.form-select,
textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="url"],
input[type="search"] {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.5;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
  appearance: none;
}
textarea { min-height: 110px; resize: vertical; }
.form-control:focus,
.form-select:focus,
textarea:focus,
input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(15, 138, 112, 0.12);
}
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23647a74' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-inline-end: 38px;
}
[dir="rtl"] .form-select { background-position: left 12px center; }
.form-check-input { width: 18px; height: 18px; accent-color: var(--brand); margin-inline-end: 6px; vertical-align: -3px; }
.form-file { padding: 8px 12px; }
.form-file::file-selector-button {
  margin-inline-end: 10px;
  padding: 6px 12px;
  border: 0;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand-700);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 0.86rem; font-weight: 600; }
.check-row input { width: 18px; height: 18px; accent-color: var(--brand); }

/* -------------------------------------------------------------- alerts/misc */
.alerts { padding-top: 16px; }
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  animation: dropIn 0.25s var(--ease);
}
.alert .ic { margin-top: 3px; flex: 0 0 auto; }
.alert .a-body { flex: 1; }
.alert .a-close { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 2px; border-radius: 6px; }
.alert .a-close:hover { background: rgba(0, 0, 0, 0.05); color: var(--ink); }
.alert-success { background: var(--success-soft); border-color: #c7ebdd; color: #0b5c45; }
.alert-error, .alert-danger { background: var(--danger-soft); border-color: #f2cfca; color: #8f2f27; }
.alert-warning { background: var(--accent-soft); border-color: #f0dfa8; color: #7a5200; }
.alert-info { background: #eef6fa; border-color: #d2e5ef; color: #25566e; }

.empty-state {
  text-align: center;
  padding: clamp(36px, 6vw, 64px) 20px;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
}
.empty-state .es-icon {
  display: grid; place-items: center;
  width: 62px; height: 62px;
  margin: 0 auto 14px;
  border-radius: 18px;
  background: var(--brand-soft);
  color: var(--brand-700);
}
.empty-state h3 { font-size: 1.05rem; margin-bottom: 4px; color: var(--ink); }
.empty-state p { font-size: 0.86rem; margin: 0 auto 16px; max-width: 40ch; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 30px; flex-wrap: wrap; }
.pagination a, .pagination span {
  display: grid; place-items: center;
  min-width: 38px; height: 38px;
  padding: 0 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.84rem;
  font-weight: 700;
}
.pagination a:hover { border-color: var(--brand); color: var(--brand-700); }
.pagination .is-current { background: var(--ink); border-color: var(--ink); color: #fff; }
.pagination .is-disabled { opacity: 0.4; pointer-events: none; }

.divider { height: 1px; background: var(--line); border: 0; margin: 22px 0; }
.notice {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--brand-softer);
  border: 1px solid #d5ece4;
  font-size: 0.84rem;
  color: var(--ink-2);
}
.notice .ic { color: var(--brand); margin-top: 3px; }
.notice.accent { background: var(--accent-soft); border-color: #f0dfa8; color: #6b4a00; }
.notice.accent .ic { color: #b57c00; }

/* ------------------------------------------------------------------ motion */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes dropIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  .nav-main { gap: 0; margin-inline-start: 8px; }
  .nav-main a { padding: 8px 10px; font-size: 0.86rem; }
  .cards-grid { grid-template-columns: repeat(3, 1fr); }
  .float-quiz, .float-audio { display: none; }
}

@media (max-width: 960px) {
  .nav-main { display: none; }
  .nav-toggle { display: inline-flex; }
  .header-actions { gap: 6px; }
  .header-actions .lang-switch { display: none; }
  .header-actions .login-link { display: none; }
  .hero-inner { grid-template-columns: 1fr; gap: 30px; }
  .hero-copy { max-width: none; }
  .hero-visual { min-height: 380px; }
  .float-score, .float-streak { display: none; }
  .sentence-preview { width: min(430px, 100%); }
  .track-grid { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr 1fr; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .levels-grid { grid-template-columns: 1fr; }
  .lesson-hero { grid-template-columns: 1fr; }
  .lesson-aside { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .lesson-aside .aside-card { margin-bottom: 0; }
  .auth-card { grid-template-columns: 1fr; max-width: 560px; }
  .auth-side { display: none; }
  .about-hero { grid-template-columns: 1fr; }
  .about-visual { min-height: 260px; order: -1; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 26px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-hero { align-items: flex-start; }
  .filter-form { grid-template-columns: 1fr 1fr; }
  .filter-form .filter-submit { grid-column: 1 / -1; }
  .filter-form .filter-submit .btn { width: 100%; }
}

@media (max-width: 640px) {
  :root { --header-h: 66px; }
  body { font-size: 15.5px; }
  .brand-mark { width: 40px; height: 40px; border-radius: 13px; }
  .brand-text strong { font-size: 0.92rem; }
  .brand-text small { display: none; }
  .header-actions .icon-btn { width: 38px; height: 38px; }
  .user-chip .uc-name { display: none; }
  .user-chip { padding: 3px; border-radius: 50%; }
  [dir="rtl"] .user-chip { padding: 3px; }
  .stats-strip { grid-template-columns: 1fr 1fr; }
  .stat-cell:nth-child(3) { border-inline-start: 0; }
  .stat-cell:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .cards-grid { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr; }
  .hero-actions .btn { flex: 1 1 auto; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .lesson-aside { grid-template-columns: 1fr; }
  .sentence-card { grid-template-columns: auto 1fr; padding: 16px; gap: 12px; }
  .sc-actions { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; border-top: 1px dashed var(--line); padding-top: 10px; }
  .learn-btn span { display: none; }
  .sentence-toolbar { border-radius: 18px; }
  .speed-control { margin-inline-start: 0; width: 100%; justify-content: flex-end; }
  .question-card { padding: 16px; }
  .option { padding: 11px 13px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .footer-top { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .search-form-lg .form-control { padding-inline: 46px 100px; }
  [dir="rtl"] .search-form-lg .form-control { padding-inline: 100px 46px; }
  .search-form-lg .btn { padding: 0 14px; }
  .quiz-submit { flex-direction: column; align-items: stretch; }
  .quiz-submit .btn { width: 100%; }
  .value-grid { grid-template-columns: 1fr; }
  .auth-form { padding: 24px 20px; }
  .score-ring { width: 140px; height: 140px; }
  .score-value strong { font-size: 2.1rem; }
  .profile-actions { width: 100%; }
  .profile-actions .btn { flex: 1; }
}
