/*
 * ExamPro - Modern Enterprise SaaS Design System
 * Complete UI Theme for Online Exam Platform
 * Version: 2.0
 * 
 * DESIGN PRINCIPLES:
 * - Modern, clean, professional
 * - Education-focused UI/UX
 * - Enterprise SaaS aesthetics
 * - Mobile-first responsive
 * - Accessibility compliant
 * - Performance optimized
 * 
 * SCOPING:
 * - Auth pages use body.auth-page scope
 * - Internal app pages use body.app-page scope (see app-theme.css)
 */

/* ===================================
   CSS CUSTOM PROPERTIES (VARIABLES) - AUTH SCOPED
=================================== */
body.auth-page {
  /* Color Palette - Professional Blue/Indigo Theme */
  --primary-color: #1e88e5;
  --primary-dark: #1565c0;
  --secondary-color: #1565c0;
  --success-color: #2e7d32;
  --warning-color: #f9a825;
  --danger-color: #d32f2f;
  --info-color: #0288d1;
  
  /* Neutral Colors */
  --background-color: #f4f6f9;
  --surface-color: #ffffff;
  --card-color: #ffffff;
  --border-color: #e1e5e9;
  --divider-color: #f0f2f5;
  
  /* Text Colors */
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --text-inverse: #ffffff;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%);
  --gradient-success: linear-gradient(135deg, #2e7d32 0%, #388e3c 100%);
  --gradient-danger: linear-gradient(135deg, #d32f2f 0%, #f44336 100%);
  --gradient-auth: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  
  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-xs: 0.75rem;    /* 12px */
  --font-size-sm: 0.875rem;   /* 14px */
  --font-size-base: 1rem;     /* 16px */
  --font-size-lg: 1.125rem;   /* 18px */
  --font-size-xl: 1.25rem;    /* 20px */
  --font-size-2xl: 1.5rem;    /* 24px */
  --font-size-3xl: 1.875rem;  /* 30px */
  --font-size-4xl: 2.25rem;   /* 36px */
  
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  /* Spacing Scale */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  
  /* Border Radius */
  --radius-sm: 0.375rem;  /* 6px */
  --radius-md: 0.5rem;    /* 8px */
  --radius-lg: 0.75rem;   /* 12px */
  --radius-xl: 1rem;      /* 16px */
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Layout */
  --sidebar-width: 260px;
  --header-height: 70px;
  --container-max-width: 1200px;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.3s ease;
}

/* ===================================
   RESET & BASE STYLES - AUTH SCOPED
=================================== */
body.auth-page * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body.auth-page {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--background-color);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===================================
   TYPOGRAPHY SYSTEM - AUTH SCOPED
=================================== */
body.auth-page h1,
body.auth-page h2,
body.auth-page h3,
body.auth-page h4,
body.auth-page h5,
body.auth-page h6 {
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
  margin-bottom: var(--space-4);
  color: var(--text-primary);
}

body.auth-page h1 { font-size: var(--font-size-4xl); }
body.auth-page h2 { font-size: var(--font-size-3xl); }
body.auth-page h3 { font-size: var(--font-size-2xl); }
body.auth-page h4 { font-size: var(--font-size-xl); }
body.auth-page h5 { font-size: var(--font-size-lg); }
body.auth-page h6 { font-size: var(--font-size-base); }

body.auth-page p {
  margin-bottom: var(--space-4);
  color: var(--text-secondary);
}

body.auth-page a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}

body.auth-page a:hover {
  color: var(--primary-dark);
}

/* ===================================
   AUTHENTICATION LAYOUT (Two-Column) - AUTH SCOPED
=================================== */

/* Main Authentication Container */
body.auth-page .auth-container {
  display: flex;
  min-height: 100vh;
  background: #ffffff;
}

/* Left Panel - Branding & Features */
body.auth-page .auth-left-panel {
  flex: 1;
  background: var(--gradient-auth);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 4rem 3rem;
  color: white;
  position: relative;
  overflow: hidden;
}

body.auth-page .auth-left-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
}

body.auth-page .auth-branding {
  text-align: center;
  z-index: 1;
  max-width: 400px;
}

body.auth-page .auth-logo {
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2rem;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

body.auth-page .auth-logo svg {
  width: 40px;
  height: 40px;
  fill: white;
}

body.auth-page .auth-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.025em;
}

body.auth-page .auth-subtitle {
  font-size: 1.25rem;
  margin-bottom: 3rem;
  opacity: 0.9;
  font-weight: 400;
}

body.auth-page .auth-features {
  list-style: none;
  text-align: left;
}

body.auth-page .auth-features li {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

body.auth-page .auth-features li::before {
  content: '✓';
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  font-weight: bold;
  font-size: 0.9rem;
}

/* Right Panel - Form */
body.auth-page .auth-right-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: #ffffff;
}

body.auth-page .auth-form-container {
  width: 100%;
  max-width: 400px;
}

body.auth-page .auth-form-header {
  text-align: center;
  margin-bottom: 2rem;
}

body.auth-page .auth-form-title {
  font-size: 2rem;
  font-weight: 700;
  color: #1a202c;
  margin-bottom: 0.5rem;
}

body.auth-page .auth-form-subtitle {
  color: #718096;
  font-size: 1rem;
}

/* ===================================
   FORM COMPONENTS - AUTH SCOPED
=================================== */
body.auth-page .form-group {
  margin-bottom: 1.5rem;
}

body.auth-page .form-label {
  display: block;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

body.auth-page .form-input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.2s ease;
  background: #ffffff;
  color: #1a202c;
}

body.auth-page .form-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  transform: translateY(-1px);
}

body.auth-page .form-input::placeholder {
  color: #a0aec0;
}

/* Select Dropdown */
body.auth-page .form-select {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.2s ease;
  background: #ffffff;
  color: #1a202c;
  cursor: pointer;
}

body.auth-page .form-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ===================================
   BUTTON COMPONENTS - AUTH SCOPED
=================================== */
body.auth-page .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  font-family: var(--font-family);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
  user-select: none;
}

body.auth-page .btn-primary {
  width: 100%;
  padding: 0.875rem 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

body.auth-page .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

body.auth-page .btn-primary:active {
  transform: translateY(0);
}

body.auth-page .btn-full {
  width: 100%;
}

/* ===================================
   ALERT COMPONENTS - AUTH SCOPED
=================================== */
body.auth-page .alert {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

body.auth-page .alert-success {
  background: #f0fff4;
  color: #22543d;
  border: 1px solid #9ae6b4;
}

body.auth-page .alert-danger {
  background: #fed7d7;
  color: #742a2a;
  border: 1px solid #feb2b2;
}

body.auth-page .alert-error {
  background: #fed7d7;
  color: #742a2a;
  border: 1px solid #feb2b2;
}

/* Validation Error Text */
body.auth-page .form-error {
  color: #e53e3e;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: block;
}

/* Links */
body.auth-page .auth-link {
  text-align: center;
  margin-top: 2rem;
  color: #718096;
}

body.auth-page .auth-link a {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

body.auth-page .auth-link a:hover {
  color: #764ba2;
}

/* ===================================
   LAYOUT COMPONENTS
=================================== */

/* Main Layout Container */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--gradient-primary);
  color: var(--text-inverse);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.sidebar-header {
  padding: var(--space-6);
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-inverse);
  margin-bottom: var(--space-2);
}

.sidebar-subtitle {
  font-size: var(--font-size-sm);
  opacity: 0.8;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-4) 0;
}

.sidebar-nav ul {
  list-style: none;
}

.sidebar-nav li {
  margin-bottom: var(--space-1);
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  padding: var(--space-3) var(--space-6);
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: all var(--transition-base);
  font-weight: var(--font-weight-medium);
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-inverse);
  padding-left: var(--space-8);
}

.sidebar-nav .nav-icon {
  margin-right: var(--space-3);
  font-size: var(--font-size-lg);
}

/* Main Content Area */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.app-header {
  background: var(--surface-color);
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.header-user {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.user-info {
  text-align: right;
}

.user-name {
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
}

.user-email {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.user-badge {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  background: var(--success-color);
  color: var(--text-inverse);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  margin-top: var(--space-1);
}

.user-badge.no-class {
  background: var(--warning-color);
}

/* Content Container */
.content-container {
  flex: 1;
  padding: var(--space-6);
  max-width: var(--container-max-width);
  margin: 0 auto;
  width: 100%;
}

/* ===================================
   CARD COMPONENTS
=================================== */
.card {
  background: var(--card-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--divider-color);
  background: var(--surface-color);
}

.card-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin: 0;
}

.card-subtitle {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.card-body {
  padding: var(--space-6);
}

.card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--divider-color);
  background: var(--background-color);
}

/* Dashboard Cards */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.stat-card {
  background: var(--card-color);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  transition: all var(--transition-base);
}

.stat-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* ===================================
   FORM COMPONENTS
=================================== */
.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  font-size: var(--font-size-sm);
}

.form-label.required::after {
  content: ' *';
  color: var(--danger-color);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  background: var(--surface-color);
  color: var(--text-primary);
  transition: all var(--transition-base);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-error {
  color: var(--danger-color);
  font-size: var(--font-size-sm);
  margin-top: var(--space-1);
  display: block;
}

/* Radio Buttons (for exam questions) */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.radio-option {
  display: flex;
  align-items: center;
  padding: var(--space-4);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  background: var(--surface-color);
}

.radio-option:hover {
  border-color: var(--primary-color);
  background: rgba(30, 136, 229, 0.02);
}

.radio-option.selected {
  border-color: var(--primary-color);
  background: rgba(30, 136, 229, 0.05);
}

.radio-option input[type="radio"] {
  margin-right: var(--space-3);
  transform: scale(1.2);
}

.option-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--primary-color);
  color: var(--text-inverse);
  border-radius: var(--radius-full);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  margin-right: var(--space-3);
  flex-shrink: 0;
}

.option-text {
  flex: 1;
  font-size: var(--font-size-base);
  color: var(--text-primary);
}

/* ===================================
   BUTTON COMPONENTS
=================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  font-family: var(--font-family);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
  user-select: none;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Button Variants */
.btn-primary {
  background: var(--gradient-primary);
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--surface-color);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-success {
  background: var(--gradient-success);
  color: var(--text-inverse);
}

.btn-success:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-danger {
  background: var(--gradient-danger);
  color: var(--text-inverse);
}

.btn-danger:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-warning {
  background: var(--warning-color);
  color: var(--text-inverse);
}

.btn-warning:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:hover:not(:disabled) {
  background: var(--primary-color);
  color: var(--text-inverse);
}

/* Button Sizes */
.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-xs);
}

.btn-lg {
  padding: var(--space-4) var(--space-6);
  font-size: var(--font-size-base);
}

.btn-xl {
  padding: var(--space-5) var(--space-8);
  font-size: var(--font-size-lg);
}

.btn-full {
  width: 100%;
}

/* Button Groups */
.btn-group {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.btn-group.center {
  justify-content: center;
}

.btn-group.end {
  justify-content: flex-end;
}

/* ===================================
   TABLE COMPONENTS
=================================== */
.table-container {
  background: var(--card-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.table th {
  background: var(--background-color);
  padding: var(--space-4) var(--space-5);
  text-align: left;
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-color);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table td {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--divider-color);
  color: var(--text-secondary);
}

.table tr:hover {
  background: rgba(30, 136, 229, 0.02);
}

.table tr:last-child td {
  border-bottom: none;
}

/* Table Actions */
.table-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.table-actions .btn {
  padding: var(--space-1) var(--space-3);
  font-size: var(--font-size-xs);
}

/* ===================================
   ALERT COMPONENTS
=================================== */
.alert {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  border: 1px solid transparent;
  font-weight: var(--font-weight-medium);
}

.alert-success {
  background: rgba(46, 125, 50, 0.1);
  color: var(--success-color);
  border-color: rgba(46, 125, 50, 0.2);
}

.alert-danger,
.alert-error {
  background: rgba(211, 47, 47, 0.1);
  color: var(--danger-color);
  border-color: rgba(211, 47, 47, 0.2);
}

.alert-warning {
  background: rgba(249, 168, 37, 0.1);
  color: var(--warning-color);
  border-color: rgba(249, 168, 37, 0.2);
}

.alert-info {
  background: rgba(2, 136, 209, 0.1);
  color: var(--info-color);
  border-color: rgba(2, 136, 209, 0.2);
}

/* ===================================
   EXAM INTERFACE COMPONENTS
=================================== */

/* Exam Container */
.exam-container {
  max-width: 800px;
  margin: 0 auto;
  background: var(--card-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* Exam Header */
.exam-header {
  background: var(--gradient-primary);
  color: var(--text-inverse);
  padding: var(--space-6);
  text-align: center;
}

.exam-title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-2);
}

.exam-progress {
  font-size: var(--font-size-base);
  opacity: 0.9;
}

/* Question Container */
.question-container {
  padding: var(--space-8);
}

.question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 2px solid var(--divider-color);
}

.question-number {
  background: var(--primary-color);
  color: var(--text-inverse);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-sm);
}

.question-progress {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.question-text {
  font-size: var(--font-size-lg);
  color: var(--text-primary);
  margin-bottom: var(--space-6);
  line-height: 1.6;
}

/* ===================================
   RESULT COMPONENTS
=================================== */

/* Score Summary */
.score-summary {
  background: var(--card-color);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.score-circle {
  width: 150px;
  height: 150px;
  border-radius: var(--radius-full);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-6);
  position: relative;
}

.score-circle.pass {
  background: var(--gradient-success);
  color: var(--text-inverse);
}

.score-circle.fail {
  background: var(--gradient-danger);
  color: var(--text-inverse);
}

.score-percentage {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  line-height: 1;
}

.score-label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  margin-top: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Score Stats */
.score-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.score-stat {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  text-align: center;
}

.score-stat.correct {
  background: rgba(46, 125, 50, 0.1);
  color: var(--success-color);
}

.score-stat.wrong {
  background: rgba(211, 47, 47, 0.1);
  color: var(--danger-color);
}

.score-stat.total {
  background: rgba(30, 136, 229, 0.1);
  color: var(--primary-color);
}

.stat-number {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  display: block;
}

.stat-label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  margin-top: var(--space-1);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Question Results */
.question-results {
  display: grid;
  gap: var(--space-4);
}

.question-result-card {
  background: var(--card-color);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
  border-left: 4px solid var(--border-color);
}

.question-result-card.correct {
  border-left-color: var(--success-color);
  background: rgba(46, 125, 50, 0.02);
}

.question-result-card.wrong {
  border-left-color: var(--danger-color);
  background: rgba(211, 47, 47, 0.02);
}

.question-result-card.unanswered {
  border-left-color: var(--text-muted);
  background: rgba(156, 163, 175, 0.02);
}

.question-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.result-status-badge {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.result-status-badge.correct {
  background: var(--success-color);
  color: var(--text-inverse);
}

.result-status-badge.wrong {
  background: var(--danger-color);
  color: var(--text-inverse);
}

.result-status-badge.unanswered {
  background: var(--text-muted);
  color: var(--text-inverse);
}

/* ===================================
   UTILITY CLASSES
=================================== */

/* Spacing */
.m-0 { margin: 0; }
.m-1 { margin: var(--space-1); }
.m-2 { margin: var(--space-2); }
.m-3 { margin: var(--space-3); }
.m-4 { margin: var(--space-4); }
.m-5 { margin: var(--space-5); }
.m-6 { margin: var(--space-6); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }

.p-0 { padding: 0; }
.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }

/* Text Alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Text Colors */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }

/* Display */
.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

/* Flexbox */
.flex-column { flex-direction: column; }
.flex-row { flex-direction: row; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }

/* Grid */
.grid-cols-1 { display: grid; grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { display: grid; grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { display: grid; grid-template-columns: repeat(4, 1fr); }

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }

/* Width */
.w-full { width: 100%; }
.w-auto { width: auto; }

/* Height */
.h-full { height: 100%; }
.h-auto { height: auto; }

/* ===================================
   RESPONSIVE DESIGN
=================================== */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 240px;
  }
  
  .dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-base);
  }
  
  .sidebar.active {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .content-container {
    padding: var(--space-4);
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .btn-group {
    flex-direction: column;
  }
  
  .btn-group .btn {
    width: 100%;
  }
  
  .score-stats {
    grid-template-columns: 1fr;
  }
  
  .table-container {
    overflow-x: auto;
  }
  
  /* Auth responsive */
  .auth-container {
    flex-direction: column;
  }
  
  .auth-left-panel {
    min-height: 40vh;
    padding: 2rem 1.5rem;
  }
  
  .auth-title {
    font-size: 2rem;
  }
  
  .auth-subtitle {
    font-size: 1.1rem;
    margin-bottom: 2rem;
  }
  
  .auth-features {
    display: none;
  }
  
  .auth-right-panel {
    padding: 1.5rem;
  }
  
  .auth-form-container {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  :root {
    --space-6: 1rem;
    --space-8: 1.5rem;
  }
  
  .app-header {
    padding: 0 var(--space-4);
  }
  
  .header-title {
    font-size: var(--font-size-lg);
  }
  
  .card-body,
  .question-container {
    padding: var(--space-4);
  }
  
  .score-circle {
    width: 120px;
    height: 120px;
  }
  
  .score-percentage {
    font-size: var(--font-size-3xl);
  }
  
  /* Auth mobile */
  .auth-left-panel {
    min-height: 30vh;
    padding: 1.5rem 1rem;
  }
  
  .auth-title {
    font-size: 1.75rem;
  }
  
  .auth-right-panel {
    padding: 1rem;
  }
  
  .form-input,
  .form-select {
    padding: 0.75rem;
  }
}

/* ===================================
   PRINT STYLES
=================================== */
@media print {
  .sidebar,
  .app-header,
  .btn,
  .auth-left-panel {
    display: none !important;
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
  
  body {
    background: white;
  }
}

/* ===================================
   ACCESSIBILITY ENHANCEMENTS
=================================== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.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;
}

/* Focus styles for keyboard navigation */
.btn:focus-visible,
.form-input:focus-visible,
.form-select:focus-visible,
.sidebar-nav a:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* ===================================
   DARK MODE SUPPORT (Optional)
=================================== */
@media (prefers-color-scheme: dark) {
  :root {
    --background-color: #0f172a;
    --surface-color: #1e293b;
    --card-color: #1e293b;
    --border-color: #334155;
    --divider-color: #475569;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
  }
  
  .form-input,
  .form-select,
  .form-textarea {
    background: var(--surface-color);
    color: var(--text-primary);
  }
  
  .table th {
    background: var(--background-color);
  }
}

/* ===================================
   RESPONSIVE DESIGN - AUTH SCOPED
=================================== */
@media (max-width: 768px) {
  body.auth-page .auth-container {
    flex-direction: column;
  }
  
  body.auth-page .auth-left-panel {
    min-height: 40vh;
    padding: 2rem 1.5rem;
  }
  
  body.auth-page .auth-title {
    font-size: 2rem;
  }
  
  body.auth-page .auth-subtitle {
    font-size: 1.1rem;
    margin-bottom: 2rem;
  }
  
  body.auth-page .auth-features {
    display: none;
  }
  
  body.auth-page .auth-right-panel {
    padding: 1.5rem;
  }
  
  body.auth-page .auth-form-container {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  body.auth-page .auth-left-panel {
    min-height: 30vh;
    padding: 1.5rem 1rem;
  }
  
  body.auth-page .auth-title {
    font-size: 1.75rem;
  }
  
  body.auth-page .auth-right-panel {
    padding: 1rem;
  }
  
  body.auth-page .form-input,
  body.auth-page .form-select,
  body.auth-page .btn-primary {
    padding: 0.75rem;
  }
}

/* ===================================
   ACCESSIBILITY ENHANCEMENTS - AUTH SCOPED
=================================== */
@media (prefers-reduced-motion: reduce) {
  body.auth-page * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body.auth-page .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;
}

/* Focus styles for keyboard navigation */
body.auth-page .form-input:focus-visible,
body.auth-page .form-select:focus-visible,
body.auth-page .btn-primary:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* ===================================
   DARK MODE SUPPORT - AUTH SCOPED
=================================== */
@media (prefers-color-scheme: dark) {
  body.auth-page .auth-right-panel {
    background: #1a202c;
    color: #e2e8f0;
  }
  
  body.auth-page .auth-form-title {
    color: #e2e8f0;
  }
  
  body.auth-page .auth-form-subtitle {
    color: #a0aec0;
  }
  
  body.auth-page .form-input,
  body.auth-page .form-select {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
  }
  
  body.auth-page .form-input::placeholder {
    color: #718096;
  }
}

/* ===================================
   LOADING STATE - AUTH SCOPED
=================================== */
body.auth-page .btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

body.auth-page .btn-primary:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* ===================================
   BOOTSTRAP COMPATIBILITY OVERRIDES - AUTH SCOPED
=================================== */
/* Ensure our modern design takes precedence over Bootstrap */

body.auth-page .alert {
  /* Override Bootstrap alert styles to match our design */
  border-radius: 8px;
  border: none;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

body.auth-page .alert-success {
  background: #f0fff4;
  color: #22543d;
  border: 1px solid #9ae6b4;
}

body.auth-page .alert-danger {
  background: #fed7d7;
  color: #742a2a;
  border: 1px solid #feb2b2;
}

/* Ensure form elements use our modern styling */
body.auth-page .form-control,
body.auth-page .form-select {
  /* Reset Bootstrap styles */
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  transition: all 0.2s ease;
  background: #ffffff;
  color: #1a202c;
}

body.auth-page .form-control:focus,
body.auth-page .form-select:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  outline: none;
}

/* Override Bootstrap button styles */
body.auth-page .btn {
  border: none;
  border-radius: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.2s ease;
}

body.auth-page .btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0.875rem 1rem;
}

body.auth-page .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Ensure full height for auth container when used with templates */
body.auth-page:has(.auth-container) {
  margin: 0;
  padding: 0;
  height: 100vh;
  overflow-x: hidden;
}

/* Additional mobile optimizations */
@media (max-width: 576px) {
  body.auth-page .auth-left-panel {
    min-height: 25vh;
    padding: 1rem;
  }
  
  body.auth-page .auth-title {
    font-size: 1.5rem;
  }
  
  body.auth-page .auth-subtitle {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }
  
  body.auth-page .auth-right-panel {
    padding: 1rem 0.75rem;
  }
}