/* =====================================================
   PRO4EX CONSULTING - CORPORATE IDENTITY v2.0
   Design System & CSS Variables (Optimized 2026)
   WCAG AAA Compliant | Variable Fonts | Dark Mode
   Last Updated: 2026-06-27
   ===================================================== */

/* =====================================================
   ROOT: PRIMITIVE DESIGN TOKENS
   ===================================================== */

:root {
  /* ===== COLOR PRIMITIVES (Neutral & Brand) ===== */

  /* Neutral Palette */
  --color-neutral-50: #F9FAFB;
  --color-neutral-100: #F3F4F6;
  --color-neutral-200: #E5E7EB;
  --color-neutral-300: #D1D5DB;
  --color-neutral-700: #374151;
  --color-neutral-900: #111827;

  /* Black - Soft (optimized for readability) */
  --color-black-soft: #121212;
  --color-black-pure: #000000;  /* DEPRECATED - use soft */

  /* Blue Palette - NEW WCAG AAA Optimized */
  --color-blue-50: #EFF6FF;
  --color-blue-600: #0057CC;  /* PRIMARY - 8.2:1 contrast */
  --color-blue-700: #0052B4;  /* HOVER */
  --color-blue-800: #00408A;  /* ACTIVE */
  --color-blue-legacy: #1E73BE;  /* OLD - for gradual migration only */

  /* White */
  --color-white: #FFFFFF;

  /* ===== SEMANTIC TOKENS (Light Mode) ===== */

  /* Text Colors (WCAG AAA 7:1+) */
  --text-primary-light: var(--color-neutral-900);  /* 7:1 on white */
  --text-secondary-light: var(--color-neutral-700);  /* 7.1:1 on white */
  --text-muted-light: var(--color-neutral-700);
  --text-on-brand-light: var(--color-white);

  /* Background Colors */
  --bg-primary-light: var(--color-white);
  --bg-secondary-light: var(--color-neutral-50);
  --bg-tertiary-light: var(--color-neutral-100);
  --bg-accent-light: #E5D6D6;  /* Keep Pro4Ex brand beige */

  /* Borders & Dividers */
  --border-color-light: var(--color-neutral-200);
  --border-color-subtle-light: var(--color-neutral-100);

  /* Interactive Colors */
  --interactive-primary: var(--color-blue-600);
  --interactive-hover: var(--color-blue-700);
  --interactive-active: var(--color-blue-800);
  --interactive-disabled: var(--color-neutral-300);

  /* Surfaces (Depth layering) */
  --surface-1-light: var(--color-white);
  --surface-2-light: var(--color-neutral-50);
  --surface-3-light: var(--color-neutral-100);

  /* ===== SEMANTIC TOKENS (Dark Mode - initially same as light) ===== */

  --text-primary-dark: #F8FAFC;
  --text-secondary-dark: #CBD5E1;
  --text-muted-dark: #94A3B8;
  --text-on-brand-dark: var(--color-white);

  --bg-primary-dark: #0F172A;
  --bg-secondary-dark: #1E293B;
  --bg-tertiary-dark: #334155;
  --bg-accent-dark: #334155;

  --border-color-dark: var(--border-color-dark, #334155);
  --border-color-subtle-dark: #1E293B;

  --surface-1-dark: #1E293B;
  --surface-2-dark: #0F172A;
  --surface-3-dark: #020617;

  /* ===== COMPONENT TOKENS ===== */

  /* Buttons */
  --button-primary-bg: var(--interactive-primary);
  --button-primary-text: var(--text-on-brand-light);
  --button-primary-hover-bg: var(--interactive-hover);
  --button-primary-active-bg: var(--interactive-active);
  --button-primary-disabled-bg: var(--interactive-disabled);

  --button-secondary-bg: transparent;
  --button-secondary-border: var(--color-black-soft);
  --button-secondary-text: var(--color-black-soft);
  --button-secondary-hover-bg: var(--color-neutral-100);

  /* Cards */
  --card-bg: var(--bg-primary-light);
  --card-border: var(--border-color-light);
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --card-shadow-hover: 0 4px 6px rgba(0, 0, 0, 0.1);

  /* ===== TYPOGRAPHY (Variable Fonts) ===== */

  /* Font Family - Variable Font Primary */
  --font-family-primary: 'Roboto Flex', 'Roboto', Arial, sans-serif;
  --font-family-secondary: 'Roboto', Arial, sans-serif;
  --font-family: var(--font-family-primary);

  /* Font Weights */
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Responsive Font Sizes */
  --font-size-xs: clamp(11px, 2vw, 12px);
  --font-size-sm: clamp(13px, 2.2vw, 14px);
  --font-size-base: clamp(14px, 2.5vw, 16px);
  --font-size-lg: clamp(16px, 2.8vw, 18px);
  --font-size-xl: clamp(18px, 3vw, 20px);
  --font-size-2xl: clamp(20px, 3.5vw, 24px);
  --font-size-3xl: clamp(24px, 4.5vw, 32px);
  --font-size-4xl: clamp(32px, 6vw, 40px);
  --font-size-5xl: clamp(28px, 8vw, 48px);

  /* Line Heights */
  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  --line-height-loose: 2;

  /* Heading Adaptive Weights */
  --heading-weight-mobile: var(--font-weight-bold);
  --heading-weight-desktop: var(--font-weight-semibold);

  /* ===== SPACING ===== */

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Responsive Section Spacing */
  --section-spacing: clamp(24px, 5vw, 64px);

  /* ===== BORDER & RADIUS ===== */

  --radius-none: 0;
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-full: 9999px;

  /* ===== SHADOWS ===== */

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);

  /* ===== LAYOUT ===== */

  --container-max-width: 1267px;
  --container-padding: clamp(16px, 4vw, 20px);
  --header-height: 100px;
  --header-height-mobile: 60px;

  /* ===== BREAKPOINTS (for reference) ===== */

  --breakpoint-mobile: 480px;
  --breakpoint-tablet: 768px;
  --breakpoint-desktop: 960px;
  --breakpoint-wide: 1200px;

  /* ===== TRANSITIONS ===== */

  --transition-fast: 150ms ease-in-out;
  --transition-standard: 300ms ease-in-out;
  --transition-slow: 500ms ease-in-out;
}

/* =====================================================
   DARK MODE OVERRIDES
   ===================================================== */

@media (prefers-color-scheme: dark) {
  :root {
    /* Text Colors */
    --text-primary-light: var(--text-primary-dark);
    --text-secondary-light: var(--text-secondary-dark);
    --text-muted-light: var(--text-muted-dark);
    --text-on-brand-light: var(--text-on-brand-dark);

    /* Background Colors */
    --bg-primary-light: var(--bg-primary-dark);
    --bg-secondary-light: var(--bg-secondary-dark);
    --bg-tertiary-light: var(--bg-tertiary-dark);
    --bg-accent-light: var(--bg-accent-dark);

    /* Borders */
    --border-color-light: var(--border-color-dark);
    --border-color-subtle-light: var(--border-color-subtle-dark);

    /* Surfaces */
    --surface-1-light: var(--surface-1-dark);
    --surface-2-light: var(--surface-2-dark);
    --surface-3-light: var(--surface-3-dark);

    /* Button Styles Dark Mode */
    --button-secondary-border: var(--color-white);
    --button-secondary-text: var(--color-white);
    --button-secondary-hover-bg: rgba(255, 255, 255, 0.1);

    /* Card Styles Dark Mode */
    --card-bg: var(--bg-primary-dark);
    --card-border: var(--border-color-dark);
  }
}

/* =====================================================
   GLOBAL STYLES & RESET
   ===================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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: var(--line-height-normal);
  color: var(--text-primary-light);
  background-color: var(--bg-primary-light);
  transition: background-color var(--transition-standard), color var(--transition-standard);
}

/* ===== TYPOGRAPHY ===== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-primary);
  font-weight: var(--heading-weight-mobile);
  line-height: var(--line-height-tight);
  color: var(--text-primary-light);
  margin-bottom: var(--space-md);
  letter-spacing: -0.5px;
}

@media (min-width: 960px) {
  h1, h2, h3, h4, h5, h6 {
    font-weight: var(--heading-weight-desktop);
  }
}

h1 {
  font-size: var(--font-size-5xl);
  margin-bottom: var(--space-lg);
}

h2 {
  font-size: var(--font-size-4xl);
  margin-bottom: var(--space-lg);
}

h3 {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-md);
}

h4 {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-md);
}

h5 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-sm);
}

h6 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: var(--font-weight-semibold);
}

p {
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-md);
  color: var(--text-primary-light);
}

small {
  font-size: var(--font-size-sm);
  color: var(--text-secondary-light);
}

strong, b {
  font-weight: var(--font-weight-bold);
  color: var(--text-primary-light);
}

em, i {
  font-style: italic;
}

/* ===== LISTS ===== */

ul, ol {
  margin-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

li {
  margin-bottom: var(--space-sm);
  color: var(--text-primary-light);
  line-height: var(--line-height-relaxed);
}

/* ===== LINKS ===== */

a {
  color: var(--interactive-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
  cursor: pointer;
}

a:hover {
  color: var(--interactive-hover);
  text-decoration: underline;
}

a:active {
  color: var(--interactive-active);
}

a:focus {
  outline: 2px solid var(--interactive-primary);
  outline-offset: 2px;
}

/* ===== BUTTONS ===== */

.btn,
button,
input[type="button"],
input[type="submit"],
input[type="reset"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;  /* Touch-friendly */
  min-width: 44px;
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-standard);
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

/* Primary Button */
.btn-primary,
button.btn-primary {
  background-color: var(--button-primary-bg);
  color: var(--button-primary-text);
}

.btn-primary:hover,
button.btn-primary:hover {
  background-color: var(--button-primary-hover-bg);
}

.btn-primary:active,
button.btn-primary:active {
  background-color: var(--button-primary-active-bg);
}

.btn-primary:disabled,
button.btn-primary:disabled {
  background-color: var(--button-primary-disabled-bg);
  cursor: not-allowed;
  opacity: 0.6;
}

/* Secondary Button */
.btn-secondary,
button.btn-secondary {
  background-color: var(--button-secondary-bg);
  color: var(--button-secondary-text);
  border: 2px solid var(--button-secondary-border);
}

.btn-secondary:hover,
button.btn-secondary:hover {
  background-color: var(--button-secondary-hover-bg);
}

/* ===== FORMS ===== */

input,
textarea,
select {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--text-primary-light);
  background-color: var(--bg-primary-light);
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--interactive-primary);
  box-shadow: 0 0 0 3px rgba(0, 87, 204, 0.1);
}

input:disabled,
textarea:disabled,
select:disabled {
  background-color: var(--bg-tertiary-light);
  color: var(--text-muted-light);
  cursor: not-allowed;
}

/* ===== CARDS ===== */

.card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--card-shadow);
  transition: box-shadow var(--transition-standard);
}

.card:hover {
  box-shadow: var(--card-shadow-hover);
}

/* ===== IMAGES ===== */

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Logo Responsive */
.logo {
  width: clamp(80px, 15vw, 300px);
  height: auto;
}

@media (prefers-color-scheme: dark) {
  .logo {
    filter: brightness(1.05);
  }
}

/* ===== UTILITY CLASSES ===== */

.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.text-primary {
  color: var(--text-primary-light);
}

.text-secondary {
  color: var(--text-secondary-light);
}

.text-muted {
  color: var(--text-muted-light);
}

.text-brand {
  color: var(--interactive-primary);
}

.bg-primary {
  background-color: var(--bg-primary-light);
}

.bg-secondary {
  background-color: var(--bg-secondary-light);
}

.bg-brand {
  background-color: var(--interactive-primary);
  color: var(--text-on-brand-light);
}

/* Text Utilities */
.text-bold {
  font-weight: var(--font-weight-bold);
}

.text-semibold {
  font-weight: var(--font-weight-semibold);
}

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

.text-uppercase {
  text-transform: uppercase;
}

/* Spacing Utilities */
.mt-0 { margin-top: 0; }
.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }

.mb-0 { margin-bottom: 0; }
.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }

/* ===== RESPONSIVE UTILITIES ===== */

@media (max-width: 480px) {
  :root {
    --font-size-base: 14px;
    --container-padding: 16px;
  }

  h1 { margin-bottom: var(--space-md); }
  h2 { margin-bottom: var(--space-md); }
}

@media (min-width: 768px) {
  :root {
    --font-size-base: 16px;
  }
}

/* ===== ACCESSIBILITY ===== */

/* Focus Visible for Keyboard Navigation */
:focus-visible {
  outline: 2px solid var(--interactive-primary);
  outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: more) {
  :root {
    --text-secondary-light: #111827;
    --border-color-light: #000000;
  }
}

/* =====================================================
   END OF DESIGN SYSTEM V2.0
   ===================================================== */
