/* ═══════════════════════════════════════════════════
   SABEELY — MAIN DESIGN SYSTEM & STYLESHEET
   Brand: Royal Purple & Vibrant Lavender
   ═══════════════════════════════════════════════════ */

/* ── Custom Font Fallback ─────────────────────────── */
@font-face {
  font-family: 'Diodrum';
  src: url('../fonts/Diodrum.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* ═══════════════════════════════════════════════════
   DESIGN TOKENS — DARK THEME (DEFAULT)
   ═══════════════════════════════════════════════════ */
:root {
  /* ── Corporate Brand Colors (Royal Purple & Vibrant Lavender) */
  --primary:           #8B5CF6;
  --primary-light:     #A78BFA;
  --primary-dark:      #7C3AED;
  --primary-rgb:       139, 92, 246;
  --accent:            #6D28D9;
  --accent-light:      #9333EA;
  --accent-dark:       #4C1D95;
  --accent-rgb:        109, 40, 217;
  
  --brand-gradient:    linear-gradient(135deg, #8B5CF6 0%, #6D28D9 50%, #4C1D95 100%);
  --brand-gradient-hover: linear-gradient(135deg, #9333EA 0%, #7C3AED 50%, #581C87 100%);
  --brand-glow:        0 0 24px rgba(139, 92, 246, 0.45), 0 0 48px rgba(109, 40, 217, 0.25);
  --lotus-glow:        0 0 30px rgba(139, 92, 246, 0.35);

  /* ── Semantic Colors ─────────────────────────────── */
  --success:           #10B981;
  --success-light:     #34D399;
  --danger:            #EF4444;
  --danger-light:      #F87171;
  --warning:           #F59E0B;
  --warning-light:     #FBBF24;
  --info:              #8B5CF6;

  /* ── Glass Theme Surfaces (Translucent & Solid with Purple Undertone) ──── */
  --bg-dark:           #0B0814;
  --bg-body:           #0B0814;
  --bg-secondary:      rgba(20, 14, 38, 0.75);
  --bg-card:           rgba(24, 17, 46, 0.85);
  --bg-card-elevated:  #1A1230;
  --bg-card-hover:     rgba(139, 92, 246, 0.08);
  --bg-input:          #120D24;
  --bg-sidebar:        rgba(11, 8, 20, 0.95);
  --bg-header:         rgba(11, 8, 20, 0.92);

  /* ── Text ────────────────────────────────────────── */
  --text-main:         #FFFFFF;
  --text-secondary:    #DDD6FE;
  --text-muted:        #A78BFA;
  --text-dark:         #05030A;

  /* ── Borders ─────────────────────────────────────── */
  --border:            rgba(167, 139, 250, 0.16);
  --border-light:      rgba(139, 92, 246, 0.3);
  --border-pink:       rgba(139, 92, 246, 0.2);
  --border-hover:      rgba(167, 139, 250, 0.45);

  /* ── Shadows ─────────────────────────────────────── */
  --shadow:            0 8px 32px 0 rgba(0, 0, 0, 0.5);
  --shadow-card:       0 8px 32px 0 rgba(0, 0, 0, 0.5);
  --shadow-elevated:   0 16px 48px 0 rgba(0, 0, 0, 0.65);
  --shadow-lotus:      0 8px 32px rgba(139, 92, 246, 0.25), 0 2px 8px rgba(109, 40, 217, 0.15);

  /* ── Sidebar Glass ───────────────────────────────── */
  --bg-sidebar-glass:  rgba(11, 8, 20, 0.85);
  --border-sidebar:    rgba(167, 139, 250, 0.1);
  --sidebar-active-text: #FFFFFF;

  /* ── Shape & Motion ──────────────────────────────── */
  --radius:            16px;
  --radius-sm:         12px;
  --radius-md:         20px;
  --radius-lg:         24px;
  --radius-xl:         32px;
  --radius-pill:       9999px;
  --transition:        0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --transition-slow:   0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --sidebar-width:     268px;
  --sidebar-collapsed: 72px;
  --topbar-height:     68px;

  /* ── Typography System ───────────────────────────── */
  --font-primary:      'Inter', 'Sora', 'IBM Plex Sans Arabic', sans-serif;
  --font-arabic:       'IBM Plex Sans Arabic', 'Inter', sans-serif;
  --font-mono:         'JetBrains Mono', 'IBM Plex Mono', monospace;
  --font-heading:      'Hanken Grotesk', sans-serif;

  --text-xs:    0.75rem;
  --text-sm:    0.875rem;
  --text-base:  1rem;
  --text-lg:    1.125rem;
  --text-xl:    1.25rem;
  --text-2xl:   1.5rem;
  --text-3xl:   2rem;
  --text-4xl:   2.25rem;
  --text-5xl:   3rem;

  --leading-none:     1;
  --leading-tight:    1.25;
  --leading-snug:     1.4;
  --leading-normal:   1.5;
  --leading-relaxed:  1.6;
  --leading-loose:    2;

  /* ── Spacing System ──────────────────────────────── */
  --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;

  /* ── Component Dimensions ────────────────────────── */
  --h-input:    48px;
  --h-btn:      44px;
  --h-btn-sm:   36px;
  --h-btn-lg:   52px;
}

/* ═══════════════════════════════════════════════════
   LIGHT THEME
   ═══════════════════════════════════════════════════ */
body.theme-light {
  --primary:           #6D28D9;
  --primary-light:     #7C3AED;
  --primary-dark:      #5B21B6;
  --primary-rgb:       109, 40, 217;
  --accent:            #8B5CF6;
  --accent-light:      #A78BFA;
  --accent-dark:       #6D28D9;
  
  --brand-gradient:    linear-gradient(135deg, #7C3AED 0%, #5B21B6 100%);
  --brand-glow:        0 0 24px rgba(109, 40, 217, 0.2), 0 0 48px rgba(139, 92, 246, 0.1);
  --lotus-glow:        0 0 30px rgba(109, 40, 217, 0.15);

  --bg-dark:           #FBF9FE;
  --bg-body:           #F5F3FF;
  --bg-secondary:      #FFFFFF;
  --bg-card:           #FFFFFF;
  --bg-card-elevated:  #FFFFFF;
  --bg-card-hover:     #FAF5FF;
  --bg-input:          #FFFFFF;
  --bg-sidebar:        #FFFFFF;
  --bg-header:         #FFFFFF;

  --text-main:         #1E1B4B;
  --text-secondary:    #3730A3;
  --text-muted:        #6B7280;
  --text-dark:         #0F0D2E;

  --border:            #E9D5FF;
  --border-light:      rgba(109, 40, 217, 0.2);
  --border-pink:       rgba(139, 92, 246, 0.15);
  --border-hover:      #D8B4FE;

  --shadow:            rgba(76, 29, 149, 0.06);
  --shadow-card:       0 4px 20px rgba(76, 29, 149, 0.05), 0 1px 3px rgba(76, 29, 149, 0.03);
  --shadow-elevated:   0 10px 40px rgba(76, 29, 149, 0.08), 0 2px 8px rgba(76, 29, 149, 0.04);
  --shadow-lotus:      0 8px 32px rgba(109, 40, 217, 0.12), 0 2px 8px rgba(139, 92, 246, 0.08);

  --bg-sidebar-glass:  rgba(255, 255, 255, 0.98);
  --border-sidebar:    rgba(76, 29, 149, 0.08);
  --sidebar-active-text: #6D28D9;

  --skeleton-base:     #EDE9FE;
  --skeleton-shine:    #F5F3FF;
}

/* ═══════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════ */
*,
*::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: var(--bg-body);
  color: var(--text-main);
  min-height: 100vh;
  line-height: var(--leading-relaxed);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
  font-size: var(--text-base);
  letter-spacing: -0.01em;
}

/* Arabic font for RTL content */
body:not(.lang-fr) {
  font-family: var(--font-arabic);
}

body.lang-fr {
  font-family: var(--font-primary);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading, var(--font-primary));
  color: var(--text-main);
  font-weight: 700;
  line-height: var(--leading-snug);
  margin-bottom: var(--space-2);
  letter-spacing: -0.02em;
}

body:not(.lang-fr) h1,
body:not(.lang-fr) h2,
body:not(.lang-fr) h3 {
  font-family: var(--font-arabic);
}

.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: rgba(139, 92, 246, 0.35);
  color: var(--text-main);
}

/* ── Scrollbar ────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.35);
  border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(167, 139, 250, 0.7);
}

body.theme-light ::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.3);
}

body.theme-light ::-webkit-scrollbar-thumb:hover {
  background: rgba(124, 58, 237, 0.6);
}

/* ── Table Container ──────────────────────────────── */
.table-container {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow-x: auto;
  margin-bottom: 24px;
}

.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;
}

/* ═══════════════════════════════════════════════════
   APP LOADER — Lotus Animation
   ═══════════════════════════════════════════════════ */
#app-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-body);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  flex-direction: column;
  gap: 20px;
}

#app-loader .loader-ring {
  width: 52px;
  height: 52px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-right-color: var(--accent);
  border-radius: 50%;
  animation: lotusSpin 0.9s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

#app-loader .loader-text {
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-family: var(--font-primary);
  font-weight: 500;
  letter-spacing: 0.05em;
}

@keyframes lotusSpin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════
   LOGIN PAGE — Lotus Brand Experience
   ═══════════════════════════════════════════════════ */
@keyframes gridDriftUp {
  0%   { background-position: 0 0; }
  100% { background-position: 0 -120px; }
}

.login-page-wrapper {
  min-height: 100vh;
  width: 100vw;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  position: relative;
  overflow: hidden;
}

/* Animated Glassmorphic Mesh Background */
.login-page-wrapper::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.18) 0%, rgba(109, 40, 217, 0.22) 35%, #0B0814 70%);
  animation: bg-mesh 25s infinite linear;
  pointer-events: none;
  z-index: 0;
}

@keyframes bg-mesh {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.login-grid-lines,
.grid-line,
.bg-orb {
  display: none !important;
}

/* ── Modern Floating Glass Language Switcher ── */
.login-lang-switch {
  position: absolute;
  top: 24px;
  right: 24px;
  left: auto;
  inset-inline-end: 24px;
  inset-inline-start: auto;
  width: auto !important;
  max-width: max-content !important;
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  background: rgba(24, 17, 46, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: var(--radius-pill);
  padding: 4px 6px;
  z-index: 100;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(139, 92, 246, 0.2);
  transition: all var(--transition);
}

body.lang-fr .login-lang-switch {
  right: auto;
  left: 24px;
  inset-inline-end: auto;
  inset-inline-start: 24px;
}

body.theme-light .login-lang-switch {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(167, 139, 250, 0.35);
  box-shadow: 0 8px 24px rgba(109, 40, 217, 0.1), 0 1px 3px rgba(0, 0, 0, 0.05);
}

.lang-switch-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-light);
  font-size: 0.95rem;
  padding-left: 6px;
  padding-right: 2px;
}

body.lang-fr .lang-switch-icon {
  padding-left: 2px;
  padding-right: 6px;
}

body.theme-light .lang-switch-icon {
  color: #7C3AED;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

body.theme-light .lang-btn {
  color: #6B7280;
}

.lang-btn.active {
  background: var(--brand-gradient);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(109, 40, 217, 0.4), 0 0 12px rgba(139, 92, 246, 0.3);
}

body.theme-light .lang-btn.active {
  background: var(--brand-gradient);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(109, 40, 217, 0.35);
}

.lang-btn:hover:not(.active) {
  color: var(--text-main);
  background: rgba(139, 92, 246, 0.12);
}

body.theme-light .lang-btn:hover:not(.active) {
  color: #1E1B4B;
  background: rgba(139, 92, 246, 0.1);
}

.feature-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.login-container {
  display: flex;
  flex-direction: row;
  width: 100%;
  max-width: 1060px;
  min-height: 650px;
  background: var(--bg-card);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(167, 139, 250, 0.18);
  border-radius: var(--radius-xl);
  box-shadow: 
    0 32px 80px rgba(0, 0, 0, 0.85),
    0 0 60px rgba(109, 40, 217, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  z-index: 1;
  overflow: hidden;
  margin: 20px;
}

/* Brand Side */
.login-brand-side {
  flex: 1.1;
  background: linear-gradient(145deg, rgba(17, 12, 34, 0.95) 0%, rgba(28, 18, 54, 0.85) 100%);
  padding: 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: white;
  position: relative;
  border-left: 1px solid rgba(167, 139, 250, 0.12);
  overflow: hidden;
}

body.lang-fr .login-brand-side {
  border-left: none;
  border-right: 1px solid rgba(167, 139, 250, 0.12);
}

.brand-content {
  position: relative;
  z-index: 2;
}

.brand-logo-wrap {
  width: 110px;
  height: 110px;
  border-radius: 24px;
  background: transparent;
  padding: 4px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 12px 40px rgba(139, 92, 246, 0.45),
    0 0 60px rgba(109, 40, 217, 0.3);
  transition: transform var(--transition-slow), box-shadow var(--transition-slow);
}

.brand-logo-wrap:hover {
  transform: scale(1.05) rotate(2deg);
  box-shadow:
    0 16px 48px rgba(139, 92, 246, 0.6),
    0 0 80px rgba(109, 40, 217, 0.4);
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 20px;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 2.9rem;
  font-weight: 800;
  margin-bottom: 2px;
  letter-spacing: -0.03em;
  color: #ffffff;
  line-height: 1.1;
  text-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
}

.brand-tagline {
  font-size: 0.76rem;
  font-weight: 700;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.2em;
  margin-bottom: 14px;
  text-transform: uppercase;
}

.brand-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.7;
}

.brand-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(167, 139, 250, 0.12);
  transition: all var(--transition);
}

.feature-item:hover {
  background: rgba(109, 40, 217, 0.18);
  border-color: rgba(139, 92, 246, 0.35);
  color: var(--text-main);
  transform: translateX(4px);
}

body.lang-fr .feature-item:hover {
  transform: translateX(-4px);
}

.feature-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.35), rgba(139, 92, 246, 0.2));
  border: 1px solid rgba(167, 139, 250, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-light);
  flex-shrink: 0;
  font-size: 1.1rem;
}

/* Form Side */
.login-form-side {
  flex: 1;
  padding: 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(15, 10, 26, 0.5);
}

.form-wrapper {
  max-width: 410px;
  width: 100%;
  margin: 0 auto;
}

.form-header {
  margin-bottom: 32px;
}

.form-header h2 {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--text-main);
  margin-bottom: 8px;
  padding-bottom: 8px;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.form-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Role Selector */
.role-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.role-card-modern {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(167, 139, 250, 0.15);
  border-radius: var(--radius-sm);
  padding: 16px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.role-card-modern::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--brand-gradient);
  opacity: 0;
  transition: opacity 0.25s;
}

.role-card-modern:hover {
  border-color: rgba(139, 92, 246, 0.5);
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(109, 40, 217, 0.25);
}

.role-card-modern:hover::before {
  opacity: 0.08;
}

.role-card-modern.active {
  background: rgba(109, 40, 217, 0.16);
  border-color: rgba(139, 92, 246, 0.7);
  box-shadow:
    0 0 0 1px rgba(139, 92, 246, 0.4),
    0 10px 30px rgba(109, 40, 217, 0.35);
  transform: translateY(-3px);
}

.role-card-modern.active::before {
  opacity: 0.12;
}

.role-card-modern.active .role-icon {
  color: var(--primary-light);
  transform: scale(1.15);
  filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.6));
}

.role-icon {
  font-size: 1.5rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  transition: all var(--transition);
  display: block;
}

.role-name {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: color var(--transition);
  position: relative;
  z-index: 1;
}

.role-card-modern.active .role-name {
  color: var(--text-main);
  font-weight: 700;
}

/* Form Visibility */
.hidden-form { display: none; }

.show-form {
  display: block;
  animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpFade {
  0%   { opacity: 0; transform: translateY(16px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Form Field Groups */
.form-group-modern {
  margin-bottom: 18px;
}

.form-group-modern label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
  letter-spacing: 0.02em;
}

.input-with-icon {
  position: relative;
}

.input-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
  transition: color var(--transition);
}

body.lang-fr .input-icon {
  right: auto;
  left: 14px;
}

.input-with-icon:focus-within .input-icon {
  color: var(--primary-light);
}

.input-with-icon input {
  width: 100%;
  padding: 13px 44px 13px 44px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text-main);
  transition: all var(--transition);
}

.input-with-icon input:focus {
  outline: none;
  background: var(--bg-card-elevated);
  border-color: rgba(139, 92, 246, 0.7);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18), 0 0 24px rgba(109, 40, 217, 0.2);
}

.input-with-icon input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.password-toggle {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  transition: color var(--transition);
}

body.lang-fr .password-toggle {
  left: auto;
  right: 14px;
}

.password-toggle:hover {
  color: var(--primary-light);
}

.forgot-password-link {
  text-align: left;
  margin-bottom: 24px;
}

body.lang-fr .forgot-password-link {
  text-align: right;
}

.forgot-password-link a {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition);
}

.forgot-password-link a:hover {
  color: var(--primary-light);
}

/* Login Submit Button */
.btn-login-submit {
  width: 100%;
  padding: 14px;
  background: var(--brand-gradient);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.98rem;
  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 6px 24px rgba(109, 40, 217, 0.4), 0 0 30px rgba(139, 92, 246, 0.2);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.02em;
}

.btn-login-submit::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn-login-submit:hover::before {
  left: 100%;
}

.btn-login-submit:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 32px rgba(109, 40, 217, 0.45),
    0 0 60px rgba(139, 92, 246, 0.25);
}

.btn-login-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-login-submit .arrow-icon {
  transition: transform var(--transition);
}

.btn-login-submit:hover .arrow-icon {
  transform: translateX(-5px);
}

.btn-login-submit .spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Error Message */
.login-error-msg {
  background: rgba(239, 68, 68, 0.08);
  color: var(--danger-light);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 20px;
  border-right: 3px solid var(--danger);
  animation: slideUpFade 0.3s ease;
  border-left: none;
}

.shake {
  animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

/* Sign-up Link */
.signup-link {
  text-align: center;
  margin-top: 20px;
  font-size: 0.88rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.signup-link span {
  font-size: 0.82rem;
}

.btn-signup {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: transparent;
  color: var(--primary);
  border: none;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  justify-content: center;
}

.btn-signup:hover {
  color: var(--primary-light);
  background: rgba(139, 92, 246, 0.12);
  border-radius: var(--radius-sm);
}

@keyframes shake {
  10%, 90%  { transform: translate3d(-1px, 0, 0); }
  20%, 80%  { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60%  { transform: translate3d(4px, 0, 0); }
}

/* Mobile Login */
@media (max-width: 900px) {
  .login-container {
    flex-direction: column;
    max-width: 480px;
    min-height: auto;
  }

  .login-brand-side {
    padding: 36px 32px;
    text-align: center;
    border-left: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .brand-logo-wrap {
    margin: 0 auto 18px;
    width: 72px;
    height: 72px;
  }

  .brand-title {
    font-size: 2rem;
  }

  .login-form-side {
    padding: 36px 32px;
  }

  .brand-features {
    display: none;
  }
}

@media (max-width: 480px) {
  .login-container {
    margin: 12px;
    border-radius: var(--radius-lg);
  }

  .login-brand-side,
  .login-form-side {
    padding: 28px 24px;
  }
}

/* ═══════════════════════════════════════════════════
   LIGHT THEME LOGIN PAGE OVERRIDES (LIGHT PURPLE & LAVENDER)
   ═══════════════════════════════════════════════════ */
body.theme-light .login-page-wrapper {
  background: #FAF8FF;
}

body.theme-light .login-page-wrapper::before {
  background: 
    radial-gradient(ellipse at 15% 15%, rgba(167, 139, 250, 0.25) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 85%, rgba(139, 92, 246, 0.2) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 15%, rgba(192, 132, 252, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse at 15% 85%, rgba(124, 58, 237, 0.15) 0%, transparent 55%),
    linear-gradient(135deg, #FAF8FF 0%, #F5EEFF 50%, #EDE4FF 100%);
  animation: bg-mesh-light 25s infinite alternate ease-in-out;
  opacity: 1;
}

@keyframes bg-mesh-light {
  0% { transform: scale(1) rotate(0deg); }
  100% { transform: scale(1.1) rotate(6deg); }
}

body.theme-light .login-container {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(167, 139, 250, 0.35);
  box-shadow: 
    0 24px 60px rgba(109, 40, 217, 0.12),
    0 4px 16px rgba(139, 92, 246, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body.theme-light .login-brand-side {
  background: linear-gradient(145deg, rgba(250, 245, 255, 0.95) 0%, rgba(243, 238, 255, 0.8) 100%);
  color: var(--text-main);
  border-left: 1px solid rgba(167, 139, 250, 0.2);
}

body.theme-light.lang-fr .login-brand-side {
  border-left: none;
  border-right: 1px solid rgba(167, 139, 250, 0.2);
}

body.theme-light .brand-title {
  color: var(--text-dark);
}

body.theme-light .brand-subtitle {
  color: var(--text-secondary);
  font-weight: 600;
}

body.theme-light .feature-item {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(167, 139, 250, 0.25);
  color: var(--text-secondary);
  font-weight: 600;
}

body.theme-light .feature-item:hover {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.4);
  color: var(--text-main);
}

body.theme-light .feature-icon {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(167, 139, 250, 0.25));
  border-color: rgba(139, 92, 246, 0.3);
  color: #7C3AED;
}

body.theme-light .login-form-side {
  background: rgba(255, 255, 255, 0.55);
}

body.theme-light .role-card-modern {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(167, 139, 250, 0.25);
  box-shadow: 0 4px 16px rgba(109, 40, 217, 0.06);
}

body.theme-light .role-card-modern:hover {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 8px 24px rgba(109, 40, 217, 0.12);
}

body.theme-light .role-card-modern.active {
  background: rgba(245, 243, 255, 0.95);
  border-color: #7C3AED;
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.4), 0 8px 28px rgba(109, 40, 217, 0.15);
}

body.theme-light .role-card-modern .role-icon {
  color: #7C3AED;
}

body.theme-light .role-card-modern.active .role-icon {
  color: #6D28D9;
}

body.theme-light .role-name {
  font-weight: 600;
  color: #4B5563;
}

body.theme-light .role-card-modern.active .role-name {
  color: #1E1B4B;
  font-weight: 700;
}

body.theme-light .brand-logo-wrap {
  box-shadow:
    0 10px 32px rgba(139, 92, 246, 0.3),
    0 0 60px rgba(109, 40, 217, 0.15);
}

body.theme-light .brand-logo-wrap:hover {
  box-shadow:
    0 14px 44px rgba(139, 92, 246, 0.45),
    0 0 80px rgba(109, 40, 217, 0.25);
}

/* 1000000x COOLER SIGNUP MODAL (MOBILE FIRST) */
.signup-modal-override .modal-body {
  padding: 0 !important;
  max-height: 80vh !important;
}
.signup-wizard {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.wizard-header {
  padding: 20px;
  background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(139,92,246,0.1));
  border-bottom: 1px solid rgba(255,255,255,0.05);
  text-align: center;
  position: relative;
}
.wizard-progress {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
}
.wizard-step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transition: all 0.3s ease;
}
.wizard-step-dot.active {
  background: var(--primary);
  transform: scale(1.3);
  box-shadow: 0 0 10px var(--primary);
}
.wizard-body {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
  position: relative;
  min-height: 300px;
}
.wizard-step {
  display: none;
  animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.wizard-step.active {
  display: block;
}
.wizard-footer {
  padding: 20px;
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  justify-content: space-between;
  background: rgba(15,23,42,0.8);
  backdrop-filter: blur(10px);
}
.btn-wizard {
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-wizard.next {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 15px rgba(99,102,241,0.4);
}
.btn-wizard.prev {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.chip {
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  font-size: 0.9rem;
}
.chip:hover {
  background: rgba(255,255,255,0.1);
}
.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 10px rgba(99,102,241,0.3);
  transform: translateY(-2px);
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}
