/*
 * Aalpha Solution V2 - Global Design System Stylesheet
 * File: public/assets/css/global.css
 * Target PHP Version: 8.3
 * Coding Standard: CSS3 Native Custom Properties
 */

/* ==========================================================================
   1. CSS RESET
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  scroll-behavior: smooth;
}

body, h1, h2, h3, h4, p, ul, ol, li, figure, blockquote, dl, dd {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  text-rendering: optimizeSpeed;
  line-height: 1.6;
}

ul, ol {
  list-style: none;
}

img, picture, svg {
  max-width: 100%;
  display: block;
}

input, button, textarea, select {
  font: inherit;
}

/* ==========================================================================
   2. ROOT VARIABLES & DESIGN TOKENS
   ========================================================================== */
:root {
  /* Color System */
  --color-primary: #0F4C81;
  --color-primary-hover: #0b3b64;
  --color-secondary: #16A34A;
  --color-accent: #F97316;
  
  --color-success: #15803d;
  --color-warning: #b45309;
  --color-danger: #b91c1c;

  --color-bg-base: #FFFFFF;
  --color-bg-surface: #F8FAFC;
  --color-border: #E2E8F0;

  --color-text-primary: #1F2937;
  --color-text-muted: #4B5563;
  --color-text-white: #FFFFFF;

  /* Typography Scale */
  --font-heading: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --fs-display: clamp(2.5rem, 5vw + 1rem, 4rem); /* Responsive H1 */
  --fs-h1: clamp(2rem, 4vw + 1rem, 3rem);
  --fs-h2: clamp(1.5rem, 3vw + 1rem, 2.25rem);
  --fs-h3: clamp(1.25rem, 2vw + 1rem, 1.5rem);
  --fs-h4: 1.25rem;
  --fs-body-large: 1.125rem;
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-caption: 0.75rem;

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  /* Spacing Scale (4px Base Grid) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-24: 96px;

  /* Border Radii */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-pill: 9999px;

  /* Shadow Scale */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.35s ease;

  /* Z-Index Scale */
  --z-header: 1000;
  --z-dropdown: 1010;
  --z-overlay: 2000;
  --z-modal: 2010;

  /* Constraints */
  --max-container: 1280px;
}

/* ==========================================================================
   3. TYPOGRAPHY RULES
   ========================================================================== */
body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  color: var(--color-text-primary);
  background-color: var(--color-bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  line-height: 1.25;
  color: var(--color-text-primary);
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

p {
  margin-bottom: var(--space-4);
  max-width: 680px; /* Optimal reading character length */
}

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

a:hover {
  color: var(--color-primary-hover);
}

blockquote {
  border-left: 4px solid var(--color-primary);
  padding-left: var(--space-4);
  margin-bottom: var(--space-6);
  font-style: italic;
  color: var(--color-text-muted);
}

/* ==========================================================================
   4. LAYOUT CONTAINERS & GRID
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--max-container);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

@media (min-width: 768px) {
  .container {
    padding-left: var(--space-8);
    padding-right: var(--space-8);
  }
}

.section {
  padding-top: var(--space-12);
  padding-bottom: var(--space-12);
}

@media (min-width: 1024px) {
  .section {
    padding-top: var(--space-24);
    padding-bottom: var(--space-24);
  }
}

.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* ==========================================================================
   5. BUTTON COMPONENTS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 48px; /* Touch target minimum */
  text-decoration: none;
}

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

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

.btn-secondary {
  background-color: var(--color-bg-base);
  color: var(--color-text-primary);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  background-color: var(--color-bg-surface);
  border-color: var(--color-primary);
}

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

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

.btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ==========================================================================
   6. FORM COMPONENTS
   ========================================================================== */
.form-group {
  margin-bottom: var(--space-6);
}

.form-label {
  display: block;
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
}

.form-control {
  width: 100%;
  min-height: 48px;
  padding: 10px 16px;
  font-size: var(--fs-body);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: var(--color-bg-base);
  color: var(--color-text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(15, 76, 129, 0.15);
}

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

.form-error .error-message {
  color: var(--color-danger);
  font-size: var(--fs-small);
  margin-top: var(--space-1);
}

/* ==========================================================================
   7. UTILITY CLASSES (Grid, Flex, Margins, Paddings, Typography, Transitions)
   ========================================================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-muted { color: var(--color-text-muted); }
.text-primary { color: var(--color-primary); }

.bg-surface { background-color: var(--color-bg-surface); }
.bg-base { background-color: var(--color-bg-base); }
.bg-white { background-color: #FFFFFF !important; }
.bg-white\/90 { background-color: rgba(255, 255, 255, 0.9) !important; }
.bg-black\/50 { background-color: rgba(0, 0, 0, 0.5) !important; }
.bg-blue-50 { background-color: #EFF6FF !important; }
.bg-red-400 { background-color: #F87171 !important; }
.bg-yellow-400 { background-color: #FACC15 !important; }
.bg-green-400 { background-color: #4ADE80 !important; }

/* Display & Flex Layouts */
.flex { display: flex !important; }
.inline-flex { display: inline-flex !important; }
.hidden { display: none !important; }
.items-center { align-items: center !important; }
.items-stretch { align-items: stretch !important; }
.justify-between { justify-content: space-between !important; }
.justify-center { justify-content: center !important; }
.flex-col { flex-direction: column !important; }
.flex-row { flex-direction: row !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }
.relative { position: relative !important; }
.absolute { position: absolute !important; }
.fixed { position: fixed !important; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.inset-y-0 { top: 0; bottom: 0; }
.right-0 { right: 0; }
.left-0 { left: 0; }

/* Grid Utilities */
.grid { display: grid !important; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)) !important; }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.gap-1\.5 { gap: 0.375rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 0.75rem !important; }
.gap-4 { gap: 1rem !important; }
.gap-6 { gap: 1.5rem !important; }
.gap-8 { gap: 2rem !important; }
.gap-12 { gap: 3rem !important; }

/* Dimensions */
.w-full { width: 100% !important; }
.h-full { height: 100% !important; }
.h-10 { height: 2.5rem !important; }
.w-auto { width: auto !important; }
.h-auto { height: auto !important; }
.h-20 { height: 5rem !important; }
.h-2 { height: 0.5rem !important; }
.w-3 { width: 0.75rem !important; }
.h-3 { height: 0.75rem !important; }
.w-4 { width: 1rem !important; }
.h-4 { height: 1rem !important; }
.w-5 { width: 1.25rem !important; }
.h-5 { height: 1.25rem !important; }
.w-6 { width: 1.5rem !important; }
.h-6 { height: 1.5rem !important; }
.w-10 { width: 2.5rem !important; }
.w-12 { width: 3rem !important; }
.h-12 { height: 3rem !important; }
.w-24 { width: 6rem !important; }
.h-24 { height: 6rem !important; }
.max-w-xs { max-width: 20rem !important; }
.max-w-md { max-width: 28rem !important; }
.max-w-xl { max-width: 36rem !important; }
.max-w-4xl { max-width: 56rem !important; }
.max-w-7xl { max-width: 80rem !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.aspect-\[4\/3\] { aspect-ratio: 4/3 !important; }
.aspect-\[16\/9\] { aspect-ratio: 16/9 !important; }

/* Spacing Margins & Paddings */
.m-0 { margin: 0 !important; }
.p-0 { padding: 0 !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 0.75rem !important; }
.p-4 { padding: 1rem !important; }
.p-6 { padding: 1.5rem !important; }
.p-8 { padding: 2rem !important; }
.p-12 { padding: 3rem !important; }
.py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.py-4 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.py-12 { padding-top: 3rem !important; padding-bottom: 3rem !important; }
.py-20 { padding-top: 5rem !important; padding-bottom: 5rem !important; }
.py-24 { padding-top: 6rem !important; padding-bottom: 6rem !important; }
.px-4 { padding-left: 1rem !important; padding-right: 1rem !important; }
.px-5 { padding-left: 1.25rem !important; padding-right: 1.25rem !important; }
.px-6 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.px-8 { padding-left: 2rem !important; padding-right: 2rem !important; }
.pb-3 { padding-bottom: 0.75rem !important; }
.pb-4 { padding-bottom: 1rem !important; }
.pb-5 { padding-bottom: 1.25rem !important; }
.pb-6 { padding-bottom: 1.5rem !important; }
.pt-4 { padding-top: 1rem !important; }
.pt-6 { padding-top: 1.5rem !important; }
.pt-8 { padding-top: 2rem !important; }
.pt-16 { padding-top: 4rem !important; }
.mt-0\.5 { margin-top: 0.125rem !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-4 { margin-top: 1rem !important; }
.mt-6 { margin-top: 1.5rem !important; }
.mt-8 { margin-top: 2rem !important; }
.mt-12 { margin-top: 3rem !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 0.75rem !important; }
.mb-4 { margin-bottom: 1rem !important; }
.mb-6 { margin-bottom: 1.5rem !important; }
.mb-8 { margin-bottom: 2rem !important; }
.mb-12 { margin-bottom: 3rem !important; }
.mb-16 { margin-bottom: 4rem !important; }

/* Colors, Borders, Typography */
.text-xs { font-size: 0.75rem !important; }
.text-sm { font-size: 0.875rem !important; }
.text-base { font-size: 1rem !important; }
.text-lg { font-size: 1.125rem !important; }
.text-xl { font-size: 1.25rem !important; }
.text-2xl { font-size: 1.5rem !important; }
.text-3xl { font-size: 1.875rem !important; }
.text-4xl { font-size: 2.25rem !important; }
.text-5xl { font-size: 3rem !important; }
.text-6xl { font-size: 3.75rem !important; }
.text-8xl { font-size: 6rem !important; }
.font-bold { font-weight: 700 !important; }
.font-semibold { font-weight: 600 !important; }
.font-medium { font-weight: 500 !important; }
.uppercase { text-transform: uppercase !important; }
.tracking-wide { letter-spacing: 0.025em !important; }
.tracking-wider { letter-spacing: 0.05em !important; }
.tracking-widest { letter-spacing: 0.1em !important; }
.tracking-tight { letter-spacing: -0.025em !important; }
.text-gray-400 { color: #9CA3AF !important; }
.text-gray-500 { color: #6B7280 !important; }
.text-gray-600 { color: #4B5563 !important; }
.text-gray-700 { color: #374151 !important; }
.text-gray-800 { color: #1F2937 !important; }
.text-gray-900 { color: #111827 !important; }
.text-white { color: #FFFFFF !important; }
.border-b { border-bottom: 1px solid var(--color-border) !important; }
.border-t { border-top: 1px solid var(--color-border) !important; }
.border-y { border-top: 1px solid var(--color-border) !important; border-bottom: 1px solid var(--color-border) !important; }
.border-border { border-color: var(--color-border) !important; }
.rounded-sm { border-radius: var(--radius-sm) !important; }
.rounded-md { border-radius: var(--radius-md) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-full { border-radius: var(--radius-pill) !important; }
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important; }
.shadow-inner { box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06) !important; }
.backdrop-blur-md { backdrop-filter: blur(12px) !important; }
.backdrop-blur-sm { backdrop-filter: blur(4px) !important; }
.overflow-hidden { overflow: hidden !important; }

/* Transitions & Positions */
.transition-all { transition: all var(--transition-normal); }
.transition-colors { transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast); }
.duration-200 { transition-duration: 200ms !important; }
.duration-300 { transition-duration: 300ms !important; }
.top-full { top: 100% !important; }
.w-56 { width: 14rem !important; }
.z-header { z-index: var(--z-header) !important; }
.z-modal { z-index: var(--z-modal) !important; }
.z-overlay { z-index: var(--z-overlay) !important; }

/* Hover States & Group classes mapping */
.group:hover .group-hover\:rotate-180 { transform: rotate(180deg) !important; }
.group:hover .group-hover\:opacity-100 { opacity: 1 !important; }
.group:hover .group-hover\:visible { visibility: visible !important; }
.focus-within\:opacity-100:focus-within { opacity: 1 !important; }
.focus-within\:visible:focus-within { visibility: visible !important; }

/* Mobile transitions */
.translate-x-full { transform: translateX(100%) !important; }
.translate-x-0 { transform: translateX(0) !important; }

/* Skip Link */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ==========================================================================
   8. ACCESSIBILITY RULES
   ========================================================================== */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

::selection {
  background-color: var(--color-accent);
  color: var(--color-text-white);
}

/* ==========================================================================
   9. STICKY HEADER & GLOBAL ELEMENTS
   ========================================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
}

.header--scrolled {
  background-color: rgba(255, 255, 255, 0.95) !important;
  box-shadow: var(--shadow-sm) !important;
}

/* Responsive media queries */
@media (min-width: 768px) {
  .md\:flex { display: flex !important; }
  .md\:inline-flex { display: inline-flex !important; }
  .md\:hidden { display: none !important; }
  .md\:flex-row { flex-direction: row !important; }
  .md\:items-center { align-items: center !important; }
  .md\:grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)) !important; }
  .md\:col-span-8 { grid-column: span 8 / span 8 !important; }
  .md\:col-span-4 { grid-column: span 4 / span 4 !important; }
}

@media (min-width: 1024px) {
  .lg\:flex { display: flex !important; }
  .lg\:hidden { display: none !important; }
  .lg\:block { display: block !important; }
  .lg\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
  .lg\:grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)) !important; }
  .lg\:col-span-2 { grid-column: span 2 / span 2 !important; }
  .lg\:col-span-5 { grid-column: span 5 / span 5 !important; }
  .lg\:col-span-7 { grid-column: span 7 / span 7 !important; }
}

/* ==========================================================================
   10. PRINT RULES
   ========================================================================== */
@media print {
  body {
    background-color: #fff;
    color: #000;
    font-size: 12pt;
  }
  
  .header, .footer, .btn, .cta-block-section {
    display: none !important;
  }
  
  a[href]::after {
    content: " (" attr(href) ")";
  }
}
