/* ═══════════════════════════════════════════════════════════════
   The Legend Edu — مستر وائل عبدالله
   نظام التصميم الأكاديمي (لغة إنجليزية)
   لوحة: Burgundy + Beige — خطوط Cairo + Fraunces
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* ── Burgundy brand ramp (درجة أفتح) ── */
  --brand-950: #5c2230;
  --brand-900: #7a2a3a;
  --brand-800: #933447;
  --brand-700: #a63d52;
  --brand-600: #b85066;
  --brand-500: #c96b7e;
  --brand-400: #d48a97;
  --brand-300: #e5b8c0;
  --brand-100: rgba(147, 52, 71, 0.10);
  --brand-50:  rgba(147, 52, 71, 0.05);

  /* ── Beige accent (بدل الذهب) ── */
  --gold-700: #8a7358;
  --gold-600: #a89174;
  --gold-500: #c4a882;
  --gold-400: #d8c4a8;
  --gold-300: #e8dfd0;
  --gold-soft: rgba(196, 168, 130, 0.18);

  /* ── Accents ── */
  --brand: #933447;
  --accent: #b85066;
  --accent-soft: rgba(147, 52, 71, 0.12);
  --accent-violet: #933447;
  --accent-cyan: #b85066;
  --accent-amber: #c4a882;
  --accent-green: #3d6b4f;
  --accent-gold: #c4a882;

  /* ── Surfaces (Beige) ── */
  --page-bg: #f3ede3;
  --page-bg-alt: #ebe3d4;
  --card-bg: #faf6ef;
  --card: #faf6ef;
  --card-bg-strong: #fffdf9;
  --card-soft: #efe6d8;

  --surface-soft: rgba(147, 52, 71, 0.06);
  --surface-strong: rgba(147, 52, 71, 0.10);
  --surface-highlight: rgba(196, 168, 130, 0.16);
  --surface-highlight-strong: rgba(196, 168, 130, 0.24);

  /* ── Text ── */
  --text: #2a1f1c;
  --text-strong: #1a1210;
  --muted: #7a6a60;
  --muted-strong: #564840;

  /* ── Borders & shadows ── */
  --border: rgba(147, 52, 71, 0.12);
  --border-strong: rgba(147, 52, 71, 0.28);
  --brand-border: var(--border);
  --gold-border: rgba(196, 168, 130, 0.55);
  --shadow: 0 12px 34px rgba(92, 34, 48, 0.12);
  --shadow-soft: 0 4px 16px rgba(92, 34, 48, 0.08);
  --shadow-strong: 0 24px 56px rgba(92, 34, 48, 0.18);
  --shadow-gold: 0 8px 26px rgba(196, 168, 130, 0.28);

  /* ── Primary ── */
  --primary: #933447;
  --primary-strong: #7a2a3a;
  --primary-weak: rgba(147, 52, 71, 0.10);

  /* ── Fields ── */
  --field-bg: #fffdf9;
  --field-text: var(--text);
  --field-border: rgba(147, 52, 71, 0.18);

  /* ── Buttons ── */
  --btn-solid-bg: linear-gradient(135deg, #7a2a3a 0%, #933447 50%, #b85066 100%);
  --btn-solid-text: #faf6ef;
  --btn-gold-bg: linear-gradient(135deg, #c4a882 0%, #d8c4a8 55%, #e8dfd0 100%);
  --btn-gold-text: #5c2230;

  /* ── Status ── */
  --success: #3d6b4f;
  --danger: #c0392b;
  --warning: #b8860b;
  --success-soft-bg: rgba(61, 107, 79, 0.12);
  --success-soft-border: rgba(61, 107, 79, 0.38);
  --danger-soft-bg: rgba(192, 57, 43, 0.12);
  --danger-soft-border: rgba(192, 57, 43, 0.38);
  --warning-soft-bg: rgba(184, 134, 11, 0.14);
  --warning-soft-border: rgba(184, 134, 11, 0.40);

  /* ── Radii ── */
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  /* ── Theme switch ── */
  --sw-bg: #d8c4a8;
  --sw-knob: #faf6ef;

  /* ── Header ── */
  --hdr-bg: linear-gradient(120deg, #5c2230 0%, #7a2a3a 40%, #933447 100%);
  --hdr-text: #faf6ef;
  --hdr-border: rgba(196, 168, 130, 0.38);
  --hdr-fade: transparent;

  /* ── Decorative ── */
  --grid-line: rgba(147, 52, 71, 0.06);
  --page-glow-1: rgba(147, 52, 71, 0.10);
  --page-glow-2: rgba(196, 168, 130, 0.18);

  --grad-brand: linear-gradient(135deg, #7a2a3a, #b85066);
  --grad-gold: linear-gradient(135deg, #c4a882, #e8dfd0);
  --grad-hero: linear-gradient(150deg, #f3ede3 0%, #ebe3d4 55%, #e0d4c2 100%);

  /* ── Fonts ── */
  --font-display: 'Fraunces', 'Cairo', Georgia, serif;
  --font-body: 'Cairo', system-ui, sans-serif;
  --font-calli: 'Fraunces', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  color-scheme: light;

  /* خطوط دفتر أفقية خفيفة */
  --ornament-lines: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cline x1='0' y1='39.5' x2='40' y2='39.5' stroke='%23933447' stroke-opacity='0.05' stroke-width='1'/%3E%3C/svg%3E");
}

html[data-theme="dark"] {
  /* Burgundy أفتح + نصوص أوضح في الوضع الداكن */
  --brand-950: #3a1a22;
  --brand-900: #4f2430;
  --brand-800: #6b3342;
  --brand-700: #c45a6e;
  --brand-600: #d48a97;
  --brand-500: #e2b4bd;
  --brand-400: #f0d4da;
  --brand-300: #f8e8ec;
  --brand-100: rgba(212, 138, 151, 0.18);
  --brand-50:  rgba(212, 138, 151, 0.10);

  --gold-700: #d4bc9a;
  --gold-600: #e2c9a8;
  --gold-500: #edd9bc;
  --gold-400: #f5e8d4;
  --gold-300: #fff4e6;
  --gold-soft: rgba(226, 201, 168, 0.20);

  --brand: #f0d4da;
  --accent: #e2b4bd;
  --accent-soft: rgba(226, 180, 189, 0.20);
  --accent-amber: #f5e8d4;
  --accent-gold: #f5e8d4;

  /* خلفيات أفتح قليلًا لتباين أوضح */
  --page-bg: #1a1416;
  --page-bg-alt: #241c20;
  --card-bg: #2a2226;
  --card: #2a2226;
  --card-bg-strong: #342a30;
  --card-soft: #221c1e;

  --surface-soft: rgba(240, 212, 218, 0.10);
  --surface-strong: rgba(240, 212, 218, 0.16);
  --surface-highlight: rgba(245, 232, 212, 0.14);
  --surface-highlight-strong: rgba(245, 232, 212, 0.22);

  --text: #fff8f0;
  --text-strong: #ffffff;
  --muted: #e0d0c4;
  --muted-strong: #f0e4d8;

  --border: rgba(255, 248, 240, 0.16);
  --border-strong: rgba(240, 212, 218, 0.48);
  --brand-border: var(--border);
  --gold-border: rgba(245, 232, 212, 0.50);
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.40);
  --shadow-soft: 0 4px 16px rgba(0, 0, 0, 0.28);
  --shadow-strong: 0 24px 56px rgba(0, 0, 0, 0.50);
  --shadow-gold: 0 8px 26px rgba(0, 0, 0, 0.35);

  --primary: #f0d4da;
  --primary-strong: #fff0f3;
  --primary-weak: rgba(240, 212, 218, 0.18);

  --success-soft-bg: rgba(90, 150, 110, 0.18);
  --success-soft-border: rgba(120, 180, 140, 0.42);
  --danger-soft-bg: rgba(220, 90, 80, 0.18);
  --danger-soft-border: rgba(220, 90, 80, 0.44);
  --warning-soft-bg: rgba(226, 201, 168, 0.16);
  --warning-soft-border: rgba(226, 201, 168, 0.42);

  --field-bg: #241c20;
  --field-text: #fff8f0;
  --field-border: rgba(255, 248, 240, 0.20);

  --btn-solid-bg: linear-gradient(135deg, #933447 0%, #b85066 55%, #c96b7e 100%);
  --btn-solid-text: #fff8f0;
  --btn-gold-bg: linear-gradient(135deg, #c4a882 0%, #e2c9a8 55%, #f5e8d4 100%);
  --btn-gold-text: #3a1a22;

  --hdr-bg: linear-gradient(120deg, #4f2430 0%, #6b3342 45%, #933447 100%);
  --hdr-text: #fff8f0;
  --hdr-border: rgba(245, 232, 212, 0.36);

  --grid-line: rgba(240, 212, 218, 0.10);
  --page-glow-1: rgba(184, 80, 102, 0.28);
  --page-glow-2: rgba(245, 232, 212, 0.12);
  --grad-brand: linear-gradient(135deg, #b85066, #e2b4bd);
  --grad-gold: linear-gradient(135deg, #c4a882, #f5e8d4);
  --grad-hero: linear-gradient(160deg, #241c20 0%, #1a1416 100%);

  --sw-bg: #4f2430;
  --sw-knob: #f5e8d4;

  --ornament-lines: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cline x1='0' y1='39.5' x2='40' y2='39.5' stroke='%23f0d4da' stroke-opacity='0.10' stroke-width='1'/%3E%3C/svg%3E");

  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--page-bg);
  overflow-x: hidden;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.75;
}

body.legend-platform,
body.arabic-platform {
  position: relative;
  background: var(--page-bg);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.75;
}

/* نصوص أوضح وأكبر في كل صفحات الطلاب */
body.legend-platform p,
body.legend-platform li,
body.legend-platform label,
body.legend-platform span,
body.legend-platform td,
body.legend-platform th,
body.legend-platform input,
body.legend-platform select,
body.legend-platform textarea,
body.legend-platform button,
body.legend-platform a {
  font-weight: inherit;
}

body.legend-platform h1 { font-size: clamp(30px, 4vw, 42px); font-weight: 800; }
body.legend-platform h2 { font-size: clamp(24px, 3vw, 34px); font-weight: 800; }
body.legend-platform h3 { font-size: clamp(20px, 2.4vw, 26px); font-weight: 800; }
body.legend-platform h4,
body.legend-platform h5,
body.legend-platform h6 { font-weight: 800; }

body.legend-platform::before,
body.legend-platform::after,
body.arabic-platform::before,
body.arabic-platform::after {
  content: none;
  display: none;
}

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  letter-spacing: 0;
  line-height: 1.3;
  margin: 0;
  color: var(--text-strong);
  font-weight: 800;
}

a { color: var(--primary); text-decoration: none; }

::selection { background: var(--brand-600); color: #fff; }

.platform-logo__img--light { display: block; }
.platform-logo__img--dark { display: none; }
html[data-theme="dark"] .platform-logo__img--light { display: none; }
html[data-theme="dark"] .platform-logo__img--dark { display: block; }

.lg-ornament-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--brand-600);
  margin: 6px 0 22px;
}
.lg-ornament-divider::before,
.lg-ornament-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  max-width: 120px;
  background: linear-gradient(90deg, transparent, var(--gold-border), transparent);
}
.lg-ornament-divider__mark {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--brand-600);
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* Dark mode — نصوص أوضح في كل صفحات الطلاب */
html[data-theme="dark"] body.legend-platform,
html[data-theme="dark"] body.student-no-header {
  color: #fff8f0;
  font-weight: 700;
}
html[data-theme="dark"] body.legend-platform p,
html[data-theme="dark"] body.legend-platform li,
html[data-theme="dark"] body.legend-platform label,
html[data-theme="dark"] body.legend-platform td,
html[data-theme="dark"] body.legend-platform th,
html[data-theme="dark"] body.legend-platform small,
html[data-theme="dark"] body.legend-platform .muted,
html[data-theme="dark"] body.student-no-header p,
html[data-theme="dark"] body.student-no-header li,
html[data-theme="dark"] body.student-no-header label {
  color: #f0e4d8;
  font-weight: 700;
}
html[data-theme="dark"] body.legend-platform h1,
html[data-theme="dark"] body.legend-platform h2,
html[data-theme="dark"] body.legend-platform h3,
html[data-theme="dark"] body.legend-platform h4,
html[data-theme="dark"] body.student-no-header h1,
html[data-theme="dark"] body.student-no-header h2,
html[data-theme="dark"] body.student-no-header h3 {
  color: #ffffff;
  font-weight: 800;
}
html[data-theme="dark"] body.legend-platform a:not(.lg-btn):not(.acc-btn):not(.acc-btnx):not(.btn) {
  color: #f0d4da;
  font-weight: 800;
}
html[data-theme="dark"] body.legend-platform input,
html[data-theme="dark"] body.legend-platform select,
html[data-theme="dark"] body.legend-platform textarea,
html[data-theme="dark"] body.student-no-header input,
html[data-theme="dark"] body.student-no-header select,
html[data-theme="dark"] body.student-no-header textarea {
  color: #fff8f0;
  font-weight: 700;
}
