/* =====================================================================
   EnrollmentPRO — Global Design System
   A single source of truth for all styling across the application.
   ===================================================================== */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── Design Tokens ──────────────────────────────────────────────────── */
:root {
  /* Color Palette */
  --color-primary: #0f172a;
  --color-primary-light: #334155;
  --color-primary-lighter: #94a3b8;
  --color-primary-dark: #020617;
  --color-primary-glow: rgba(15, 23, 42, 0.15);
  --color-primary-subtle: #f8fafc;

  --color-accent: #0d9488;
  --color-accent-light: #14b8a6;
  --color-accent-dark: #0f766e;

  --color-bg: #f8fafc;
  --color-surface: rgba(255, 255, 255, 0.8);
  --color-surface-alt: #f1f5f9;
  --color-surface-hover: #e2e8f0;

  --color-text: #0f172a;
  --color-text-secondary: #334155;
  --color-text-muted: #64748b;
  --color-text-inverse: #ffffff;

  --color-border: rgba(0, 0, 0, 0.05);
  --color-border-light: rgba(0, 0, 0, 0.02);

  --color-success: #059669;
  --color-success-bg: #ecfdf5;
  --color-error: #e11d48;
  --color-error-bg: #fff1f2;
  --color-warning: #d97706;
  --color-warning-bg: #fffbeb;
  --color-info: #0284c7;
  --color-info-bg: #f0f9ff;

  --gradient-primary: linear-gradient(135deg, #0f172a 0%, #334155 100%);
  --gradient-accent: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
  --gradient-hero: radial-gradient(circle at top right, #f0fdfa 0%, #f8fafc 100%);
  --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.1) 100%);

  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
  --glass-blur: blur(12px);

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  --font-size-5xl: 3rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Layout */
  --max-width: 1200px;
  --header-height: 72px;

  /* Borders & Shadows */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
  --shadow-glow: 0 0 20px rgba(13, 148, 136, 0.3);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}


/* ── Reset & Base ───────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: var(--header-height);
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: -10%;
  right: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.08) 0%, transparent 70%);
  z-index: -1;
  animation: float 20s infinite alternate;
}

body::after {
  content: '';
  position: fixed;
  bottom: -10%;
  left: -10%;
  width: 40vw;
  height: 40vw;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.05) 0%, transparent 70%);
  z-index: -1;
  animation: float 25s infinite alternate-reverse;
}

@keyframes float {
  from { transform: translate(0, 0); }
  to { transform: translate(10%, 10%); }
}


/* ── Layout ─────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.page-content {
  flex: 1;
  padding: var(--space-8) 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}


/* ── Header ─────────────────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--glass-bg);
  height: var(--header-height);
  display: flex;
  align-items: center;
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.header-logo {
  font-size: var(--font-size-2xl);
  font-weight: 900;
  color: var(--color-primary);
  cursor: pointer;
  transition: all var(--transition-base);
  letter-spacing: -0.04em;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-logo:hover {
  color: var(--color-primary-lighter);
  transform: scale(1.03);
}

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

.nav-link {
  color: var(--color-text-secondary);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: var(--font-size-sm);
  transition: all var(--transition-base);
  cursor: pointer;
  border: none;
  background: transparent;
  white-space: nowrap;
}

.nav-link:hover {
  background: var(--color-primary-subtle);
  color: var(--color-accent);
  transform: translateY(-1px);
}

.nav-link--active {
  background: var(--color-primary-glow);
  color: var(--color-accent);
}

.nav-link--cta {
  background: var(--gradient-accent);
  color: white !important;
  box-shadow: var(--shadow-sm);
}

.nav-link--cta:hover {
  background: #fff;
  color: var(--color-primary-dark);
  box-shadow: var(--shadow-md);
}

/* Dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  min-width: 220px;
  padding: var(--space-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-base);
  z-index: 110;
  border: 1px solid var(--color-border);
}

.nav-dropdown-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-link {
  display: block;
  padding: var(--space-3) var(--space-4);
  color: var(--color-text);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.nav-dropdown-link:hover {
  background: var(--color-primary-subtle);
  color: var(--color-primary);
  transform: translateX(4px);
}

/* Mobile menu toggle */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--space-2);
}


/* ── Footer ─────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--gradient-header);
  color: var(--color-text-inverse);
  padding: var(--space-12) 0 var(--space-8);
  margin-top: auto;
}

.footer-content {
  text-align: center;
}

.footer-brand {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-2);
}

.footer-tagline {
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: var(--space-6);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--space-8);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
  font-size: var(--font-size-sm);
  transition: all var(--transition-base);
}

.footer-links a:hover {
  color: var(--color-primary-lighter);
}

.footer-copy {
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: var(--space-6);
}


/* ── Cards ──────────────────────────────────────────────────────────── */
.card {
  background: var(--glass-bg);
  border-radius: var(--radius-2xl);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  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(--color-border);
  font-weight: 700;
  font-size: var(--font-size-lg);
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.card-body {
  padding: var(--space-6);
}

.card-gradient {
  background: var(--gradient-card);
  color: var(--color-text-inverse);
  border: none;
}

.card-gradient .card-header {
  border-bottom-color: rgba(255, 255, 255, 0.2);
  color: var(--color-text-inverse);
}

/* Stat card */
.stat-card {
  padding: var(--space-6);
  text-align: center;
}

.stat-value {
  font-size: var(--font-size-4xl);
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: var(--space-2);
}

.stat-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Quick-access card */
.action-card {
  padding: var(--space-6);
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.action-card:hover {
  border-color: var(--color-primary);
}

.action-card-icon {
  font-size: 2rem;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background: var(--color-primary-subtle);
  color: var(--color-primary);
  transition: all var(--transition-base);
}

.action-card:hover .action-card-icon {
  background: var(--color-primary);
  color: white;
  transform: scale(1.1);
}

.action-card-title {
  font-weight: 600;
  font-size: var(--font-size-sm);
}


/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.5;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  box-shadow: var(--shadow-md), var(--shadow-glow);
  transform: translateY(-1px);
  color: white;
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-surface-alt);
  border-color: var(--color-text-muted);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--color-error);
  color: white;
}

.btn-danger:hover {
  background: #b91c1c;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--color-primary);
}

.btn-ghost:hover {
  background: var(--color-primary-glow);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--font-size-base);
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--font-size-xs);
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: var(--space-2);
}


/* ── Forms ──────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: var(--font-size-sm);
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.form-label--required::after {
  content: ' *';
  color: var(--color-error);
}

.form-input,
.form-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background: var(--color-surface);
  transition: all var(--transition-fast);
  outline: none;
}

.form-input:focus,
.form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-glow);
}

.form-input::placeholder {
  color: var(--color-text-muted);
}

.form-input--error {
  border-color: var(--color-error);
}

.form-input--error:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.form-input--success {
  border-color: var(--color-success);
}

.form-error {
  font-size: var(--font-size-xs);
  color: var(--color-error);
  margin-top: var(--space-1);
}

.form-help {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.form-card {
  max-width: 480px;
  margin: 0 auto;
  background: var(--color-surface);
  padding: var(--space-8);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
}


/* ── Tables ─────────────────────────────────────────────────────────── */
.table-wrapper {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-border);
  font-weight: 700;
  font-size: var(--font-size-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  background: var(--color-surface-alt);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.data-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.data-table tbody tr {
  transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
  background: var(--color-primary-subtle);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.table-empty {
  text-align: center;
  padding: var(--space-10) var(--space-4);
  color: var(--color-text-muted);
  font-style: italic;
}


/* ── Badges ─────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-success {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.badge-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.badge-error {
  background: var(--color-error-bg);
  color: var(--color-error);
}

.badge-info {
  background: var(--color-info-bg);
  color: var(--color-info);
}

.badge-neutral {
  background: var(--color-surface-alt);
  color: var(--color-text-secondary);
}


/* ── Toast Notifications ────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + var(--space-4));
  right: var(--space-4);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.toast {
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-sm);
  font-weight: 500;
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 300px;
  max-width: 450px;
  animation: slideInRight var(--transition-bounce) forwards;
  border-left: 4px solid;
}

.toast-success {
  background: var(--color-success-bg);
  color: #15803d;
  border-color: var(--color-success);
}

.toast-error {
  background: var(--color-error-bg);
  color: #991b1b;
  border-color: var(--color-error);
}

.toast-warning {
  background: var(--color-warning-bg);
  color: #92400e;
  border-color: var(--color-warning);
}

.toast-info {
  background: var(--color-info-bg);
  color: #1e40af;
  border-color: var(--color-info);
}

.toast-close {
  margin-left: auto;
  background: none;
  border: none;
  font-size: var(--font-size-lg);
  cursor: pointer;
  opacity: 0.5;
  transition: opacity var(--transition-fast);
  color: inherit;
}

.toast-close:hover {
  opacity: 1;
}

.toast-exit {
  animation: slideOutRight var(--transition-base) forwards;
}


/* ── Page-Specific Layouts ──────────────────────────────────────────── */

/* Auth layout (centered form) */
.auth-layout {
  min-height: calc(100vh - var(--header-height));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-4);
  background: var(--gradient-hero);
}

.auth-card {
  width: 100%;
  max-width: 440px;
}

.auth-title {
  font-size: var(--font-size-3xl);
  font-weight: 800;
  text-align: center;
  margin-bottom: var(--space-2);
  color: var(--color-text);
}

.auth-subtitle {
  text-align: center;
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
  font-size: var(--font-size-sm);
}

.auth-footer {
  text-align: center;
  margin-top: var(--space-6);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.auth-footer a {
  font-weight: 600;
}

/* Dashboard layout */
.dashboard-header {
  margin-bottom: var(--space-8);
}

.dashboard-title {
  font-size: var(--font-size-3xl);
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.dashboard-subtitle {
  font-size: var(--font-size-base);
  color: var(--color-text-muted);
}

/* Page title with underline */
.page-title {
  font-size: var(--font-size-3xl);
  font-weight: 800;
  color: var(--color-text);
  text-align: center;
  margin-bottom: var(--space-8);
  position: relative;
  display: inline-block;
}

.page-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 3px;
  background: var(--gradient-header);
  border-radius: 2px;
}

.page-title-container {
  text-align: center;
  padding: var(--space-8) 0 var(--space-4);
}


/* ── Hero Section ───────────────────────────────────────────────────── */
.hero {
  background: var(--gradient-hero);
  padding: var(--space-20) 0;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: var(--color-primary-glow);
  filter: blur(100px);
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: var(--font-size-5xl);
  font-weight: 900;
  color: var(--color-text);
  line-height: 1.1;
  margin-bottom: var(--space-6);
  letter-spacing: -0.03em;
}

.hero-title span {
  background: var(--gradient-card);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-description {
  font-size: var(--font-size-xl);
  color: var(--color-text-secondary);
  max-width: 560px;
  margin-bottom: var(--space-8);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.hero-image {
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  transition: transform var(--transition-slow);
}

.hero-image:hover {
  transform: scale(1.02) rotate(-1deg);
}


/* ── Feature Cards ──────────────────────────────────────────────────── */
.features-section {
  padding: var(--space-20) 0;
}

.section-title {
  font-size: var(--font-size-4xl);
  font-weight: 800;
  text-align: center;
  margin-bottom: var(--space-4);
  color: var(--color-text);
}

.section-subtitle {
  text-align: center;
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto var(--space-12);
  font-size: var(--font-size-lg);
}

.feature-card {
  padding: var(--space-8);
  text-align: center;
}

.feature-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin: 0 auto var(--space-5);
  background: var(--color-primary-subtle);
  color: var(--color-primary);
  transition: all var(--transition-base);
}

.feature-card:hover .feature-icon {
  background: var(--color-primary);
  color: white;
  transform: scale(1.1) rotate(-5deg);
  box-shadow: var(--shadow-glow);
}

.feature-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.feature-desc {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  line-height: 1.6;
}


/* ── Profile Card ───────────────────────────────────────────────────── */
.profile-card {
  text-align: center;
  padding: var(--space-8);
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: var(--gradient-card);
  color: white;
  font-size: var(--font-size-3xl);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
  box-shadow: var(--shadow-md);
}

.profile-name {
  font-size: var(--font-size-xl);
  font-weight: 700;
  margin-bottom: var(--space-1);
}

.profile-role {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}

.profile-id {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  font-family: monospace;
}


/* ── Loading State ──────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg,
    var(--color-surface-alt) 25%,
    var(--color-surface-hover) 50%,
    var(--color-surface-alt) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
  border-radius: var(--radius-md);
}

.skeleton-text {
  height: 1em;
  margin-bottom: var(--space-2);
}

.skeleton-heading {
  height: 1.5em;
  width: 60%;
  margin-bottom: var(--space-4);
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  backdrop-filter: blur(4px);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}


/* ── Role Toggle (Signup) ───────────────────────────────────────────── */
.role-toggle {
  display: flex;
  background: var(--color-surface-alt);
  border-radius: var(--radius-lg);
  padding: var(--space-1);
  margin-bottom: var(--space-6);
  border: 1px solid var(--color-border);
}

.role-toggle-btn {
  flex: 1;
  padding: var(--space-3);
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-base);
}

.role-toggle-btn.active {
  background: var(--color-surface);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}


/* ── Utility Classes ────────────────────────────────────────────────── */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--color-text-muted); }
.text-primary { color: var(--color-primary); }
.text-error { color: var(--color-error); }
.text-success { color: var(--color-success); }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }


/* ── Animations ─────────────────────────────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100px); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.animate-fade-in { animation: fadeIn var(--transition-slow) forwards; }
.animate-fade-in-up { animation: fadeInUp var(--transition-slow) forwards; }
.animate-scale-in { animation: scaleIn var(--transition-bounce) forwards; }

/* Staggered children */
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 80ms; }
.stagger > *:nth-child(3) { animation-delay: 160ms; }
.stagger > *:nth-child(4) { animation-delay: 240ms; }
.stagger > *:nth-child(5) { animation-delay: 320ms; }
.stagger > *:nth-child(6) { animation-delay: 400ms; }
.stagger > *:nth-child(7) { animation-delay: 480ms; }
.stagger > *:nth-child(8) { animation-delay: 560ms; }


/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root {
    --header-height: 60px;
  }

  .header-logo {
    font-size: var(--font-size-2xl);
  }

  .header-nav {
    display: none;
  }

  .header-nav.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: #1e293b;
    padding: var(--space-4);
    gap: var(--space-1);
    box-shadow: var(--shadow-xl);
    animation: fadeIn var(--transition-base) forwards;
  }

  .mobile-menu-btn {
    display: block;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: var(--space-12) 0;
  }

  .hero-title {
    font-size: var(--font-size-4xl);
  }

  .hero-description {
    font-size: var(--font-size-base);
  }

  .form-card {
    padding: var(--space-6);
  }

  .container {
    padding: 0 var(--space-4);
  }

  .hero-layout {
    flex-direction: column;
  }

  .hero-image {
    max-width: 100%;
  }

  .footer-links {
    flex-direction: column;
    gap: var(--space-3);
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: var(--font-size-3xl);
  }

  .form-card {
    padding: var(--space-4);
  }

  .auth-title {
    font-size: var(--font-size-2xl);
  }
}


/* ── Missing Token Definitions ──────────────────────────────────────── */
/* These were referenced across files but not defined in :root */
:root {
  --gradient-card: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  --gradient-header: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}


/* ── Page Subtitle ──────────────────────────────────────────────────── */
/* Used in browse-courses.html and other page headers */
.page-subtitle {
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--font-size-base);
  margin-top: calc(-1 * var(--space-6));
  margin-bottom: var(--space-6);
}


/* ── Spinner (inline button loading) ───────────────────────────────── */
/* Overrides the 40px standalone spinner for inline use inside buttons */
.btn .spinner,
span.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}


/* ── Modal / Confirm Dialog ─────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn var(--transition-fast) forwards;
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  padding: var(--space-8);
  max-width: 420px;
  width: 90%;
  animation: scaleIn var(--transition-bounce) forwards;
  border: 1px solid var(--color-border);
}

.modal-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  margin-bottom: var(--space-3);
  color: var(--color-text);
}

.modal-body {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  line-height: 1.7;
  margin-bottom: var(--space-6);
}

.modal-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
}


/* ── Table Action Cell Flex Fix ─────────────────────────────────────── */
/* Prevents action td from being block which can break layout on narrow screens */
td:has(.btn) {
  white-space: nowrap;
}

/* ── Nav link logout button base fix ───────────────────────────────── */
.nav-link--logout {
  color: var(--color-text-muted);
}

.nav-link--logout:hover {
  color: var(--color-error);
  background: var(--color-error-bg);
}

