/* ================================================================
   EthicsComputer Design System v3.0 — Enterprise UI Language
   ================================================================
   Tokens → Typography → Layout → Buttons → Cards → Forms
   Badges → Skeletons → Animations → Accessibility → Dark Mode
   ================================================================ */

/* ─────────────────────────────────────────────────────────────
   DESIGN TOKENS  (CSS Custom Properties)
   ─────────────────────────────────────────────────────────────*/
:root {
  /* ── Brand — Single Source of Truth ── */
  --ec-primary:        #0ea5e9;
  --ec-primary-dark:   #0284c7;
  --ec-primary-deep:   #0369a1;
  --ec-primary-light:  #e0f2fe;
  --ec-primary-glow:   rgba(14, 165, 233, 0.25);
  --ec-primary-rgb:    14, 165, 233;

  /* ── Accent (use sparingly — only for highlights) ── */
  --ec-accent:         #6366f1;
  --ec-accent-rgb:     99, 102, 241;

  /* ── Semantic Feedback Colors ── */
  --ec-success:        #10b981;
  --ec-success-light:  #d1fae5;
  --ec-success-rgb:    16, 185, 129;
  --ec-warning:        #f59e0b;
  --ec-warning-light:  #fef3c7;
  --ec-warning-rgb:    245, 158, 11;
  --ec-danger:         #f43f5e;
  --ec-danger-light:   #ffe4e6;
  --ec-danger-rgb:     244, 63, 94;
  --ec-info:           #6366f1;
  --ec-info-light:     #ede9fe;

  /* ── Neutral Scale ── */
  --ec-slate-50:   #f8fafc;
  --ec-slate-100:  #f1f5f9;
  --ec-slate-200:  #e2e8f0;
  --ec-slate-300:  #cbd5e1;
  --ec-slate-400:  #94a3b8;
  --ec-slate-500:  #64748b;
  --ec-slate-600:  #475569;
  --ec-slate-700:  #334155;
  --ec-slate-800:  #1e293b;
  --ec-slate-900:  #0f172a;
  --ec-slate-950:  #020617;

  /* ── Typography ── */
  --ec-font-heading: 'Outfit', system-ui, sans-serif;
  --ec-font-body:    'Plus Jakarta Sans', system-ui, sans-serif;
  --ec-font-mono:    'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

  /* ── Type Scale (WCAG: min 12px for all visible text) ── */
  --ec-text-2xs: 0.75rem;   /* 12px — hard minimum */
  --ec-text-xs:  0.8125rem; /* 13px */
  --ec-text-sm:  0.875rem;  /* 14px */
  --ec-text-base:1rem;      /* 16px */
  --ec-text-lg:  1.125rem;  /* 18px */
  --ec-text-xl:  1.25rem;   /* 20px */
  --ec-text-2xl: 1.5rem;    /* 24px */
  --ec-text-3xl: 1.875rem;  /* 30px */
  --ec-text-4xl: 2.25rem;   /* 36px */
  --ec-text-5xl: 3rem;      /* 48px */

  /* ── Border Radius ── */
  --ec-r-xs:   0.375rem;  /* 6px */
  --ec-r-sm:   0.5rem;    /* 8px */
  --ec-r-md:   0.75rem;   /* 12px */
  --ec-r-lg:   1rem;      /* 16px */
  --ec-r-xl:   1.25rem;   /* 20px */
  --ec-r-2xl:  1.5rem;    /* 24px */
  --ec-r-3xl:  2rem;      /* 32px */
  --ec-r-4xl:  2.5rem;    /* 40px */
  --ec-r-5xl:  3rem;      /* 48px */
  --ec-r-full: 9999px;

  /* ── Elevation / Shadows ── */
  --ec-shadow-xs:      0 1px 2px rgba(0,0,0,0.05);
  --ec-shadow-sm:      0 1px 4px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.04);
  --ec-shadow-md:      0 4px 16px rgba(0,0,0,0.07), 0 2px 6px rgba(0,0,0,0.04);
  --ec-shadow-lg:      0 16px 48px -12px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.05);
  --ec-shadow-xl:      0 24px 64px -12px rgba(0,0,0,0.16), 0 8px 20px rgba(0,0,0,0.07);
  --ec-shadow-2xl:     0 40px 80px -16px rgba(0,0,0,0.22), 0 12px 32px rgba(0,0,0,0.08);
  --ec-shadow-primary: 0 8px 32px rgba(var(--ec-primary-rgb), 0.28);
  --ec-shadow-glow:    0 0 60px rgba(var(--ec-primary-rgb), 0.18);
  --ec-shadow-glass:   0 8px 32px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.1);

  /* ── Transitions ── */
  --ec-ease-fast:   150ms cubic-bezier(0.4, 0, 0.2, 1);
  --ec-ease-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --ec-ease-slow:   500ms cubic-bezier(0.16, 1, 0.3, 1);
  --ec-ease-spring: 700ms cubic-bezier(0.16, 1, 0.3, 1);
  --ec-ease-bounce: 600ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ── Glassmorphism ── */
  --ec-glass-light:     rgba(255, 255, 255, 0.06);
  --ec-glass-medium:    rgba(255, 255, 255, 0.10);
  --ec-glass-strong:    rgba(255, 255, 255, 0.14);
  --ec-glass-border:    rgba(255, 255, 255, 0.10);
  --ec-glass-border-lg: rgba(255, 255, 255, 0.16);

  /* ── Spacing ── */
  --ec-space-section:   clamp(4rem, 8vw, 7rem);
  --ec-space-section-sm:clamp(2.5rem, 5vw, 4rem);
}

/* ─────────────────────────────────────────────────────────────
   GLOBAL BASE
   ─────────────────────────────────────────────────────────────*/
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--ec-font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ─────────────────────────────────────────────────────────────
   ACCESSIBILITY — SKIP NAVIGATION
   ─────────────────────────────────────────────────────────────*/
.skip-nav {
  position: fixed;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  padding: 0.75rem 1.5rem;
  background: var(--ec-primary);
  color: #fff;
  font-weight: 700;
  font-size: var(--ec-text-sm);
  border-radius: var(--ec-r-lg);
  text-decoration: none;
  transition: top var(--ec-ease-fast);
  box-shadow: var(--ec-shadow-primary);
}

.skip-nav:focus {
  top: 1rem;
  outline: 3px solid rgba(255,255,255,0.8);
  outline-offset: 3px;
}

/* ─────────────────────────────────────────────────────────────
   ACCESSIBILITY — FOCUS RING
   ─────────────────────────────────────────────────────────────*/
:focus-visible {
  outline: 2px solid var(--ec-primary);
  outline-offset: 3px;
  border-radius: var(--ec-r-xs);
}

:focus:not(:focus-visible) {
  outline: none;
}

/* High-contrast interactive targets (WCAG 2.5.5: min 44x44px touch) */
a, button, [role="button"] {
  min-height: 0; /* only enforce on interactive */
  -webkit-tap-highlight-color: transparent;
}

/* ─────────────────────────────────────────────────────────────
   TYPOGRAPHY SYSTEM
   ─────────────────────────────────────────────────────────────*/

/* Enforce WCAG minimum 12px on labels/eyebrows */
.ec-eyebrow {
  font-family: var(--ec-font-body);
  font-size: var(--ec-text-2xs);  /* 12px — WCAG minimum */
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ec-primary);
  line-height: 1.4;
}

.ec-eyebrow-muted {
  color: var(--ec-slate-400);
}

.ec-label {
  font-size: var(--ec-text-2xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ec-slate-500);
  line-height: 1.4;
}

/* Display headings */
.ec-display {
  font-family: var(--ec-font-heading);
  font-size: clamp(2.75rem, 7vw, 5.5rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.ec-h1 {
  font-family: var(--ec-font-heading);
  font-size: clamp(2.25rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.ec-h2 {
  font-family: var(--ec-font-heading);
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.ec-h3 {
  font-family: var(--ec-font-heading);
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.ec-body-lg {
  font-family: var(--ec-font-body);
  font-size: var(--ec-text-lg);
  line-height: 1.75;
  color: var(--ec-slate-500);
}

.ec-body {
  font-family: var(--ec-font-body);
  font-size: var(--ec-text-base);
  line-height: 1.7;
  color: var(--ec-slate-600);
}

/* ─────────────────────────────────────────────────────────────
   GRADIENT UTILITIES
   ─────────────────────────────────────────────────────────────*/
.ec-gradient-primary {
  background: linear-gradient(135deg, var(--ec-primary) 0%, var(--ec-accent) 100%);
}

.ec-gradient-dark {
  background: linear-gradient(135deg, var(--ec-slate-900) 0%, var(--ec-slate-800) 100%);
}

.ec-text-gradient {
  background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.65) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ec-text-gradient-brand {
  background: linear-gradient(135deg, var(--ec-primary) 0%, var(--ec-accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ec-text-gradient-dark {
  background: linear-gradient(135deg, var(--ec-slate-900) 0%, var(--ec-primary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ─────────────────────────────────────────────────────────────
   BUTTON SYSTEM
   ─────────────────────────────────────────────────────────────*/
.ec-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--ec-font-body);
  font-weight: 700;
  font-size: var(--ec-text-sm);
  border-radius: var(--ec-r-full);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  min-height: 44px;  /* WCAG 2.5.5 touch target */
  padding: 0 1.5rem;
  transition:
    transform var(--ec-ease-normal),
    box-shadow var(--ec-ease-normal),
    background-color var(--ec-ease-fast),
    border-color var(--ec-ease-fast);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.ec-btn:active {
  transform: scale(0.97) !important;
}

/* Primary */
.ec-btn-primary {
  background: var(--ec-primary);
  color: #fff;
  border-color: var(--ec-primary);
  box-shadow: 0 4px 20px rgba(var(--ec-primary-rgb), 0.30);
}

.ec-btn-primary:hover {
  background: var(--ec-primary-dark);
  border-color: var(--ec-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(var(--ec-primary-rgb), 0.38);
}

.ec-btn-primary:focus-visible {
  outline-color: var(--ec-primary);
}

/* Shimmer effect */
.ec-btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  transition: left 0.55s ease;
}
.ec-btn-primary:hover::before { left: 100%; }

/* Large variant */
.ec-btn-lg {
  min-height: 52px;
  padding: 0 2rem;
  font-size: var(--ec-text-base);
}

/* Ghost / Outline */
.ec-btn-ghost {
  background: transparent;
  color: var(--ec-slate-600);
  border-color: var(--ec-slate-200);
}

.ec-btn-ghost:hover {
  border-color: var(--ec-primary);
  color: var(--ec-primary);
  background: var(--ec-primary-light);
  transform: translateY(-1px);
}

/* Ghost on dark backgrounds */
.ec-btn-ghost-dark {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.8);
  border-color: rgba(255,255,255,0.14);
}

.ec-btn-ghost-dark:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-color: rgba(255,255,255,0.28);
  transform: translateY(-1px);
}

/* Danger */
.ec-btn-danger {
  background: var(--ec-danger);
  color: #fff;
  border-color: var(--ec-danger);
  box-shadow: 0 4px 16px rgba(var(--ec-danger-rgb), 0.25);
}

.ec-btn-danger:hover {
  background: #e11d48;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(var(--ec-danger-rgb), 0.35);
}

/* Icon-only circular button */
.ec-btn-icon {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────────────
   CARD SYSTEM
   ─────────────────────────────────────────────────────────────*/
.ec-card {
  background: #fff;
  border: 1px solid var(--ec-slate-100);
  border-radius: var(--ec-r-3xl);
  box-shadow: var(--ec-shadow-md);
  overflow: hidden;
  transition:
    transform var(--ec-ease-slow),
    box-shadow var(--ec-ease-slow),
    border-color var(--ec-ease-slow);
}

.ec-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--ec-shadow-xl);
  border-color: var(--ec-slate-200);
}

.ec-card-dark {
  background: rgba(15, 23, 42, 0.70);
  backdrop-filter: blur(24px) saturate(120%);
  -webkit-backdrop-filter: blur(24px) saturate(120%);
  border: 1px solid var(--ec-glass-border);
  border-radius: var(--ec-r-3xl);
  overflow: hidden;
  transition:
    transform var(--ec-ease-slow),
    box-shadow var(--ec-ease-slow),
    border-color var(--ec-ease-slow);
}

.ec-card-dark:hover {
  transform: translateY(-6px);
  border-color: rgba(var(--ec-primary-rgb), 0.35);
  box-shadow: 0 32px 64px rgba(0,0,0,0.5), 0 0 0 1px rgba(var(--ec-primary-rgb), 0.18);
}

/* Stat / data-dense cards */
.ec-stat-card {
  background: #fff;
  border: 1px solid var(--ec-slate-100);
  border-radius: var(--ec-r-2xl);
  padding: 1.5rem;
  box-shadow: var(--ec-shadow-sm);
  overflow: hidden;
  position: relative;
  transition:
    transform var(--ec-ease-slow),
    box-shadow var(--ec-ease-slow),
    border-color var(--ec-ease-slow);
}

.ec-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--ec-shadow-lg);
  border-color: var(--ec-slate-200);
}

/* Service feature cards */
.ec-feature-card {
  padding: 2rem;
  border-radius: var(--ec-r-3xl);
  border: 1px solid transparent;
  background: var(--ec-slate-50);
  transition: all var(--ec-ease-slow);
}

.ec-feature-card:hover {
  background: #fff;
  border-color: rgba(var(--ec-primary-rgb), 0.12);
  box-shadow: var(--ec-shadow-lg);
  transform: translateY(-4px);
}

/* ─────────────────────────────────────────────────────────────
   FORM SYSTEM
   ─────────────────────────────────────────────────────────────*/
.ec-field {
  position: relative;
}

.ec-field-label {
  display: block;
  font-size: var(--ec-text-2xs);   /* 12px WCAG minimum */
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ec-slate-500);
  margin-bottom: 0.5rem;
  transition: color var(--ec-ease-fast);
  line-height: 1.4;
}

.ec-field:focus-within .ec-field-label {
  color: var(--ec-primary);
}

.ec-input {
  width: 100%;
  min-height: 48px;  /* WCAG 2.5.5 */
  padding: 0.875rem 1.25rem;
  background: var(--ec-slate-50);
  border: 1.5px solid var(--ec-slate-200);
  border-radius: var(--ec-r-xl);
  font-family: var(--ec-font-body);
  font-size: var(--ec-text-sm);
  color: var(--ec-slate-900);
  outline: none;
  transition:
    border-color var(--ec-ease-fast),
    background-color var(--ec-ease-fast),
    box-shadow var(--ec-ease-fast);
  appearance: none;
  -webkit-appearance: none;
}

.ec-input::placeholder {
  color: var(--ec-slate-400);
  font-weight: 400;
}

.ec-input:hover {
  border-color: var(--ec-slate-300);
  background: #fff;
}

.ec-input:focus {
  border-color: var(--ec-primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(var(--ec-primary-rgb), 0.08);
}

.ec-input.is-error {
  border-color: var(--ec-danger);
  background: #fff5f6;
}

.ec-input.is-error:focus {
  box-shadow: 0 0 0 4px rgba(var(--ec-danger-rgb), 0.08);
}

.ec-input.is-valid {
  border-color: var(--ec-success);
  background: #f0fdf8;
}

.ec-select-wrapper {
  position: relative;
}

.ec-select-wrapper::after {
  content: '';
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--ec-slate-400);
  pointer-events: none;
  transition: border-color var(--ec-ease-fast);
}

.ec-select-wrapper:focus-within::after {
  border-top-color: var(--ec-primary);
}

.ec-select-wrapper select.ec-input {
  padding-right: 3rem;
  cursor: pointer;
}

.ec-textarea {
  resize: vertical;
  min-height: 7rem;
}

.ec-field-error {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: var(--ec-text-2xs);   /* 12px */
  font-weight: 500;
  color: var(--ec-danger);
  margin-top: 0.375rem;
  line-height: 1.4;
}

.ec-field-hint {
  font-size: var(--ec-text-2xs);
  color: var(--ec-slate-500);
  margin-top: 0.375rem;
  line-height: 1.4;
}

/* ─────────────────────────────────────────────────────────────
   BADGE / TAG SYSTEM
   ─────────────────────────────────────────────────────────────*/
.ec-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3rem 0.875rem;
  border-radius: var(--ec-r-full);
  font-size: var(--ec-text-2xs);   /* 12px */
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  line-height: 1.4;
}

.ec-badge-primary  { background: rgba(var(--ec-primary-rgb), 0.12);  color: var(--ec-primary-deep);  border: 1px solid rgba(var(--ec-primary-rgb), 0.2); }
.ec-badge-success  { background: rgba(var(--ec-success-rgb), 0.10);  color: #065f46;                 border: 1px solid rgba(var(--ec-success-rgb), 0.2); }
.ec-badge-warning  { background: rgba(var(--ec-warning-rgb), 0.10);  color: #92400e;                 border: 1px solid rgba(var(--ec-warning-rgb), 0.2); }
.ec-badge-danger   { background: rgba(var(--ec-danger-rgb), 0.10);   color: #9f1239;                 border: 1px solid rgba(var(--ec-danger-rgb), 0.2); }
.ec-badge-neutral  { background: var(--ec-slate-100);                color: var(--ec-slate-600);     border: 1px solid var(--ec-slate-200); }
.ec-badge-accent   { background: rgba(var(--ec-accent-rgb), 0.12);   color: #4338ca;                 border: 1px solid rgba(var(--ec-accent-rgb), 0.2); }

/* Status dot badges */
.ec-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--ec-text-2xs);
  font-weight: 600;
}

.ec-status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ec-status-active::before  { background: var(--ec-success); box-shadow: 0 0 0 2px rgba(var(--ec-success-rgb), 0.2); }
.ec-status-warning::before { background: var(--ec-warning); box-shadow: 0 0 0 2px rgba(var(--ec-warning-rgb), 0.2); }
.ec-status-danger::before  { background: var(--ec-danger);  box-shadow: 0 0 0 2px rgba(var(--ec-danger-rgb), 0.2); }
.ec-status-neutral::before { background: var(--ec-slate-400); }

/* ─────────────────────────────────────────────────────────────
   SKELETON LOADERS
   ─────────────────────────────────────────────────────────────*/
@keyframes ec-skeleton-shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.ec-skeleton {
  background: var(--ec-slate-100);
  border-radius: var(--ec-r-md);
  position: relative;
  overflow: hidden;
}

.ec-skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.7), transparent);
  animation: ec-skeleton-shimmer 1.6s ease-in-out infinite;
}

.ec-skeleton-dark {
  background: rgba(255,255,255,0.06);
}
.ec-skeleton-dark::after {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
}

.ec-skeleton-text   { height: 1rem; }
.ec-skeleton-title  { height: 1.5rem; width: 60%; }
.ec-skeleton-avatar { width: 2.5rem; height: 2.5rem; border-radius: 50%; }
.ec-skeleton-card   { height: 8rem; border-radius: var(--ec-r-2xl); }
.ec-skeleton-btn    { height: 44px; width: 120px; border-radius: var(--ec-r-full); }

/* ─────────────────────────────────────────────────────────────
   SECTION LAYOUT
   ─────────────────────────────────────────────────────────────*/
.ec-section {
  padding: var(--ec-space-section) 0;
}

.ec-section-sm {
  padding: var(--ec-space-section-sm) 0;
}

.ec-section-header {
  margin-bottom: clamp(2.5rem, 5vw, 5rem);
}

.ec-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (min-width: 1024px) {
  .ec-container {
    padding: 0 2rem;
  }
}

/* ─────────────────────────────────────────────────────────────
   GLASS PANEL
   ─────────────────────────────────────────────────────────────*/
.ec-glass {
  background: var(--ec-glass-light);
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  border: 1px solid var(--ec-glass-border);
}

.ec-glass-strong {
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(32px) saturate(150%);
  -webkit-backdrop-filter: blur(32px) saturate(150%);
  border: 1px solid var(--ec-glass-border-lg);
}

.ec-glass-white {
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  border: 1px solid rgba(255,255,255,0.6);
}

/* ─────────────────────────────────────────────────────────────
   DIVIDER
   ─────────────────────────────────────────────────────────────*/
.ec-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ec-slate-200), transparent);
  border: none;
  margin: 0;
}

.ec-divider-dark {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}

/* ─────────────────────────────────────────────────────────────
   SECTION SEPARATOR (gradient blending)
   ─────────────────────────────────────────────────────────────*/
.ec-section-blend-bottom {
  position: relative;
}
.ec-section-blend-bottom::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 6rem;
  background: inherit;
  background: linear-gradient(to bottom, transparent, var(--ec-next-bg, #fff));
  pointer-events: none;
}

/* ─────────────────────────────────────────────────────────────
   TOAST NOTIFICATIONS
   ─────────────────────────────────────────────────────────────*/
.ec-toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--ec-r-xl);
  box-shadow: var(--ec-shadow-lg);
  font-size: var(--ec-text-sm);
  font-weight: 500;
  max-width: 24rem;
  animation: ec-toast-in 0.4s var(--ec-ease-spring) both;
  position: relative;
  overflow: hidden;
}

@keyframes ec-toast-in {
  from { opacity: 0; transform: translateY(1rem) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ec-toast-success {
  background: #fff;
  border: 1px solid var(--ec-success-light);
  border-left: 4px solid var(--ec-success);
}
.ec-toast-error {
  background: #fff;
  border: 1px solid var(--ec-danger-light);
  border-left: 4px solid var(--ec-danger);
}
.ec-toast-info {
  background: #fff;
  border: 1px solid var(--ec-primary-light);
  border-left: 4px solid var(--ec-primary);
}
.ec-toast-warning {
  background: #fff;
  border: 1px solid var(--ec-warning-light);
  border-left: 4px solid var(--ec-warning);
}

/* ─────────────────────────────────────────────────────────────
   MODAL SYSTEM
   ─────────────────────────────────────────────────────────────*/
.ec-modal-backdrop {
  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.ec-modal {
  background: #fff;
  border-radius: var(--ec-r-3xl);
  box-shadow: var(--ec-shadow-2xl);
  position: relative;
  overflow: hidden;
  animation: ec-modal-in 0.35s var(--ec-ease-spring) both;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes ec-modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(1rem); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ─────────────────────────────────────────────────────────────
   FLOATING CTA BUTTON (premium sticky)
   ─────────────────────────────────────────────────────────────*/
.ec-floating-cta {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.875rem 1.5rem;
  background: var(--ec-primary);
  color: #fff;
  border: none;
  border-radius: var(--ec-r-full);
  font-family: var(--ec-font-body);
  font-size: var(--ec-text-sm);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 8px 32px rgba(var(--ec-primary-rgb), 0.4), 0 2px 8px rgba(0,0,0,0.15);
  transition: all var(--ec-ease-normal);
  white-space: nowrap;
}

.ec-floating-cta:hover {
  background: var(--ec-primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 16px 48px rgba(var(--ec-primary-rgb), 0.5), 0 4px 12px rgba(0,0,0,0.2);
}

.ec-floating-cta:active {
  transform: scale(0.97);
}

@media (max-width: 768px) {
  .ec-floating-cta {
    left: 1rem;
    bottom: 6rem; /* above WhatsApp button */
    padding: 0.75rem 1.25rem;
    font-size: 0.8125rem;
  }
}

/* ─────────────────────────────────────────────────────────────
   NAVIGATION ENHANCEMENTS
   ─────────────────────────────────────────────────────────────*/

/* Keyboard-accessible dropdown */
.ec-nav-dropdown {
  position: relative;
}

.ec-nav-dropdown-panel {
  position: absolute;
  top: calc(100% + 0.75rem);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.98);
  transition:
    opacity var(--ec-ease-normal),
    transform var(--ec-ease-normal),
    visibility 0s linear var(--ec-ease-normal);
  z-index: 50;
}

.ec-nav-dropdown:hover .ec-nav-dropdown-panel,
.ec-nav-dropdown:focus-within .ec-nav-dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  transition:
    opacity var(--ec-ease-normal),
    transform var(--ec-ease-normal),
    visibility 0s;
}

/* Nav link active indicator */
.ec-nav-link {
  position: relative;
}
.ec-nav-link.is-active::after {
  content: '';
  position: absolute;
  bottom: 0.25rem;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ec-primary);
}

/* ─────────────────────────────────────────────────────────────
   TABLE SYSTEM
   ─────────────────────────────────────────────────────────────*/
.ec-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--ec-text-sm);
}

.ec-table thead th {
  padding: 0.875rem 1.25rem;
  text-align: left;
  font-size: var(--ec-text-2xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ec-slate-500);
  background: var(--ec-slate-50);
  border-bottom: 1px solid var(--ec-slate-100);
}

.ec-table thead th:first-child { border-radius: var(--ec-r-lg) 0 0 0; }
.ec-table thead th:last-child  { border-radius: 0 var(--ec-r-lg) 0 0; }

.ec-table tbody tr {
  border-bottom: 1px solid var(--ec-slate-50);
  transition: background-color var(--ec-ease-fast);
}

.ec-table tbody tr:hover {
  background: rgba(var(--ec-primary-rgb), 0.03);
}

.ec-table tbody td {
  padding: 1rem 1.25rem;
  color: var(--ec-slate-700);
  vertical-align: middle;
}

/* ─────────────────────────────────────────────────────────────
   SCROLLBAR (Premium ghost style)
   ─────────────────────────────────────────────────────────────*/
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(148,163,184,0.22) transparent;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(148,163,184,0.22);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,0.4); }

/* ─────────────────────────────────────────────────────────────
   ANIMATION UTILITIES
   ─────────────────────────────────────────────────────────────*/

/* Float */
@keyframes ec-float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-10px); }
}
.ec-float         { animation: ec-float 4s ease-in-out infinite; }
.ec-float-delay   { animation: ec-float 4s ease-in-out infinite 2s; }
.ec-float-slow    { animation: ec-float 6s ease-in-out infinite; }

/* Pulse ring */
@keyframes ec-pulse-ring {
  0%   { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.2); opacity: 0; }
}
.ec-pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid currentColor;
  animation: ec-pulse-ring 2s ease-out infinite;
}
.ec-pulse-ring-delay { animation-delay: 0.75s; }

/* Fade in up */
@keyframes ec-fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ec-fade-up {
  animation: ec-fade-up 0.6s var(--ec-ease-spring) both;
}

/* Fade in */
@keyframes ec-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.ec-fade-in {
  animation: ec-fade-in 0.4s ease both;
}

/* Stagger utility */
.ec-stagger > * { animation: ec-fade-up 0.5s var(--ec-ease-spring) both; }
.ec-stagger > *:nth-child(1) { animation-delay:   0ms; }
.ec-stagger > *:nth-child(2) { animation-delay:  80ms; }
.ec-stagger > *:nth-child(3) { animation-delay: 160ms; }
.ec-stagger > *:nth-child(4) { animation-delay: 240ms; }
.ec-stagger > *:nth-child(5) { animation-delay: 320ms; }
.ec-stagger > *:nth-child(6) { animation-delay: 400ms; }
.ec-stagger > *:nth-child(7) { animation-delay: 480ms; }
.ec-stagger > *:nth-child(8) { animation-delay: 560ms; }

/* ─────────────────────────────────────────────────────────────
   MICRO-INTERACTIONS
   ─────────────────────────────────────────────────────────────*/
.ec-icon-hover { transition: transform var(--ec-ease-normal); }
.ec-icon-hover:hover { transform: rotate(12deg) scale(1.15); }

.ec-arrow-hover .ec-arrow { transition: transform var(--ec-ease-normal); }
.ec-arrow-hover:hover .ec-arrow { transform: translateX(4px); }

.ec-img-zoom { overflow: hidden; }
.ec-img-zoom img { transition: transform var(--ec-ease-spring); }
.ec-img-zoom:hover img { transform: scale(1.06); }

/* Link underline slide */
.ec-link-underline {
  position: relative;
  text-decoration: none;
}
.ec-link-underline::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: currentColor;
  transition: width var(--ec-ease-normal);
}
.ec-link-underline:hover::after { width: 100%; }

/* ─────────────────────────────────────────────────────────────
   INTERACTIVE ICON CONTAINERS
   ─────────────────────────────────────────────────────────────*/
.ec-icon-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--ec-r-xl);
  transition: all var(--ec-ease-normal);
  flex-shrink: 0;
}

.ec-icon-box-sm  { width: 2rem; height: 2rem; border-radius: var(--ec-r-md); }
.ec-icon-box-md  { width: 2.75rem; height: 2.75rem; }
.ec-icon-box-lg  { width: 3.5rem; height: 3.5rem; }
.ec-icon-box-xl  { width: 4.5rem; height: 4.5rem; border-radius: var(--ec-r-2xl); }

.ec-icon-box-primary {
  background: rgba(var(--ec-primary-rgb), 0.10);
  color: var(--ec-primary);
  border: 1px solid rgba(var(--ec-primary-rgb), 0.15);
}

.ec-icon-box-primary:hover,
.ec-card:hover .ec-icon-box-primary,
.group:hover .ec-icon-box-primary {
  background: var(--ec-primary);
  color: #fff;
  box-shadow: 0 8px 20px rgba(var(--ec-primary-rgb), 0.3);
  transform: scale(1.1);
}

/* ─────────────────────────────────────────────────────────────
   WCAG 1.4.4 — MINIMUM FONT SIZE ENFORCEMENT
   All visible text must be at least 12px. Override Tailwind's
   arbitrary tiny sizes globally to ensure WCAG compliance
   without changing every PHP file individually.
   ─────────────────────────────────────────────────────────────*/
.text-\[9px\]  { font-size: 0.75rem !important; }  /* 12px */
.text-\[10px\] { font-size: 0.75rem !important; }  /* 12px */
.text-\[11px\] { font-size: 0.75rem !important; }  /* 12px */

/* Ensure computed letter-spacing is readable at small sizes */
.text-\[9px\], .text-\[10px\], .text-\[11px\] {
  letter-spacing: 0.05em;
}

/* ─────────────────────────────────────────────────────────────
   UTILITY OVERRIDES
   ─────────────────────────────────────────────────────────────*/
::selection {
  background: rgba(var(--ec-primary-rgb), 0.22);
  color: inherit;
}

.font-heading { font-family: var(--ec-font-heading); }
.font-body    { font-family: var(--ec-font-body); }
.font-mono    { font-family: var(--ec-font-mono); }

.text-balance { text-wrap: balance; }
.text-pretty  { text-wrap: pretty; }

/* ─────────────────────────────────────────────────────────────
   ADMIN & INTERN PORTAL — UNIFIED BRAND
   ─────────────────────────────────────────────────────────────*/
.admin-brand,
.intern-brand {
  --admin-primary:      var(--ec-primary);
  --admin-primary-dark: var(--ec-primary-dark);
  --admin-primary-glow: var(--ec-primary-glow);
}

/* Admin sidebar nav item */
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--ec-r-xl);
  font-size: var(--ec-text-sm);
  font-weight: 600;
  color: var(--ec-slate-600);
  transition: all var(--ec-ease-fast);
  text-decoration: none;
  min-height: 44px;
}

.admin-nav-item:hover {
  background: rgba(var(--ec-primary-rgb), 0.06);
  color: var(--ec-primary);
}

.admin-nav-item.is-active {
  background: rgba(var(--ec-primary-rgb), 0.10);
  color: var(--ec-primary);
  font-weight: 700;
}

/* ─────────────────────────────────────────────────────────────
   DARK MODE
   ─────────────────────────────────────────────────────────────*/
@media (prefers-color-scheme: dark) {
  .auto-dark-bg   { background-color: var(--ec-slate-950) !important; }
  .auto-dark-text { color: var(--ec-slate-50) !important; }
}

html.dark .ec-card {
  background: var(--ec-slate-800);
  border-color: var(--ec-slate-700);
}

html.dark .ec-input {
  background: var(--ec-slate-800);
  border-color: var(--ec-slate-700);
  color: var(--ec-slate-100);
}

html.dark .ec-input:focus {
  background: var(--ec-slate-700);
  border-color: var(--ec-primary);
}

html.dark .ec-table thead th {
  background: var(--ec-slate-800);
  color: var(--ec-slate-400);
  border-color: var(--ec-slate-700);
}

html.dark .ec-stat-card {
  background: var(--ec-slate-800);
  border-color: var(--ec-slate-700);
}

/* ─────────────────────────────────────────────────────────────
   RESPONSIVE UTILITIES
   ─────────────────────────────────────────────────────────────*/
@media (max-width: 640px) {
  .ec-hide-mobile { display: none !important; }
  .ec-container   { padding: 0 1rem; }
}
@media (min-width: 641px) and (max-width: 1023px) {
  .ec-hide-tablet { display: none !important; }
}
@media (min-width: 1024px) {
  .ec-hide-desktop { display: none !important; }
}

/* Prevent horizontal overflow */
.ec-overflow-guard {
  overflow-x: hidden;
  max-width: 100vw;
}

/* ─────────────────────────────────────────────────────────────
   PRINT STYLES
   ─────────────────────────────────────────────────────────────*/
@media print {
  .ec-no-print { display: none !important; }
  .ec-glass, .ec-glass-strong { backdrop-filter: none !important; }
  * { box-shadow: none !important; }
  body { background: #fff !important; color: #000 !important; }
}
