@font-face {
  font-family: 'Diodrum';
  src: url('../fonts/Diodrum.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&family=Outfit:wght@400;500;600;700;800;900&family=Inter:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  /* ── Brand Primary Colors (Dark Theme: High-Contrast Royal Sapphire) ── */
  --primary: #2563EB;
  --primary-light: #3B82F6;
  --primary-lighter: #60A5FA;
  --primary-dark: #1D4ED8;
  --primary-rgb: 37, 99, 235;
  --primary-glow: rgba(37, 99, 235, 0.35);

  /* ── Brand Accents & Status Colors ── */
  --green: #10B981;
  --green-light: #34D399;
  --green-dark: #059669;
  --green-rgb: 16, 185, 129;
  --green-glow: rgba(16, 185, 129, 0.25);
  --success: #10B981;
  --success-light: #34D399;

  --accent: #F59E0B;
  --accent-light: #FBBF24;
  --accent-dark: #D97706;
  --gold: #F59E0B;
  --gold-glow: rgba(245, 158, 11, 0.25);
  --gold-gradient: linear-gradient(135deg, #FBBF24 0%, #F59E0B 50%, #D97706 100%);
  --brand-gradient: linear-gradient(135deg, #1D4ED8 0%, #2563EB 50%, #3B82F6 100%);
  --brand-gradient-2: linear-gradient(135deg, #F59E0B 0%, #10B981 100%);
  --brand-glow: 0 0 24px rgba(37, 99, 235, 0.35);

  --danger: #EF4444;
  --danger-light: #F87171;
  --warning: #F59E0B;
  --warning-light: #FBBF24;
  --info: #0EA5E9;
  --info-light: #38BDF8;

  /* ── High-Contrast Typography System (Dark Theme: Pure Crisp Radiance) ── */
  --text: #F8FAFC;
  --text-main: #FFFFFF;
  --text-secondary: #E2E8F0;
  --text-muted: #94A3B8;
  --text-dark: #020617;
  --sidebar-active-text: #FFFFFF;

  /* ── Dark Theme Surfaces (Deep Obsidian Glass with Atmospheric Depth) ── */
  --bg-dark: #060A14;
  --bg-body: #060A14;
  --bg-card: rgba(13, 20, 36, 0.82);
  --bg-card-hover: rgba(20, 31, 56, 0.92);
  --bg-card-elevated: #0F1A30;
  --bg-input: rgba(13, 20, 36, 0.85);
  --bg-sidebar: #090E1C;
  --bg-sidebar-glass: rgba(9, 14, 28, 0.94);
  --bg-header: rgba(9, 14, 28, 0.88);
  --bg-secondary: #0D1629;
  --border: rgba(255, 255, 255, 0.09);
  --border-light: rgba(59, 130, 246, 0.28);
  --border-hover: rgba(255, 255, 255, 0.22);
  --border-gold: rgba(245, 158, 11, 0.35);
  --border-sidebar: rgba(255, 255, 255, 0.08);
  --border-glass: rgba(255, 255, 255, 0.10);
  --shadow: rgba(0, 0, 0, 0.55);
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --shadow-elevated: 0 16px 36px -4px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  --shadow-lotus: 0 8px 30px rgba(37, 99, 235, 0.25);
  --mat-color: #2563EB;

  /* ── Dynamic Greetings Tokens (Dark Theme) ── */
  --greeting-amber: #FBBF24;
  --greeting-purple: #A78BFA;
  --greeting-admin-grad: linear-gradient(135deg, #60A5FA 0%, #38BDF8 100%);
  --greeting-teacher-grad: linear-gradient(135deg, #2DD4BF 0%, #60A5FA 100%);
  --greeting-student-grad: linear-gradient(135deg, #34D399 0%, #60A5FA 100%);

  /* ── Spacing Tokens ── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* ── Typography Scale & Line Heights ── */
  --text-2xs: 0.75rem;    /* 12px */
  --text-xs: 0.8125rem;   /* 13px */
  --text-sm: 0.875rem;    /* 14px */
  --text-base: 0.9375rem; /* 15px */
  --text-md: 1rem;        /* 16px */
  --text-lg: 1.125rem;    /* 18px */
  --text-xl: 1.25rem;     /* 20px */
  --text-2xl: 1.5rem;     /* 24px */
  --text-3xl: 1.875rem;   /* 30px */

  --leading-none: 1;
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 2;

  /* ── Shapes & Animations ── */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 9999px;
  --transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --sidebar-width: 272px;
  --sidebar-collapsed: 70px;
  --topbar-height: 64px;
  --h-input: 44px;
  --h-btn: 44px;
  --h-btn-sm: 36px;
  --h-btn-lg: 50px;

  /* ── Typography Fonts ── */
  --font-primary: 'Cairo', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', 'Cairo', sans-serif;
  --font-mono: 'IBM Plex Mono', 'JetBrains Mono', monospace;
}

body.theme-light {
  /* ── Brand Primary Colors (Light Theme: Alpine Sapphire & Royal Porcelain) ── */
  --primary: #1D4ED8;
  --primary-light: #2563EB;
  --primary-lighter: #3B82F6;
  --primary-dark: #1E40AF;
  --primary-rgb: 29, 78, 216;
  --primary-glow: rgba(29, 78, 216, 0.16);

  --accent: #B45309;
  --accent-light: #D97706;
  --accent-dark: #92400E;
  --gold: #B45309;
  --gold-glow: rgba(217, 119, 6, 0.18);
  --gold-gradient: linear-gradient(135deg, #D97706 0%, #B45309 100%);
  --brand-gradient: linear-gradient(135deg, #1E40AF 0%, #2563EB 55%, #3B82F6 100%);
  --brand-gradient-2: linear-gradient(135deg, #1E40AF 0%, #059669 100%);
  --brand-glow: 0 4px 16px rgba(29, 78, 216, 0.15);

  --green: #059669;
  --green-light: #10B981;
  --green-dark: #047857;
  --success: #059669;
  --success-light: #10B981;

  --danger: #DC2626;
  --danger-light: #EF4444;
  --warning: #D97706;
  --warning-light: #F59E0B;
  --info: #0284C7;
  --info-light: #0EA5E9;

  /* ── High-Contrast Light Theme Typography (Ultra-sharp WCAG AAA) ── */
  --text: #0F172A;
  --text-main: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --text-dark: #020617;
  --sidebar-active-text: #1D4ED8;

  /* ── Light Theme Surfaces & Porcelain Glass ── */
  --bg-dark: #F1F5F9;
  --bg-body: #F6F8FC;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8FAFD;
  --bg-card-elevated: #FFFFFF;
  --bg-input: #FFFFFF;
  --bg-sidebar: #FFFFFF;
  --bg-sidebar-glass: rgba(255, 255, 255, 0.96);
  --bg-header: rgba(255, 255, 255, 0.94);
  --bg-secondary: #F1F5F9;
  --border: #E2E8F0;
  --border-light: rgba(29, 78, 216, 0.12);
  --border-hover: #CBD5E1;
  --border-gold: rgba(217, 119, 6, 0.35);
  --border-sidebar: #E2E8F0;
  --border-glass: #E2E8F0;
  --shadow: rgba(15, 23, 42, 0.06);
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.03), 0 4px 14px -2px rgba(15, 23, 42, 0.05);
  --shadow-elevated: 0 12px 28px -4px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.03);
  --shadow-lotus: 0 8px 24px rgba(29, 78, 216, 0.10);
  --mat-color: #1D4ED8;

  /* ── Dynamic Greetings Tokens (Light Theme: High Contrast) ── */
  --greeting-amber: #B45309;
  --greeting-purple: #6D28D9;
  --greeting-admin-grad: linear-gradient(135deg, #1E40AF 0%, #2563EB 100%);
  --greeting-teacher-grad: linear-gradient(135deg, #0F766E 0%, #2563EB 100%);
  --greeting-student-grad: linear-gradient(135deg, #047857 0%, #1D4ED8 100%);
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-body);
  color: var(--text-main);
  direction: rtl;
  min-height: 100vh;
  line-height: var(--leading-relaxed);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
  font-size: var(--text-base);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  color: var(--text-main);
  font-weight: 700;
  line-height: var(--leading-snug);
  margin-bottom: var(--space-2);
}

.mono {
  font-family: var(--font-mono);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-light);
}

img {
  max-width: 100%;
  height: auto;
}

::selection {
  background: var(--accent);
  color: var(--primary-dark);
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

.table-container {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow-x: auto;
  margin-bottom: 24px;
}

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-light);
}

.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;
}

/* --------------------------------------------------
   Premium Login Page Styles — Synthwave Perspective Grid
   --------------------------------------------------
   Background is rendered on <canvas id="bgCanvas"> (see index.html).
   The wrapper is transparent so the canvas shows through.
   Synthwave.show() / hide() control canvas visibility. */

@keyframes gridDriftUp {
  0%   { background-position: 0 0; }
  100% { background-position: 0 -120px; }
}

/* --------------------------------------------------
   Premium Luxury School ERP Login Page Styles
   Brand DNA: 70% Royal Navy | 20% Emerald Green | 10% Radiant Gold
   Contrast: #F8FAFC text, #CBD5E1 secondary, #94A3B8 muted
   -------------------------------------------------- */

.login-page-wrapper {
  --text-main: #F8FAFC !important;
  --text-secondary: #CBD5E1 !important;
  --text-muted: #94A3B8 !important;
  color: var(--text-main);
  min-height: 100vh;
  width: 100vw;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 24px;
  /* User Feedback #5: Seamless transition without harsh split */
  background:
    radial-gradient(circle at 75% 35%, rgba(var(--primary-rgb), 0.55) 0%, transparent 45%),
    radial-gradient(circle at 20% 70%, rgba(16, 185, 129, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 50% 15%, rgba(245, 158, 11, 0.08) 0%, transparent 35%),
    linear-gradient(90deg, #11141D 0%, #0B1020 50%, #070B16 100%);
}

/* Subtle Animated Ambient Aurora Glow */
.login-page-wrapper::before {
  content: '';
  position: absolute;
  top: -40%;
  left: -40%;
  width: 180%;
  height: 180%;
  background:
    radial-gradient(ellipse at 30% 60%, rgba(var(--primary-rgb), 0.35) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 30%, rgba(16, 185, 129, 0.08) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 50%, rgba(245, 158, 11, 0.05) 0%, transparent 50%);
  animation: auroraSpin 32s linear infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes auroraSpin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.login-grid-lines,
.grid-line,
.bg-orb {
  display: none !important;
}

/* User Feedback #5 & #6: Unified Luxury Midnight Container with Seamless Glassmorphism */
.login-container {
  display: flex;
  flex-direction: row;
  width: 100%;
  max-width: 1060px;
  background: linear-gradient(
    135deg,
    rgba(14, 22, 40, 0.90) 0%,
    rgba(10, 16, 30, 0.85) 50%,
    rgba(8, 13, 24, 0.94) 100%
  );
  backdrop-filter: blur(36px);
  -webkit-backdrop-filter: blur(36px);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-top: 1px solid rgba(245, 158, 11, 0.38); /* Jewelry gold hairline on top */
  border-bottom: 1px solid rgba(16, 185, 129, 0.30); /* Emerald accent on bottom */
  border-radius: 24px;
  box-shadow: 
    0 32px 80px -12px rgba(0, 0, 0, 0.80),
    0 0 55px -12px rgba(var(--primary-rgb), 0.50),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  z-index: 1;
  overflow: hidden;
  position: relative;
  margin: auto;
}

/* User Feedback #6: Huge Watermark Emblem in Background with Subtle Opacity */
.login-container::after {
  content: '';
  position: absolute;
  bottom: -90px;
  left: -90px;
  width: 460px;
  height: 460px;
  background-image: url('../img/brand-logo-2026.png');
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.045;
  pointer-events: none;
  z-index: 0;
  transform: rotate(-10deg);
}

[dir="rtl"] .login-container::after {
  left: auto;
  right: -90px;
  transform: rotate(10deg);
}

/* ═══════════════════════════════════════════════════════
   PREMIUM MOVABLE FLOATING TOP CONTROLS (LANGUAGE & CELESTIAL THEME)
   ═══════════════════════════════════════════════════════ */
.login-top-bar {
  position: fixed;
  top: 18px;
  right: 24px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(14, 22, 40, 0.90);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 5px 10px;
  border-radius: 40px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 
    0 12px 36px rgba(0, 0, 0, 0.50),
    0 0 24px rgba(37, 99, 235, 0.20),
    inset 0 1px 1px rgba(255, 255, 255, 0.15);
  z-index: 1000;
  direction: ltr; /* Keeps buttons in clean logical flow */
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

[dir="rtl"] .login-top-bar {
  right: 24px;
  left: auto;
}

[dir="ltr"] .login-top-bar {
  right: 24px;
  left: auto;
}

.login-top-bar.is-dragging {
  cursor: grabbing !important;
  transform: scale(1.04);
  box-shadow: 
    0 22px 55px rgba(0, 0, 0, 0.70),
    0 0 35px rgba(37, 99, 235, 0.45);
  transition: none !important;
}

.login-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  color: #94A3B8;
  font-size: 1.1rem;
  padding: 2px 4px;
  border-radius: 6px;
  transition: all 0.2s ease;
  user-select: none;
}

.login-drag-handle:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.14);
}

.login-top-bar.is-dragging .login-drag-handle {
  cursor: grabbing !important;
  color: #60A5FA;
}

body.theme-light .login-drag-handle {
  color: #64748B;
}

body.theme-light .login-drag-handle:hover {
  color: #0F172A;
  background: rgba(15, 23, 42, 0.08);
}

body.theme-light .login-top-bar {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(203, 213, 225, 0.92);
  box-shadow: 
    0 12px 30px rgba(15, 23, 42, 0.12),
    0 0 20px rgba(37, 99, 235, 0.08),
    inset 0 1px 0 #FFFFFF;
}

/* ── Language Dock & Color Palettes ── */
.login-lang-dock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.25);
  padding: 3px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body.theme-light .login-lang-dock {
  background: rgba(241, 245, 249, 0.90);
  border-color: rgba(226, 232, 240, 0.95);
}

.lang-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid transparent;
  background: transparent;
  padding: 6px 14px;
  border-radius: 24px;
  font-family: var(--font-primary);
  font-size: 0.85rem;
  font-weight: 700;
  color: #E2E8F0; /* High-contrast crisp white/silver in dark mode */
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  user-select: none;
  position: relative;
  letter-spacing: 0.01em;
}

body.theme-light .lang-pill-btn {
  color: #334155; /* High-contrast deep slate in light mode */
}

.lang-pill-btn .lang-flag-badge {
  font-size: 1.05rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
  transition: transform 0.3s ease;
}

.lang-pill-btn:hover .lang-flag-badge {
  transform: scale(1.18) rotate(3deg);
}

.lang-pill-btn:hover {
  color: #FFFFFF !important;
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

body.theme-light .lang-pill-btn:hover {
  color: #0F172A !important;
  background: rgba(15, 23, 42, 0.06);
}

/* ✦ Language: العربية (Arabic) Active State ✦ */
/* Algerian Emerald & Vibrant Cyan-Teal Jewel Tone */
.lang-pill-btn.lang-ar.active {
  background: linear-gradient(135deg, #059669 0%, #10B981 48%, #0284C7 100%) !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(110, 231, 183, 0.65) !important;
  box-shadow: 
    0 4px 18px rgba(16, 185, 129, 0.50),
    0 0 12px rgba(5, 150, 105, 0.35),
    inset 0 1px 1px rgba(255, 255, 255, 0.60) !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.40);
  transform: scale(1.03);
  font-weight: 800;
}

/* ✦ Language: Français (French) Active State ✦ */
/* Royal Electric Sapphire & Lavender Indigo Jewel Tone */
.lang-pill-btn.lang-fr.active {
  background: linear-gradient(135deg, #2563EB 0%, #3B82F6 45%, #6366F1 100%) !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(191, 219, 254, 0.65) !important;
  box-shadow: 
    0 4px 18px rgba(37, 99, 235, 0.50),
    0 0 12px rgba(99, 102, 241, 0.35),
    inset 0 1px 1px rgba(255, 255, 255, 0.60) !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.40);
  transform: scale(1.03);
  font-weight: 800;
}

/* Divider */
.login-controls-divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.18);
  margin: 0 2px;
}

body.theme-light .login-controls-divider {
  background: rgba(203, 213, 225, 0.90);
}

/* ═══════════════════════════════════════════════════════
   CELESTIAL DAY / NIGHT THEME TOGGLE (Really Cool Design!)
   ═══════════════════════════════════════════════════════ */
.login-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 2px 4px;
  cursor: pointer;
  border-radius: 30px;
  outline: none;
  user-select: none;
  transition: transform 0.25s ease;
}

.login-theme-toggle:hover {
  transform: scale(1.04);
}

.login-theme-toggle:active {
  transform: scale(0.96);
}

/* The Sliding Celestial Capsule Track */
.theme-toggle-track {
  position: relative;
  width: 66px;
  height: 32px;
  border-radius: 30px;
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-sizing: border-box;
}

/* Dark Mode Track State */
.login-theme-toggle.is-dark .theme-toggle-track {
  background: linear-gradient(135deg, #090E1A 0%, #171F38 55%, #1E1B4B 100%);
  border: 1.5px solid rgba(129, 140, 248, 0.40);
  box-shadow: 
    inset 0 2px 6px rgba(0, 0, 0, 0.70),
    0 0 14px rgba(99, 102, 241, 0.30);
}

/* Light Mode Track State */
.login-theme-toggle.is-light .theme-toggle-track {
  background: linear-gradient(135deg, #38BDF8 0%, #60A5FA 50%, #93C5FD 100%);
  border: 1.5px solid rgba(251, 191, 36, 0.75);
  box-shadow: 
    inset 0 2px 6px rgba(14, 165, 233, 0.35),
    0 0 16px rgba(245, 158, 11, 0.40);
}

/* Celestial Background: Twinkling Stars & Daylight Clouds */
.theme-celestial-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: all 0.4s ease;
}

.theme-star {
  position: absolute;
  color: #FEF08A;
  font-size: 9px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
  filter: drop-shadow(0 0 4px #FBBF24);
}

.login-theme-toggle.is-dark .theme-star {
  opacity: 1;
}

.star-1 {
  top: 6px;
  right: 12px;
  animation: starPulse 2.8s infinite ease-in-out;
}

.star-2 {
  bottom: 6px;
  right: 22px;
  font-size: 8px;
  animation: starPulse 2.2s infinite ease-in-out 0.8s;
}

.star-3 {
  top: 14px;
  right: 7px;
  font-size: 11px;
  animation: starPulse 3.2s infinite ease-in-out 1.4s;
}

@keyframes starPulse {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.25); }
}

/* Daylight Clouds */
.theme-cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 10px;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.login-theme-toggle.is-light .theme-cloud {
  opacity: 1;
}

.cloud-1 {
  width: 14px;
  height: 6px;
  top: 7px;
  left: 9px;
  border-radius: 6px;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

.cloud-2 {
  width: 10px;
  height: 5px;
  bottom: 7px;
  left: 17px;
  border-radius: 5px;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
}

/* The Animated Sliding Orb: Moon & Sun */
.theme-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-theme-toggle.is-dark .theme-toggle-thumb {
  transform: translateX(0);
}

.login-theme-toggle.is-light .theme-toggle-thumb {
  transform: translateX(34px);
}

/* 🌙 Lunar Body */
.thumb-moon {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #F1F5F9;
  box-shadow: 
    0 0 12px rgba(224, 231, 255, 0.95),
    inset -2px -2px 3px #94A3B8,
    inset 1px 1px 2px #FFFFFF;
  transition: opacity 0.35s ease, transform 0.45s ease;
  overflow: hidden;
}

.login-theme-toggle.is-dark .thumb-moon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.login-theme-toggle.is-light .thumb-moon {
  opacity: 0;
  transform: scale(0.3) rotate(-90deg);
}

.thumb-moon .crater {
  position: absolute;
  border-radius: 50%;
  background: #CBD5E1;
  box-shadow: inset 1px 1px 1px #94A3B8;
}

.thumb-moon .c1 {
  width: 5px;
  height: 5px;
  top: 5px;
  left: 5px;
}

.thumb-moon .c2 {
  width: 4px;
  height: 4px;
  bottom: 5px;
  right: 6px;
}

/* ☀️ Solar Body */
.thumb-sun {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  transition: opacity 0.35s ease, transform 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-theme-toggle.is-light .thumb-sun {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.login-theme-toggle.is-dark .thumb-sun {
  opacity: 0;
  transform: scale(0.3) rotate(90deg);
}

.sun-core {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FDE047 0%, #F59E0B 100%);
  box-shadow: 
    0 0 16px rgba(245, 158, 11, 0.95),
    inset 1px 1px 2px #FEF08A;
  z-index: 2;
}

.sun-rays-spinner {
  position: absolute;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.4) 0%, transparent 70%);
  animation: sunRaysSpin 10s linear infinite;
  z-index: 1;
}

@keyframes sunRaysSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Mode Label */
.theme-toggle-label {
  font-family: var(--font-primary);
  font-size: 0.80rem;
  font-weight: 800;
  color: #CBD5E1;
  letter-spacing: 0.02em;
  transition: color 0.3s ease;
  user-select: none;
}

body.theme-light .theme-toggle-label {
  color: #1E293B;
}

/* ═══════════════════════════════════════════════════════
   LIGHT THEME OVERHAUL FOR LOGIN SCREEN (Stunning Harmony!)
   ═══════════════════════════════════════════════════════ */
.login-page-wrapper {
  transition: background 0.4s ease, color 0.4s ease;
}

body.theme-light .login-page-wrapper {
  --text-main: #0F172A !important;
  --text-secondary: #334155 !important;
  --text-muted: #64748B !important;
  background:
    radial-gradient(circle at 80% 25%, rgba(37, 99, 235, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 15% 75%, rgba(16, 185, 129, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 50% 10%, rgba(245, 158, 11, 0.06) 0%, transparent 35%),
    linear-gradient(135deg, #F8FAFC 0%, #EEF2F9 50%, #E2E8F0 100%) !important;
}

body.theme-light .login-container {
  background: rgba(255, 255, 255, 0.94) !important;
  border: 1px solid rgba(226, 232, 240, 0.95) !important;
  border-top: 2px solid rgba(217, 119, 6, 0.60) !important;
  border-bottom: 2px solid rgba(16, 185, 129, 0.55) !important;
  box-shadow: 
    0 25px 65px -12px rgba(15, 23, 42, 0.12),
    0 0 40px -10px rgba(37, 99, 235, 0.10),
    inset 0 1px 0 #FFFFFF !important;
}

body.theme-light .login-brand-side {
  background: linear-gradient(
    145deg,
    #1E3A8A 0%,
    #1D4ED8 55%,
    #0F172A 100%
  ) !important;
  border-inline-end: 1px solid rgba(255, 255, 255, 0.12) !important;
}

body.theme-light .login-form-side {
  background: #FFFFFF !important;
}

body.theme-light .form-header h2 {
  color: #0F172A !important;
  text-shadow: none !important;
}

body.theme-light .form-header p {
  color: #64748B !important;
}

body.theme-light .role-card-modern {
  background: #F8FAFD !important;
  border: 1.5px solid #E2E8F0 !important;
}

body.theme-light .role-card-modern:hover {
  background: #EFF6FF !important;
  border-color: #3B82F6 !important;
}

body.theme-light .role-card-modern.active {
  background: linear-gradient(145deg, #1D4ED8 0%, #1E40AF 100%) !important;
  border-color: #D97706 !important;
  box-shadow: 0 4px 18px rgba(29, 78, 216, 0.30) !important;
}

body.theme-light .role-card-modern .role-name {
  color: #475569 !important;
}

body.theme-light .role-card-modern.active .role-name {
  color: #FFFFFF !important;
}

body.theme-light .form-group-modern label {
  color: #334155 !important;
}

body.theme-light .input-with-icon input {
  background: #F8FAFC !important;
  border-color: #CBD5E1 !important;
  color: #0F172A !important;
}

body.theme-light .input-with-icon input:focus {
  background: #FFFFFF !important;
  border-color: #2563EB !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

body.theme-light .input-with-icon .input-icon {
  color: #64748B !important;
}

body.theme-light .forgot-password-link a {
  color: #2563EB !important;
}

body.theme-light .forgot-password-link a:hover {
  color: #1D4ED8 !important;
}

body.theme-light .login-signup-section {
  background: #F8FAFC !important;
  border-color: #E2E8F0 !important;
}

body.theme-light .signup-prompt-text {
  color: #64748B !important;
}

body.theme-light .signup-admin-note {
  color: #475569 !important;
}


/* ═══════════════════════════════════════════════════════
   BRAND SIDE — Seamless Luxury Academic Presentation
   ═══════════════════════════════════════════════════════ */
.login-brand-side {
  flex: 1.15;
  padding: 38px 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 2;
  background: linear-gradient(
    145deg,
    rgba(var(--primary-rgb), 0.28) 0%,
    rgba(6, 15, 34, 0.12) 100%
  );
  border-inline-end: 1px solid rgba(255, 255, 255, 0.05); /* Extremely soft ambient separator */
}

.brand-content {
  position: relative;
  z-index: 2;
}

/* User Feedback #2 & #8: Large Emblem (120px) WITHOUT white box, Organic Glow */
.brand-logo-wrap {
  width: 120px;
  height: 120px;
  margin-bottom: 16px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo-wrap::before {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(var(--primary-rgb), 0.50) 0%,
    rgba(16, 185, 129, 0.20) 45%,
    rgba(245, 158, 11, 0.12) 70%,
    transparent 85%
  );
  filter: blur(12px);
  z-index: 0;
  animation: logoPulse 4s ease-in-out infinite alternate;
}

@keyframes logoPulse {
  0%   { transform: scale(0.96); opacity: 0.75; }
  100% { transform: scale(1.08); opacity: 1; }
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: relative;
  z-index: 1;
  filter: 
    drop-shadow(0 14px 28px rgba(0, 0, 0, 0.65))
    drop-shadow(0 0 16px rgba(16, 185, 129, 0.25));
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand-logo:hover {
  transform: scale(1.06) rotate(1deg);
}

/* User Feedback #1: Crisp High-Contrast Typography */
.brand-title {
  font-family: var(--font-heading);
  font-size: 2.35rem;
  font-weight: 800;
  margin-bottom: 2px;
  letter-spacing: -0.02em;
  color: #F8FAFC !important; /* Crisp White! */
  line-height: 1.15;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
}

/* User Feedback #4: Jewelry Gold Tagline */
.brand-tagline {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.22em;
  margin-bottom: 10px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* User Feedback #3: Oasis Green Motto Badge */
.brand-motto {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.32);
  border-radius: 20px;
  color: var(--green-light);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.motto-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0%   { transform: scale(0.9); opacity: 0.7; }
  50%  { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

/* User Feedback #1: Clear Readable Subtitle */
.brand-subtitle {
  font-size: 0.92rem;
  font-weight: 500;
  color: #CBD5E1 !important; /* High-contrast light slate */
  margin-bottom: 20px;
  line-height: 1.5;
}

/* User Feedback #3: 20% Emerald Green DNA in Feature Pills */
.brand-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  transition: all var(--transition);
}

.feature-item:hover {
  background: rgba(var(--primary-rgb), 0.40);
  border-color: rgba(16, 185, 129, 0.40);
  transform: translateX(4px);
}

body.lang-fr .feature-item:hover {
  transform: translateX(-4px);
}

.feature-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(16, 185, 129, 0.16); /* Oasis Green */
  border: 1px solid rgba(16, 185, 129, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green-light);
  flex-shrink: 0;
  font-size: 1.1rem;
}

.feature-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.feature-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: #F8FAFC !important; /* High Contrast Crisp White */
}

.feature-desc {
  font-size: 0.74rem;
  color: #CBD5E1 !important; /* Highly readable secondary */
}

/* ═══════════════════════════════════════════════════════
   FORM SIDE — Ultra High-Contrast, Clean & Tactile
   ═══════════════════════════════════════════════════════ */
.login-form-side {
  flex: 1;
  padding: 38px 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.form-wrapper {
  max-width: 400px;
  width: 100%;
  margin: 0 auto;
}

.form-header {
  margin-bottom: 20px;
}

/* User Feedback #1: High Contrast Heading & Subtitle */
.form-header h2 {
  font-family: var(--font-heading);
  font-size: 1.95rem;
  color: #F8FAFC !important; /* Crisp White! */
  margin-bottom: 4px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.form-header p {
  color: #CBD5E1 !important; /* High contrast secondary */
  font-size: 0.88rem;
  line-height: 1.45;
}

/* User Feedback #7: Tactile, Clearly Clickable Role Cards */
.role-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.role-card-modern {
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  user-select: none;
}

.role-card-modern:hover {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.45); /* Emerald Green hover hint */
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.40);
}

/* User Feedback #7: Specific Active State Formula with Jewelry Gold */
.role-card-modern.active {
  background: linear-gradient(145deg, rgba(var(--primary-rgb), 0.75) 0%, rgba(11, 28, 64, 0.85) 100%);
  border: 1.5px solid rgba(197, 170, 77, 0.70); /* Jewelry Gold Border */
  box-shadow:
    0 0 20px rgba(197, 170, 77, 0.18),
    0 8px 24px rgba(0, 0, 0, 0.45);
  transform: translateY(-2px);
}

.role-card-modern .role-icon {
  font-size: 1.5rem;
  color: var(--text-muted); /* #94A3B8 */
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.role-card-modern .role-icon svg {
  width: 24px;
  height: 24px;
}

.role-card-modern:hover .role-icon {
  color: #34D399;
  transform: scale(1.06);
}

.role-card-modern.active .role-icon {
  color: var(--accent-light); /* #FBBF24 Radiant Jewelry Gold */
  transform: scale(1.12);
  filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.50));
}

.role-card-modern .role-name {
  font-weight: 700;
  font-size: 0.84rem;
  color: #CBD5E1 !important; /* High-contrast secondary */
  transition: color var(--transition);
}

.role-card-modern.active .role-name {
  color: #F8FAFC !important; /* Crisp White! */
  font-weight: 800;
}

/* Form Visibility Animation */
.hidden-form { display: none; }

.show-form {
  display: block;
  animation: slideUpFade 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpFade {
  0%   { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* User Feedback #1: High Contrast Inputs & Labels */
.form-group-modern {
  margin-bottom: 18px;
}

.form-group-modern label {
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  color: #CBD5E1 !important; /* High contrast secondary */
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.input-with-icon {
  position: relative;
}

.input-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94A3B8; /* #94A3B8 */
  font-size: 1.1rem;
  pointer-events: none;
  transition: color 0.2s ease;
}

body.lang-fr .input-icon {
  right: auto;
  left: 14px;
}

.input-with-icon input {
  width: 100%;
  padding: 14px 44px;
  background: rgba(10, 16, 30, 0.85) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: #F8FAFC !important; /* #F8FAFC Crisp White! */
  transition: all var(--transition);
}

/* User Feedback #1: Placeholder never less than #94A3B8 */
.input-with-icon input::placeholder {
  color: #94A3B8 !important; /* #94A3B8 */
  opacity: 1 !important;
  font-weight: 400;
}

.input-with-icon input:focus {
  outline: none;
  background: rgba(14, 23, 44, 0.95) !important;
  border-color: rgba(16, 185, 129, 0.65) !important; /* Emerald focus ring */
  box-shadow: 
    0 0 0 3px rgba(16, 185, 129, 0.20),
    0 0 20px rgba(16, 185, 129, 0.15);
}

.input-with-icon:focus-within .input-icon {
  color: #34D399;
}

.password-toggle {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #94A3B8; /* #94A3B8 */
  cursor: pointer;
  padding: 6px;
  font-size: 1rem;
  transition: color 0.2s ease;
}

body.lang-fr .password-toggle {
  left: auto;
  right: 14px;
}

.password-toggle:hover {
  color: #F8FAFC !important;
}

.forgot-password-link {
  margin-bottom: 22px;
  text-align: left;
}

[dir="rtl"] .forgot-password-link {
  text-align: right;
}

.forgot-password-link a {
  color: #94A3B8 !important; /* #94A3B8 */
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}

.forgot-password-link a:hover {
  color: var(--accent-light) !important;
  text-decoration: underline;
}

/* User Feedback #3: 70% Navy Button with Jewelry Gold Trim & Sheen */
.btn-login-submit {
  width: 100%;
  padding: 15px;
  background: var(--brand-gradient);
  color: #FFFFFF !important;
  border: 1.5px solid rgba(245, 158, 11, 0.40); /* Jewelry Gold hairline */
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all var(--transition);
  box-shadow: 
    0 10px 26px rgba(var(--primary-rgb), 0.50),
    inset 0 1px 0 rgba(255, 255, 255, 0.20);
  position: relative;
  overflow: hidden;
}

.btn-login-submit:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.75);
  box-shadow: 
    0 14px 34px rgba(var(--primary-rgb), 0.65),
    0 0 24px rgba(245, 158, 11, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.30);
}

.btn-login-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-login-submit .arrow-icon {
  font-size: 1.15rem;
  transition: transform 0.25s ease;
  color: var(--accent-light);
}

.btn-login-submit:hover .arrow-icon {
  transform: translateX(-4px);
}

body.lang-fr .btn-login-submit:hover .arrow-icon {
  transform: translateX(4px);
}

/* Student Account Signup Section */
.login-signup-section {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.signup-prompt-text {
  font-size: 0.86rem;
  color: #CBD5E1 !important;
  margin-bottom: 12px;
  font-weight: 500;
}

.btn-signup {
  width: 100%;
  padding: 13px 20px;
  background: rgba(16, 185, 129, 0.10);
  border: 1.5px solid rgba(16, 185, 129, 0.38);
  border-radius: 12px;
  color: #34D399 !important;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.btn-signup svg {
  width: 20px;
  height: 20px;
}

.btn-signup:hover {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(16, 185, 129, 0.70);
  color: #F8FAFC !important;
  transform: translateY(-2px);
  box-shadow:
    0 8px 24px rgba(16, 185, 129, 0.30),
    0 0 15px rgba(16, 185, 129, 0.20);
}

.btn-signup:active {
  transform: translateY(0);
}

.signup-admin-note {
  font-size: 0.78rem;
  color: #94A3B8 !important;
  margin-top: 12px;
  line-height: 1.4;
  opacity: 0.9;
}

.login-error-msg {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #F87171;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
}

@media (max-width: 900px) {
  .login-container {
    flex-direction: column;
    max-width: 480px;
  }
  .login-brand-side {
    padding: 36px 24px;
    align-items: center;
    text-align: center;
    border-inline-end: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
  .brand-features {
    display: none !important;
  }
  .login-form-side {
    padding: 36px 24px;
  }
}

/* =====================================================
   NEW LUXURY SIGNUP MODAL / CARD DESIGN
   ===================================================== */
.signup-card-modal {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.signup-header-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(11, 60, 124, 0.12) 0%, rgba(10, 10, 18, 0.6) 100%);
  border: 1px solid rgba(11, 60, 124, 0.28);
  border-radius: 16px;
}

.signup-header-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--brand-gradient);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  box-shadow: 0 4px 18px rgba(11, 60, 124, 0.35);
}

.signup-header-text h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 2px;
}

.signup-header-text p {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin: 0;
}

.role-select-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.role-select-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(22, 24, 32, 0.75);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
}

.role-select-card:hover {
  background: rgba(11, 60, 124, 0.08);
  border-color: rgba(11, 60, 124, 0.28);
}

.role-select-card.active {
  background: linear-gradient(135deg, rgba(11, 60, 124, 0.18), rgba(16, 16, 28, 0.85));
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(11, 60, 124, 0.2);
}

.role-card-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-muted);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.role-select-card.active .role-card-badge {
  background: var(--brand-gradient);
  color: #ffffff;
  font-weight: bold;
}

.role-card-info {
  display: flex;
  flex-direction: column;
}

.role-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.role-card-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.form-section-box {
  background: rgba(14, 14, 22, 0.65);
  border: 1px solid rgba(11, 60, 124, 0.18);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-section-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-light);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  border-bottom: 1px dashed rgba(11, 60, 124, 0.2);
  padding-bottom: 8px;
}

.form-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 640px) {
  .form-grid-2col, .role-select-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------
   Matrix Table Styles — Enhanced
   -------------------------------------------------- */

.matrix-table th {
  white-space: normal;
  word-break: break-word;
  font-size: var(--text-sm);
  text-transform: none;
}

.matrix-square {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: white;
  margin: 0 auto;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  position: relative;
}

.matrix-square:hover {
  transform: scale(1.15);
  filter: brightness(1.2);
  z-index: 2;
}

.matrix-square.empty {
  background: rgba(38, 41, 54, 0.5);
  border: 1px dashed rgba(212, 175, 55, 0.3);
  color: transparent;
}

.matrix-square.empty:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: rgba(212, 175, 55, 0.5);
}

/* Attendance statuses */
.matrix-square.present {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  box-shadow: 0 2px 8px rgba(39, 174, 96, 0.4);
}

.matrix-square.absent {
  background: linear-gradient(135deg, #c0392b, #e74c3c);
  box-shadow: 0 2px 8px rgba(231, 76, 60, 0.4);
}

.matrix-square.late {
  background: linear-gradient(135deg, #d68910, #f39c12);
  box-shadow: 0 2px 8px rgba(243, 156, 18, 0.4);
}

.matrix-square.excused {
  background: linear-gradient(135deg, #1a6f9c, #3498db);
  box-shadow: 0 2px 8px rgba(52, 152, 219, 0.4);
}

/* Payment statuses */
.matrix-square.paid {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  box-shadow: 0 2px 8px rgba(39, 174, 96, 0.4);
}

.matrix-square.unpaid {
  background: linear-gradient(135deg, #c0392b, #e74c3c);
  box-shadow: 0 2px 8px rgba(231, 76, 60, 0.4);
}

.matrix-square.pending {
  background: linear-gradient(135deg, #d68910, #f39c12);
  box-shadow: 0 2px 8px rgba(243, 156, 18, 0.4);
}

.matrix-bar {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.matrix-bar.paid {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: white;
  box-shadow: 0 2px 8px rgba(39, 174, 96, 0.4);
}

.matrix-bar.unpaid {
  background: linear-gradient(135deg, #c0392b, #e74c3c);
  color: white;
  box-shadow: 0 2px 8px rgba(231, 76, 60, 0.4);
}

/* Matrix legend */
.matrix-legend {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 12px;
  background: rgba(22, 24, 32, 0.6);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.matrix-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Session header styling */
.session-header {
  background: linear-gradient(135deg, rgba(11, 60, 124, 0.2), rgba(16, 16, 28, 0.8));
  border-bottom: 2px solid rgba(11, 60, 124, 0.35);
  padding: 8px 12px;
  font-weight: 700;
  font-size: var(--text-xs);
  text-transform: none;
  color: var(--accent-light);
  text-align: center;
  white-space: normal;
  word-break: break-word;
  line-height: var(--leading-snug);
}

/* Badge accent for accounts */
.badge-accent {
  background: rgba(11, 60, 124, 0.15);
  color: var(--accent-light);
}

/* Payments/attendance filter bars */
.payments-header {
  flex-wrap: wrap;
  gap: 8px;
}

.payments-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding: 12px;
  background: rgba(22, 24, 32, 0.6);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.payments-filters .form-select,
.payments-filters .form-input {
  min-width: 120px;
  height: 36px;
}

/* Matrix month header bar */
.matrix-month-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 0 8px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  padding: 8px 12px;
  background: rgba(11, 60, 124, 0.08);
  border-radius: var(--radius-sm);
  border-right: 4px solid var(--primary);
}

body.lang-fr .matrix-month-header {
  border-right: none;
  border-left: 4px solid var(--primary);
}

.matrix-session-badge {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(11, 60, 124, 0.12);
  padding: 4px 10px;
  border-radius: 12px;
}

/* ── Monthly merged "bar" cell — payments grid ─────────────
   Renders one wide pill across N session columns for "monthly"
   students. Same color semantics as matrix-square (green=paid,
   red=unpaid) but stretched horizontally. */
.matrix-bar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 34px;
  padding: 4px 12px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.85rem;
  color: white;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.matrix-bar:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.matrix-bar.paid {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  box-shadow: 0 2px 8px rgba(39, 174, 96, 0.4);
}

.matrix-bar.unpaid {
  background: linear-gradient(135deg, #c0392b, #e74c3c);
  box-shadow: 0 2px 8px rgba(231, 76, 60, 0.4);
}

/* ── RTL text overflow fix ───────────────────────────────
   Arabic names in narrow table cells were getting visually
   clipped because `white-space:nowrap` + cell width would push
   the last glyph past the cell edge. The fix is to allow
   wrapping on word boundaries AND clip with ellipsis if a
   single token is still too long. Apply to any cell that holds
   user-entered Arabic text. */
.rtl-cell {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  text-overflow: ellipsis;
  line-height: 1.35;
}

/* Force the payments matrix table cells to not cut RTL text. */
.payments-grid td,
.payments-grid th {
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* ── Student-view timeline ──────────────────────────────── */
.timeline {
  display: grid;
  gap: 12px;
}

.timeline-month-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}