/* Design tokens (colours, fonts, spacing, type scale, star motif) now live
   in assets/css/tokens.css, loaded before this file on both the front end
   and wp-admin so the admin shares the same brand values. Do not redeclare
   :root here — tokens.css is the single source of truth.

   Cairo is enqueued as its own stylesheet (see custom_quiz_enqueue_assets in
   custom-quiz.php) rather than @import-ed here: an @import serialises after
   this file downloads, which is the slowest possible way to load a font. */

* {
  box-sizing: border-box;
}

body {
  font-family: var(--sura-font-body);
  background-color: var(--sura-paper);
  margin: 0;
  padding: var(--space-5) var(--space-3);
  color: var(--sura-text);
}

h2 {
  font-family: var(--sura-font-display);
  font-size: var(--text-xl);
  margin-bottom: var(--space-4);
}

/* RTL support — all content is Arabic. Flex/grid layouts (.quiz-body,
   .quiz-header, .nav-buttons, .number-grid, etc.) mirror automatically
   under dir="rtl" per the CSS spec, so only text alignment needs to be
   set explicitly here. */
#custom-quiz-app {
  direction: rtl;
  text-align: right;
}

#custom-quiz-app input[type="text"] {
  text-align: right;
}

/* Instructions screen */
#instructionsScreen {
  background-color: var(--sura-card);
  border: 1px solid var(--sura-border-soft);
  border-radius: 20px;
  padding: var(--space-6) var(--space-5);
  max-width: 420px;
  margin: 40px auto;
  text-align: center;
  box-shadow: var(--sura-shadow);
  font-family: var(--sura-font-body);
  color: var(--sura-text);
}

#instructionsScreen p {
  color: var(--sura-text-secondary);
  font-size: var(--text-base);
}

#instructionsScreen button {
  padding: 12px 20px;
  border: none;
  border-radius: 12px;
  background: var(--sura-btn-primary-bg);
  color: var(--sura-btn-primary-text);
  cursor: pointer;
  font-family: var(--sura-font-body);
  font-weight: 700;
  font-size: var(--text-base);
  margin-top: var(--space-2);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

#instructionsScreen button:hover { opacity: 0.92; }
#instructionsScreen button:active { transform: scale(0.98); }

#instructionsScreen .secondary-btn,
.exam-info-bar button {
  background: var(--sura-paper);
  border: 1px solid var(--sura-border);
  color: var(--sura-text-secondary);
}

.exam-info-bar button {
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--sura-font-body);
  font-weight: 700;
  font-size: var(--text-sm);
  transition: opacity 0.12s ease;
}

.exam-info-bar button:hover { opacity: 0.85; }

/* ---------- Login screen (سُرى brand) ---------- */
#loginScreen {
  background-color: var(--sura-paper);
  border-radius: 20px;
  padding: 32px 8px;
}

.sura-card {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  background: var(--sura-card);
  border: 1px solid var(--sura-border-soft);
  border-radius: 20px;
  box-shadow: var(--sura-shadow);
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  font-family: var(--sura-font-body);
  color: var(--sura-text);
}

.brand-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--sura-primary);
}

.brand-mark svg { width: 30px; height: 30px; }

.brand-mark .wordmark {
  font-family: var(--sura-font-display);
  font-weight: 700;
  font-size: 24px;
  color: var(--sura-primary);
}

.sura-card .screen-title {
  font-family: var(--sura-font-display);
  font-weight: 700;
  font-size: 19px;
  margin: 4px 0 0;
  text-align: center;
}

.sura-card .subtext {
  font-size: 13px;
  color: var(--sura-text-secondary);
  text-align: center;
  margin: -8px 0 4px;
  line-height: 1.6;
}

.sura-field {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sura-field label {
  font-size: 12px;
  color: var(--sura-text-secondary);
  font-weight: 700;
}

.sura-field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--sura-border);
  background: var(--sura-paper);
  color: var(--sura-text);
  font-family: var(--sura-font-body);
  font-size: 14px;
  text-align: right;
}

.sura-field input:focus-visible {
  outline: 2px solid var(--sura-primary-light);
  outline-offset: 1px;
  border-color: var(--sura-primary);
}

.sura-field-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}

/* ---------- Button system ----------
   Two layers, deliberately different in specificity:

   1. A near-zero-specificity structural default for EVERY <button> in the
      app (below), via :where() — so it fills gaps (a real 44px touch
      target, a focus ring, a disabled state) without ever overriding a
      screen's own intentional colour rule. Before this there was no
      fallback at all: #practiceCheckBtn/#practiceNextBtn and the plain
      .sura-btn logout button only ever had background/colour set and
      rendered as bare unstyled native buttons everywhere else.

   2. .sura-btn + real specificity variant/size/state modifiers, for new
      markup (this file's own login/course-picker buttons, and
      assets/js/quiz-runner.js's prev/next/mark/submit controls) to opt
      into explicitly, matching the primary/secondary/ghost/danger,
      sm/lg, disabled/loading system called for in the UI plan.

   The ~25 existing per-screen button rules (#markBtn, #submitBtn,
   .qnum-btn, .unit-action-btn, etc.) are untouched — they inherit layer 1
   automatically through the cascade and keep every colour/sizing choice
   they already made on purpose. Rewriting each of those call sites to the
   new classes was considered and deliberately not done: it would mean
   blind edits across a dozen files with no way to visually confirm the
   result, which is exactly the risk this project's own conventions ask to
   avoid. */
:where(#custom-quiz-app, #custom-quiz-lesson-quiz) button {
  font-family: var(--sura-font-body);
  font-weight: 700;
  font-size: var(--text-base);
  line-height: 1.3;
  cursor: pointer;
  border: none;
  border-radius: 10px;
  min-height: 44px;
  padding: 10px 18px;
  transition: opacity 0.12s ease, transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

:where(#custom-quiz-app, #custom-quiz-lesson-quiz) button:hover {
  opacity: 0.92;
}

:where(#custom-quiz-app, #custom-quiz-lesson-quiz) button:active {
  transform: scale(0.98);
}

:where(#custom-quiz-app, #custom-quiz-lesson-quiz) button:focus-visible {
  outline: 2px solid var(--sura-primary-light);
  outline-offset: 2px;
}

:where(#custom-quiz-app, #custom-quiz-lesson-quiz) button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ---------- .sura-btn: explicit variant system ---------- */
.sura-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-family: var(--sura-font-body);
  font-weight: 700;
  font-size: var(--text-base);
  line-height: 1.3;
  cursor: pointer;
  min-height: 44px;
  box-sizing: border-box;
  transition: opacity 0.12s ease, transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.sura-btn:hover { opacity: 0.92; }
.sura-btn:active { transform: scale(0.98); }

.sura-btn:focus-visible {
  outline: 2px solid var(--sura-primary-light);
  outline-offset: 2px;
}

/* Real disabled state, plus .is-loading for an async action in flight
   (assets/js/quiz-runner.js sets this on submit) — neither existed before. */
.sura-btn:disabled,
.sura-btn.is-loading {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}

/* Variants */
.sura-btn--primary {
  background: var(--sura-btn-primary-bg);
  color: var(--sura-btn-primary-text);
  border-color: transparent;
}

.sura-btn--secondary {
  background: var(--sura-paper);
  color: var(--sura-text-secondary);
  border-color: var(--sura-border);
}

.sura-btn--ghost {
  background: none;
  color: var(--sura-text-secondary);
  border-color: transparent;
}

.sura-btn--ghost:hover {
  background: var(--sura-paper);
  opacity: 1;
}

.sura-btn--danger {
  background: var(--sura-danger);
  color: var(--sura-on-accent);
  border-color: transparent;
}

/* Sizes. min-height stays 44px even on --sm — a smaller VISUAL button via
   tighter padding/font is fine; a smaller TAP target on the buttons a
   candidate hits most often during a timed exam is not. */
.sura-btn--sm {
  padding: 8px 14px;
  font-size: var(--text-sm);
}

.sura-btn--lg {
  padding: 14px 24px;
  font-size: var(--text-lg);
  min-height: 52px;
}

/* Opt-in full width, for buttons stacked in a narrow card (login, course
   picker) — split out from the base so inline contexts (quiz nav rows,
   where several buttons sit side by side) aren't forced to 100% width. */
.sura-btn--block {
  width: 100%;
}

/* Backward-compatible alias: the single-dash name used before this system
   existed. New markup should use .sura-btn--primary. */
.sura-btn-primary {
  background: var(--sura-btn-primary-bg);
  color: var(--sura-btn-primary-text);
}

.lookup-result-text {
  width: 100%;
  font-size: 13px;
  font-weight: 700;
  color: var(--sura-text);
  margin: 0;
}

.hint {
  font-size: 11px;
  color: var(--sura-text-muted);
  text-align: center;
  margin: -4px 0 0;
}

.auth-error {
  width: 100%;
  color: var(--sura-danger);
  font-size: 13px;
  margin: 0;
}

/* ---------- Course picker + apology screens (سُرى brand) ---------- */
/* Sit between login and the hub — same card shell/background treatment as
   #loginScreen, just reused via .sura-card rather than duplicated. */
#courseListScreen,
#apologyScreen {
  background-color: var(--sura-paper);
  border-radius: 20px;
  padding: 32px 8px;
}

.course-list-card { max-width: 440px; }

.course-list-items {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 4px 0;
}

.course-list-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--sura-border);
  background: var(--sura-paper);
  color: var(--sura-text);
  font-family: var(--sura-font-body);
  cursor: pointer;
  text-align: right;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.course-list-item:not(:disabled):hover { opacity: 0.88; }
.course-list-item:not(:disabled):active { transform: scale(0.99); }

.course-list-item-title {
  font-weight: 700;
  font-size: 15px;
}

.course-list-item-expired {
  cursor: not-allowed;
  opacity: 0.6;
}

.apology-card .subtext {
  margin-top: 0;
  line-height: 1.8;
}

/* ---------- Hub screen (سُرى brand) ---------- */
#hubScreen {
  background-color: var(--sura-paper);
  border-radius: 20px;
  padding: 28px 26px 32px;
  max-width: 560px;
  margin: 32px auto;
  box-shadow: var(--sura-shadow);
  font-family: var(--sura-font-body);
  color: var(--sura-text);
}

.hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.hub-header-start {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hub-header-end {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hub-logout-btn,
.hub-switch-course-btn {
  background: none;
  border: 1px solid var(--sura-border);
  color: var(--sura-text-secondary);
  font-family: var(--sura-font-body);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.hub-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--sura-primary);
}

.hub-brand svg { width: 22px; height: 22px; }

.hub-wordmark {
  font-family: var(--sura-font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--sura-primary);
}

.course-tag {
  display: inline-flex;
  align-items: center;
  background: var(--sura-course-bg);
  color: var(--sura-course-text);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
}

.hub-greeting {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 18px;
}

.hub-hello {
  font-size: 13px;
  color: var(--sura-text-muted);
}

.hub-name {
  font-family: var(--sura-font-display);
  font-weight: 700;
  font-size: 21px;
  color: var(--sura-text);
}

.readiness-gauge {
  position: relative;
  width: 110px;
  height: 110px;
  margin: 4px auto 22px;
}

.readiness-gauge svg {
  display: block;
  transform: rotate(-90deg);
}

.readiness-gauge-track {
  fill: none;
  stroke: var(--sura-border-soft);
  stroke-width: 10;
}

.readiness-gauge-fill {
  fill: none;
  stroke: var(--sura-primary);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 0.5s ease;
}

.readiness-gauge-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.readiness-gauge-value {
  font-family: var(--sura-font-display);
  font-weight: 700;
  font-size: 26px;
  color: var(--sura-text);
}

.readiness-gauge-caption {
  font-size: 11px;
  color: var(--sura-text-muted);
  max-width: 130px;
  text-align: center;
}

.hub-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 26px;
}

.stat-chip {
  background: var(--sura-card);
  border: 1px solid var(--sura-border-soft);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
  box-shadow: var(--sura-shadow);
}

.stat-label {
  display: block;
  font-size: 11px;
  color: var(--sura-text-muted);
  margin-bottom: 4px;
}

.stat-value {
  display: block;
  font-weight: 700;
  font-size: 14px;
  color: var(--sura-primary);
  font-variant-numeric: tabular-nums;
}

.hub-section { margin-bottom: 22px; }

.hub-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.hub-section-heading h2 {
  font-family: var(--sura-font-display);
  font-size: 16px;
  margin: 0;
  color: var(--sura-text);
}

.hub-section-links {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.hub-general-practice-link {
  background: none;
  border: none;
  color: var(--sura-text-secondary);
  font-family: var(--sura-font-body);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 0;
}

#hubMistakesBtn {
  color: var(--sura-danger);
  font-weight: 700;
}

.hub-secondary-tools {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.hub-secondary-label {
  font-family: var(--sura-font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--sura-text-muted);
}

.unit-sequence {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.unit-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.unit-row {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  background: var(--sura-card);
  border: 1px solid var(--sura-border-soft);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--sura-shadow);
}

.unit-step-badge {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sura-font-display);
  font-size: 12px;
  font-weight: 700;
  background: var(--sura-btn-primary-bg);
  color: var(--sura-btn-primary-text);
}

.unit-step-final {
  width: auto;
  padding: 0 8px;
  border-radius: 13px;
  font-size: 10.5px;
  background: var(--sura-course-bg);
  color: var(--sura-course-text);
}

.unit-sequence .unit-row:not(.unit-row-final) .unit-step-badge::after {
  content: '';
  position: absolute;
  right: calc(14px + 13px - 1px);
  top: 100%;
  width: 2px;
  height: 8px;
  background: var(--sura-border);
}

.unit-row-final {
  align-items: center;
}

.unit-row-final .full-mock-card {
  flex: 1;
  box-shadow: none;
  border: none;
  padding: 0;
}

.unit-row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.unit-row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.unit-row-top-btn {
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--sura-font-body);
  padding: 0;
}

.unit-row-top-btn:hover .unit-name {
  color: var(--sura-primary);
}

.unit-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--sura-text);
}

.unit-progress {
  font-size: 11.5px;
  color: var(--sura-text-muted);
  font-variant-numeric: tabular-nums;
}

.unit-exam-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin-right: 16px;
  padding: 8px 12px;
  border-right: 2px solid var(--sura-border);
  background: var(--sura-paper);
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--sura-font-body);
  border-top: none;
  border-bottom: none;
  border-left: none;
}

.unit-exam-row:hover {
  background: var(--sura-course-bg);
}

.unit-exam-row-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--sura-text-secondary);
}

.unit-action-btn {
  font-family: var(--sura-font-body);
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--sura-border);
  background: var(--sura-paper);
  color: var(--sura-text-secondary);
  text-decoration: none;
  display: inline-block;
}

.unit-exam-btn {
  background: var(--sura-btn-primary-bg);
  color: var(--sura-btn-primary-text);
  border-color: transparent;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  font-family: var(--sura-font-body);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.status-pill-completed {
  background: var(--sura-success-bg);
  color: var(--sura-success);
}

.status-pill-in_progress {
  background: var(--sura-warning-bg);
  color: var(--sura-warning);
}

.status-pill-not_attempted {
  background: var(--sura-paper);
  color: var(--sura-text-muted);
  border: 1px solid var(--sura-border);
}

.unit-practice-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.unit-practice-picker select {
  font-family: var(--sura-font-body);
  font-size: 12.5px;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid var(--sura-border);
  background: var(--sura-card);
  color: var(--sura-text);
}

.unit-practice-start-btn {
  font-family: var(--sura-font-body);
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  background: var(--sura-btn-primary-bg);
  color: var(--sura-btn-primary-text);
}

.full-mock-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  text-align: right;
  width: 100%;
  background: var(--sura-card);
  border: 1px solid var(--sura-border-soft);
  border-radius: 16px;
  box-shadow: var(--sura-shadow);
  padding: 16px 18px;
  cursor: pointer;
  font-family: var(--sura-font-body);
}

.full-mock-card:hover {
  border-color: var(--sura-primary-light);
}

.full-mock-card .mode-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sura-paper);
  color: var(--sura-primary);
}

.full-mock-card .mode-icon svg { width: 20px; height: 20px; }

.full-mock-card .mode-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.full-mock-card .mode-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--sura-text);
}

.mode-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.full-mock-card .mode-desc {
  font-size: 12.5px;
  color: var(--sura-text-secondary);
  line-height: 1.5;
}

.dash-link {
  display: block;
  margin: 4px auto 0;
  background: none;
  border: none;
  color: var(--sura-text-secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  font-size: 12.5px;
  font-family: var(--sura-font-body);
}

.exam-title {
  color: var(--sura-primary);
}

/* Dashboard screen */
.dashboard-section {
  background: var(--sura-card);
  border: 1px solid var(--sura-border-soft);
  border-radius: 14px;
  padding: var(--space-5);
  margin-bottom: var(--space-4);
  box-shadow: var(--sura-shadow);
  font-family: var(--sura-font-body);
  color: var(--sura-text);
}

.dashboard-section h2 {
  color: var(--sura-text);
}

.dashboard-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dashboard-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-family: var(--sura-font-body);
  font-size: var(--text-base);
}

.dashboard-table th {
  color: var(--sura-text-muted);
  font-size: var(--text-xs);
  font-weight: 700;
}

.dashboard-table th, .dashboard-table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--sura-border-soft);
  text-align: right;
  white-space: nowrap;
}

.dashboard-empty {
  color: var(--sura-text-muted);
  font-size: var(--text-sm);
}

.topic-bar-row {
  margin-bottom: var(--space-3);
}

.topic-bar-label {
  font-size: var(--text-sm);
  color: var(--sura-text-secondary);
  margin-bottom: var(--space-1);
}

.topic-bar-outer {
  background: var(--sura-paper);
  border-radius: 8px;
  overflow: hidden;
  height: 22px;
}

.topic-bar-inner {
  background: var(--sura-primary);
  color: var(--sura-on-accent);
  font-size: var(--text-xs);
  line-height: 22px;
  padding-right: var(--space-2);
  min-width: 30px;
  text-align: left;
  white-space: nowrap;
}

.topic-filter {
  background: var(--sura-card);
  border: 1px solid var(--sura-border-soft);
  padding: var(--space-3) var(--space-4);
  border-radius: 14px;
  margin-bottom: var(--space-4);
  box-shadow: var(--sura-shadow);
  font-family: var(--sura-font-body);
  font-size: var(--text-base);
  color: var(--sura-text);
}

.topic-filter select {
  margin-right: var(--space-2);
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--sura-border);
  background: var(--sura-paper);
  color: var(--sura-text);
  font-family: var(--sura-font-body);
}

/* Practice mode feedback */
.practice-feedback {
  margin-top: var(--space-3);
  padding: var(--space-3);
  border-radius: 10px;
  font-family: var(--sura-font-body);
  font-weight: 700;
}

.practice-feedback.correct {
  background: var(--sura-success-bg);
  color: var(--sura-success);
}

.practice-feedback.incorrect {
  background: var(--sura-danger-bg);
  color: var(--sura-danger);
}

.practice-feedback-verdict {
  margin: 0;
}

.practice-feedback-explanation {
  margin: var(--space-2) 0 0;
  font-weight: 400;
  font-size: var(--text-sm);
  color: var(--sura-text);
  line-height: 1.6;
}

/* Practice check/next buttons */
#practiceCheckBtn, #practiceNextBtn {
  background: var(--sura-btn-primary-bg);
  color: var(--sura-btn-primary-text);
}

/* AI chat widget */
#chatWidget {
  margin-top: var(--space-5);
  border-top: 1px solid var(--sura-border-soft);
  padding-top: var(--space-4);
}

#explainBtn {
  background: var(--sura-card);
  border: 1px solid var(--sura-primary-light);
  color: var(--sura-primary);
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--sura-font-body);
  font-weight: 700;
  font-size: var(--text-base);
  transition: opacity 0.12s ease;
}

#explainBtn:hover { opacity: 0.85; }

.explanation-box {
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--sura-paper);
  border: 1px solid var(--sura-border-soft);
  border-radius: 10px;
  font-family: var(--sura-font-body);
  font-size: var(--text-base);
  color: var(--sura-text);
  line-height: 1.6;
}

/* Exam info bar */
.exam-info-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--sura-card);
  border: 1px solid var(--sura-border-soft);
  padding: var(--space-3) var(--space-5);
  border-radius: 14px;
  margin-bottom: var(--space-3);
  box-shadow: var(--sura-shadow);
  font-family: var(--sura-font-body);
  font-size: var(--text-base);
  color: var(--sura-text);
}

.exam-info-bar p {
  margin: 0;
}

/* Header with question number and timer */
.quiz-header {
  display: flex;
  justify-content: space-between;
  background: var(--sura-card);
  border: 1px solid var(--sura-border-soft);
  padding: var(--space-4) var(--space-5);
  border-radius: 14px;
  margin-bottom: var(--space-4);
  box-shadow: var(--sura-shadow);
}

.quiz-header p {
  margin: 0;
  font-family: var(--sura-font-body);
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--sura-text);
}

#timer {
  font-variant-numeric: tabular-nums;
  color: var(--sura-primary);
}

/* Main layout: sidebar + question side by side */
.quiz-body {
  display: flex;
  gap: var(--space-5);
  align-items: flex-start;
}

.sidebar {
  flex: 0 0 220px;
  background: var(--sura-card);
  border: 1px solid var(--sura-border-soft);
  border-radius: 14px;
  padding: var(--space-4);
  box-shadow: var(--sura-shadow);
}

.question-box {
  flex: 1;
  min-width: 0;
  background: var(--sura-card);
  border: 1px solid var(--sura-border-soft);
  border-radius: 14px;
  padding: var(--space-5);
  box-shadow: var(--sura-shadow);
  font-family: var(--sura-font-body);
  color: var(--sura-text);
}

#qtext {
  font-size: var(--text-md);
  font-weight: 700;
  line-height: 1.6;
}

/* Number grid */
.number-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-2);
}

.qnum-btn {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 10px;
  background: var(--sura-paper);
  color: var(--sura-text-secondary);
  cursor: pointer;
  font-family: var(--sura-font-body);
  font-weight: 700;
  font-size: var(--text-base);
  transition: transform 0.1s ease;
}

.qnum-btn:hover {
  transform: scale(1.08);
}

.qnum-btn.answered {
  background: var(--sura-success);
  color: var(--sura-on-accent);
}

.qnum-btn.marked {
  background: var(--sura-warning-bg);
  color: var(--sura-warning);
}

.qnum-btn.current {
  outline: 3px solid var(--sura-primary-light);
  outline-offset: 1px;
}

/* Answer options */
.options label {
  display: block;
  background: var(--sura-paper);
  border: 1px solid var(--sura-border);
  color: var(--sura-text);
  font-family: var(--sura-font-body);
  font-size: var(--text-base);
  padding: 11px 14px;
  margin-bottom: var(--space-2);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.options label:hover {
  border-color: var(--sura-primary-light);
}

/* Mark button */
#markBtn {
  background: var(--sura-warning-bg);
  color: var(--sura-warning);
  border: none;
  font-family: var(--sura-font-body);
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
  margin-top: var(--space-3);
}

/* Nav buttons row */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-5);
  gap: var(--space-2);
}

.nav-buttons button {
  padding: 11px 20px;
  border: none;
  border-radius: 10px;
  font-family: var(--sura-font-body);
  font-weight: 700;
  font-size: var(--text-base);
  cursor: pointer;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.nav-buttons button:hover { opacity: 0.92; }
.nav-buttons button:active { transform: scale(0.98); }

#prevBtn, #nextBtn {
  background: var(--sura-paper);
  border: 1px solid var(--sura-border);
  color: var(--sura-text);
}

#submitBtn {
  background: var(--sura-danger);
  color: var(--sura-on-accent);
}

/* Review and thank-you screens */
#reviewScreen, #thankYouScreen {
  background-color: var(--sura-card);
  border: 1px solid var(--sura-border-soft);
  border-radius: 20px;
  padding: var(--space-6) var(--space-5);
  max-width: 500px;
  margin: 20px auto 0;
  text-align: center;
  box-shadow: var(--sura-shadow);
  font-family: var(--sura-font-body);
  color: var(--sura-text);
}

#thankYouScreen p {
  color: var(--sura-text-secondary);
  font-size: var(--text-base);
}

#reviewScreen .number-grid {
  justify-content: center;
  margin: 20px auto;
  max-width: 260px;
}

#backToQuizBtn, #confirmSubmitBtn, #backToHubBtn {
  padding: 12px 20px;
  border: none;
  border-radius: 12px;
  font-family: var(--sura-font-body);
  font-weight: 700;
  font-size: var(--text-base);
  cursor: pointer;
  margin: 4px;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

#backToQuizBtn:hover, #confirmSubmitBtn:hover, #backToHubBtn:hover { opacity: 0.92; }
#backToQuizBtn:active, #confirmSubmitBtn:active, #backToHubBtn:active { transform: scale(0.98); }

#backToQuizBtn {
  background: var(--sura-paper);
  border: 1px solid var(--sura-border);
  color: var(--sura-text-secondary);
}

#confirmSubmitBtn {
  background: var(--sura-danger);
  color: var(--sura-on-accent);
}

#backToHubBtn {
  background: var(--sura-btn-primary-bg);
  color: var(--sura-btn-primary-text);
}

/* Subchapter quiz widget — injected into Tutor LMS's own lesson pages via
   the_content, so it's dir="rtl" and styled independently of #custom-quiz-app
   (Tutor's own layout wraps it, not ours). Uses the same سُرى tokens
   (globally available) for visual consistency with the rest of the app. */
#custom-quiz-lesson-quiz {
  direction: rtl;
  text-align: right;
  font-family: var(--sura-font-body);
  color: var(--sura-text);
  background: var(--sura-card);
  border: 1px solid var(--sura-border-soft);
  border-radius: 16px;
  box-shadow: var(--sura-shadow);
  padding: 20px 22px;
  margin-top: 24px;
  max-width: 640px;
}

#custom-quiz-lesson-quiz h3 {
  font-family: var(--sura-font-display);
  font-size: 17px;
  margin: 0 0 14px;
}

.lesson-quiz-question {
  margin-bottom: 16px;
}

.lesson-quiz-question-text {
  font-weight: 700;
  margin: 0 0 8px;
}

.lesson-quiz-question label {
  display: block;
  background-color: var(--sura-paper);
  padding: 9px 12px;
  margin-bottom: 6px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

.lesson-quiz-question label:hover {
  border: 1px solid var(--sura-primary-light);
}

.lesson-quiz-question-reviewed {
  background: var(--sura-card);
  border: 1px solid var(--sura-border-soft);
  border-radius: 12px;
  padding: 14px 16px;
}

.lesson-quiz-review-option {
  margin: 0 0 6px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--sura-paper);
  font-size: 13.5px;
}

.lesson-quiz-review-option.is-correct {
  background: var(--sura-success-bg);
  color: var(--sura-success);
  font-weight: 700;
}

.lesson-quiz-review-option.is-selected-wrong {
  background: var(--sura-danger-bg);
  color: var(--sura-danger);
  text-decoration: line-through;
}

.lesson-quiz-explanation {
  margin: 10px 0 0;
  padding: 10px 12px;
  background: var(--sura-paper);
  border-radius: 8px;
  font-size: 13px;
  color: var(--sura-text-secondary);
  line-height: 1.6;
}

.lesson-quiz-submit-btn {
  background: var(--sura-btn-primary-bg);
  color: var(--sura-btn-primary-text);
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-family: var(--sura-font-body);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.lesson-quiz-result {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
}

.lesson-quiz-result.passed {
  background-color: var(--sura-course-bg);
  color: var(--sura-course-text);
}

.lesson-quiz-result.failed {
  background-color: var(--sura-danger-bg);
  color: var(--sura-danger);
}

.lesson-quiz-retry-btn {
  margin-top: 8px;
  background: var(--sura-paper);
  border: 1px solid var(--sura-border);
  color: var(--sura-text-secondary);
  padding: 8px 16px;
  border-radius: 8px;
  font-family: var(--sura-font-body);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

/* In-app unit content screen — subchapters render here directly instead of
   navigating to a Tutor LMS page, so the candidate never leaves the سُرى
   app shell. */
.unit-lesson-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 720px;
  margin: 0 auto;
}

.unit-lesson-card {
  background: var(--sura-card);
  border: 1px solid var(--sura-border-soft);
  border-radius: 14px;
  box-shadow: var(--sura-shadow);
  overflow: hidden;
}

.unit-lesson-header {
  width: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--sura-font-body);
  text-align: right;
}

.unit-lesson-chevron {
  margin-inline-start: auto;
  color: var(--sura-text-muted);
  font-size: 12px;
}

.unit-lesson-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 16px;
}

.unit-lesson-actions-stacked {
  flex-direction: column;
  align-items: stretch;
}

.unit-lesson-actions-stacked .unit-action-btn {
  width: 100%;
  text-align: center;
}

.unit-lesson-check {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--sura-border);
  color: var(--sura-course-text);
}

.unit-lesson-card.completed .unit-lesson-check {
  background: var(--sura-course-bg);
  border-color: transparent;
}

.unit-lesson-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--sura-text);
}

.unit-lesson-body {
  padding: 0 16px 18px;
}

.unit-video-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: 10px;
  overflow: hidden;
  background: var(--sura-video-bg);
  margin-bottom: 14px;
}

.unit-video-frame iframe,
.unit-video-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

#unitMaterials {
  max-width: 720px;
  margin: 0 auto 10px;
}

.unit-materials-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.unit-lesson-content {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--sura-text-secondary);
  margin-bottom: 14px;
}

.unit-lesson-content p {
  margin: 0 0 10px;
}

.unit-lesson-file-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--sura-paper);
  border: 1px solid var(--sura-border);
  color: var(--sura-primary);
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 700;
  text-decoration: none;
}

.unit-lesson-file-link::before {
  content: '📄';
}

.lesson-quiz-questions-wrap h4 {
  font-family: var(--sura-font-display);
  font-size: 15px;
  margin: 0 0 10px;
}

#chapterVideoBody,
#chapterQuizBody {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
}

/* Floating back-to-hub link on Tutor's own course/lesson pages */
#custom-quiz-floating-back {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--sura-card);
  color: var(--sura-primary);
  border: 1px solid var(--sura-border-soft);
  box-shadow: var(--sura-shadow);
  padding: 9px 16px;
  border-radius: 999px;
  font-family: var(--sura-font-body);
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  direction: rtl;
}

#custom-quiz-floating-back:hover {
  border-color: var(--sura-primary-light);
}

/* ---------- Responsive breakpoints ---------- */
/* The number grid is fluid at every width by default (rather than a fixed
   5 columns) so exam/review screens don't need a breakpoint just for this. */
.number-grid {
  grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
}

#reviewScreen .number-grid {
  grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
}

@media (max-width: 900px) {
  /* Exam sidebar + question stack instead of sitting side by side. */
  .quiz-body {
    flex-direction: column;
  }

  .sidebar {
    flex: 1 1 auto;
    width: 100%;
  }

  .number-grid {
    grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
  }
}

@media (max-width: 640px) {
  body {
    padding: var(--space-4) var(--space-2);
  }

  #loginScreen, #hubScreen {
    padding: var(--space-5) var(--space-2);
    margin: var(--space-4) auto;
    border-radius: 16px;
  }

  .sura-card {
    padding: var(--space-5) var(--space-4);
    border-radius: 16px;
  }

  .hub-stats {
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  }

  .exam-info-bar, .quiz-header {
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
  }

  .unit-row {
    flex-wrap: wrap;
  }

  .unit-exam-row {
    flex-wrap: wrap;
    margin-right: 8px;
  }

  .unit-lesson-actions {
    width: 100%;
  }

  .unit-action-btn {
    flex: 1 1 auto;
    text-align: center;
  }

  .full-mock-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-buttons {
    flex-wrap: wrap;
  }

  .nav-buttons button {
    flex: 1 1 auto;
  }

  .instructions-screen, #instructionsScreen, #reviewScreen, #thankYouScreen {
    margin: var(--space-4) auto;
    padding: var(--space-5) var(--space-4);
  }
}

/* ---------- Star-signature motif (brand-colour swappable) ----------
   Previously each of these three screens carried its own
   background-image data URI with %23332C6E encoded inside it, so changing
   the brand colour meant hand-editing three encoded strings — the exact
   opposite of the "swappable via CSS variables" requirement.

   Now the SVG is used as a MASK (shape only) and the colour comes from
   --sura-primary, which also means the motif follows the dark-mode primary
   automatically instead of staying indigo on a dark background. */
#loginScreen,
#courseListScreen,
#apologyScreen,
#hubScreen {
  position: relative;
}

#loginScreen::before,
#courseListScreen::before,
#apologyScreen::before,
#hubScreen::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background-color: var(--sura-primary);
  opacity: var(--sura-star-opacity);
  -webkit-mask-image: var(--sura-star-mask);
  mask-image: var(--sura-star-mask);
  -webkit-mask-repeat: repeat;
  mask-repeat: repeat;
}

/* Keep real content above the motif overlay. */
#loginScreen > *,
#courseListScreen > *,
#apologyScreen > *,
#hubScreen > * {
  position: relative;
  z-index: 1;
}

/* ---------- Shared quiz runner (one question at a time) ----------
   Used by the chapter quiz and the lesson-page quiz. Both previously
   rendered every question in one scrolling form while the mock exam and
   practice showed one at a time, so the same product taught two different
   quiz interactions. */
.quiz-runner {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.quiz-runner-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.quiz-runner-progress-text {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--sura-text-secondary);
}

.quiz-runner-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--sura-border-soft);
  overflow: hidden;
}

.quiz-runner-progress-fill {
  height: 100%;
  background: var(--sura-primary);
  border-radius: inherit;
  transition: width 0.25s ease;
}

.quiz-runner-navigator {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.quiz-runner-body {
  background: var(--sura-card);
  border: 1px solid var(--sura-border-soft);
  border-radius: 14px;
  padding: var(--space-5) var(--space-4);
  box-shadow: var(--sura-shadow);
}

.quiz-runner-question {
  margin: 0 0 var(--space-4);
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1.7;
  color: var(--sura-text);
}

/* Focused programmatically on advance so screen readers announce the new
   question; the ring would otherwise read as a stray focus artefact. */
.quiz-runner-question:focus { outline: none; }
.quiz-runner-question:focus-visible {
  outline: 2px solid var(--sura-primary-light);
  outline-offset: 4px;
  border-radius: 6px;
}

.quiz-runner-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.quiz-runner-option {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--sura-border);
  border-radius: 12px;
  background: var(--sura-paper);
  cursor: pointer;
  line-height: 1.6;
  transition: border-color 0.12s ease, background 0.12s ease;
  /* Whole row is the target, not just the radio — the dominant pattern in
     exam software and far easier on a phone. */
  min-height: 44px;
}

.quiz-runner-option:hover { border-color: var(--sura-primary-light); }

.quiz-runner-option.is-selected {
  border-color: var(--sura-primary);
  background: var(--sura-card);
  box-shadow: inset 0 0 0 1px var(--sura-primary);
}

.quiz-runner-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

/* Duplicate top copy of prev/next/mark — added so navigation is reachable
   without scrolling down past a long question and four options, then back
   up again. Kept visually quieter than the bottom pair (smaller gap, a
   hairline separator) so it reads as a convenience, not the primary action
   row — that's still the bottom one, closest to where the candidate just
   finished reading. */
.quiz-runner-nav--top {
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-1);
  border-bottom: 1px solid var(--sura-border-soft);
}

.quiz-runner-review-summary {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border-radius: 12px;
  background: var(--sura-success-bg);
  color: var(--sura-success);
  font-weight: 700;
}

.quiz-runner-review-summary.has-unanswered {
  background: var(--sura-warning-bg);
  color: var(--sura-warning);
}

@media (max-width: 640px) {
  /* Only the BOTTOM pair pins to the viewport — the top one already sits
     right above the question and would just eat screen height twice over
     if both stuck. */
  .quiz-runner-nav--bottom {
    position: sticky;
    bottom: 0;
    background: var(--sura-paper);
    padding: var(--space-2) 0;
    border-top: 1px solid var(--sura-border-soft);
    z-index: 2;
  }
}

/* ===== Site header + footer (theme wp_template_part content) =====
   These render inside the theme's own <header>/<footer class="wp-block-
   template-part"> landmarks on every front-end page (style.css loads
   site-wide, unconditionally — see custom_quiz_enqueue_assets()), so they
   sit alongside body's own padding (--space-5/--space-3 desktop,
   --space-4/--space-2 mobile — see the body rules above). The negative
   margins below bleed both back out to the true viewport edge; without
   them a sticky header stops short of top:0 and the footer leaves a
   page-coloured gutter on both sides, defeating "full band" contrast. */
/* No brand mark here — the login/course-select cards already carry the big
   centered برand, so a second wordmark top-left just duplicated it. The bar
   only exists to carry course context + logout once a candidate is signed
   in, so it stays fully hidden (not just its inner context row) until
   site-chrome.js confirms a session — see the [hidden] rule below. */
.sura-site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  margin: calc(-1 * var(--space-5)) calc(-1 * var(--space-3)) 0;
  background: var(--sura-card);
  border-bottom: 1px solid var(--sura-border);
  box-shadow: 0 1px 2px rgba(21, 19, 46, 0.04), 0 8px 20px -16px rgba(21, 19, 46, 0.18);
}

.sura-site-header[hidden] {
  display: none;
}

.sura-site-header-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-4);
  padding: 12px var(--space-5);
  direction: rtl;
}

/* wp_template_part content is run through KSES on render, which strips
   inline <svg> — the footer's brand mark (still used there) is a CSS mask
   instead of an embedded icon, same --sura-star-mark token used beside
   admin titles. */
.sura-mark {
  display: inline-block;
  flex: none;
  background-color: currentColor;
  -webkit-mask-image: var(--sura-star-mark);
  mask-image: var(--sura-star-mark);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-position: center;
  mask-position: center;
}

.sura-site-header-context {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.sura-site-header-course {
  display: inline-flex;
  align-items: center;
  background: var(--sura-course-bg);
  color: var(--sura-course-text);
  font-size: var(--text-sm);
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
}

.sura-site-header-course[hidden] {
  display: none;
}

@media (max-width: 640px) {
  .sura-site-header {
    margin: calc(-1 * var(--space-4)) calc(-1 * var(--space-2)) 0;
  }

  .sura-site-header-inner {
    padding: 10px var(--space-4);
  }

  .sura-site-header-course {
    display: none;
  }
}

.sura-site-footer {
  position: relative;
  overflow: hidden;
  margin: var(--space-6) calc(-1 * var(--space-3)) calc(-1 * var(--space-5));
  background: var(--sura-footer-bg);
  color: var(--sura-footer-text);
  direction: rtl;
  text-align: center;
  font-family: var(--sura-font-body);
}

.sura-site-footer::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-color: var(--sura-footer-text);
  opacity: var(--sura-star-opacity);
  -webkit-mask-image: var(--sura-star-mask);
  mask-image: var(--sura-star-mask);
  -webkit-mask-repeat: repeat;
  mask-repeat: repeat;
}

.sura-site-footer-inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 20px 20px;
}

.sura-site-footer-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.sura-site-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--sura-footer-text);
}

.sura-site-footer-brand .sura-mark {
  width: 18px;
  height: 18px;
}

.sura-site-footer-social {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.sura-site-footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(245, 243, 250, 0.28);
  color: var(--sura-footer-text);
  text-decoration: none;
  font-weight: 700;
  font-size: var(--text-md);
  transition: background 0.12s ease, opacity 0.12s ease;
}

.sura-site-footer-social a:hover {
  background: rgba(245, 243, 250, 0.12);
}

.sura-site-footer-copyright {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--sura-footer-text-muted);
}

@media (max-width: 640px) {
  .sura-site-footer {
    margin: var(--space-5) calc(-1 * var(--space-2)) calc(-1 * var(--space-4));
  }

  .sura-site-footer-inner {
    padding: 24px 16px 16px;
  }
}
