/*
==============================================================================
KATUN BRAND CSS FOUNDATION
==============================================================================
Comprehensive brand system for Katun client portal
Phase 1: Brand foundation with colors, typography, and geometric elements
"Success Made Simple" design philosophy
==============================================================================
*/

/* CSS Custom Properties - Katun Brand Foundation */
:root {
  /* === PRIMARY BRAND COLORS === */
  --katun-blue: #004990;           /* Primary brand color - logos, CTAs, key elements */
  --ocean-blue: #0093c6;           /* Secondary actions, hover states, accent elements */
  --yellow-green: #d6d567;         /* Highlights, notifications, attention-grabbing elements */
  --jade: #00a87e;                 /* Success states, confirmations, positive actions */
  --fern: #73ba6a;                 /* Supporting green for balance and natural elements */
  
  /* === SECONDARY PALETTE === */
  --navy: #1b3a6a;                 /* Dark accent for patterns and graphics */
  --steel-blue: #1d7bac;           /* Alternative blue accent */
  --lime: #5ab651;                 /* Bright green accent */
  --aquamarine: #b9d97f;           /* Light green accent */
  --pistachio: #d6df4f;            /* Yellow-green accent */
  
  /* === NEUTRAL PALETTE === */
  --light-blue: #e4f4f9;           /* Subtle backgrounds and highlight areas */
  --light-cool-gray: #dae2e8;      /* Borders and dividers */
  --light-sage: #eaede8;           /* Alternative neutral backgrounds */
  
  /* === SEMANTIC COLORS === */
  --text-primary: #1f2937;         /* Primary text color */
  --text-secondary: #6b7280;       /* Secondary text color */
  --text-muted: #9ca3af;           /* Muted text color */
  --border: #e5e7eb;               /* Default border color */
  --white: #ffffff;                /* Pure white */
  --black: #000000;                /* Pure black */
  
  /* === GRADIENTS === */
  --gradient-primary: linear-gradient(135deg, var(--katun-blue), var(--ocean-blue));
  --gradient-secondary: linear-gradient(135deg, var(--jade), var(--fern));
  --gradient-accent: linear-gradient(135deg, var(--ocean-blue), var(--steel-blue));
  --gradient-warm: linear-gradient(135deg, var(--yellow-green), var(--jade));
  
  /* === TYPOGRAPHY SCALE === */
  --text-xs: 0.75rem;              /* 12px */
  --text-sm: 0.875rem;             /* 14px */
  --text-base: 1rem;               /* 16px */
  --text-lg: 1.125rem;             /* 18px */
  --text-xl: 1.25rem;              /* 20px */
  --text-2xl: 1.5rem;              /* 24px */
  --text-3xl: 1.875rem;            /* 30px */
  --text-4xl: 2.25rem;             /* 36px */
  --text-5xl: 3rem;                /* 48px */
  
  /* === FONT WEIGHTS === */
  --font-light: 300;
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  
  /* === LINE HEIGHTS === */
  --leading-tight: 1.2;
  --leading-snug: 1.3;
  --leading-normal: 1.4;
  --leading-relaxed: 1.5;
  --leading-loose: 1.6;
  --leading-extra-loose: 1.7;
  
  /* === SPACING SCALE === */
  --space-1: 0.25rem;              /* 4px */
  --space-2: 0.5rem;               /* 8px */
  --space-3: 0.75rem;              /* 12px */
  --space-4: 1rem;                 /* 16px */
  --space-5: 1.25rem;              /* 20px */
  --space-6: 1.5rem;               /* 24px */
  --space-8: 2rem;                 /* 32px */
  --space-10: 2.5rem;              /* 40px */
  --space-12: 3rem;                /* 48px */
  --space-16: 4rem;                /* 64px */
  --space-20: 5rem;                /* 80px */
  
  /* === BORDER RADIUS === */
  --radius: 0.25rem;               /* 4px */
  --radius-md: 0.375rem;           /* 6px */
  --radius-lg: 0.5rem;             /* 8px */
  --radius-xl: 0.75rem;            /* 12px */
  --radius-2xl: 1rem;              /* 16px */
  --radius-3xl: 1.5rem;            /* 24px */
  --radius-full: 9999px;           /* Fully rounded */
  
  /* === SHADOWS === */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  
  /* === TRANSITIONS === */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.2s ease;
  --transition-slow: 0.3s ease;
  
  /* === Z-INDEX SCALE === */
  --z-base: 0;
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
  --z-toast: 1080;
}

/* === FONT IMPORTS === */
/* Google Fonts fallbacks for Ariana Pro and Acumin Pro */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@300;400;600;700&display=swap');

/* === BASE TYPOGRAPHY === */
.katun-font-heading {
  font-family: 'Inter', 'Ariana Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

.katun-font-body {
  font-family: 'Source Sans Pro', 'Acumin Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* === TYPOGRAPHY CLASSES === */
.katun-h1 {
  font-family: 'Inter', 'Ariana Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  color: var(--katun-blue);
}

.katun-h2 {
  font-family: 'Inter', 'Ariana Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--text-3xl);
  font-weight: var(--font-semibold);
  line-height: var(--leading-snug);
  color: var(--katun-blue);
}

.katun-h3 {
  font-family: 'Inter', 'Ariana Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  line-height: var(--leading-normal);
  color: var(--katun-blue);
}

.katun-h4 {
  font-family: 'Inter', 'Ariana Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--text-xl);
  font-weight: var(--font-medium);
  line-height: var(--leading-relaxed);
  color: var(--text-primary);
}

.katun-body-large {
  font-family: 'Source Sans Pro', 'Acumin Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--text-lg);
  font-weight: var(--font-normal);
  line-height: var(--leading-loose);
  color: var(--text-primary);
}

.katun-body {
  font-family: 'Source Sans Pro', 'Acumin Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  line-height: var(--leading-loose);
  color: var(--text-primary);
}

.katun-body-small {
  font-family: 'Source Sans Pro', 'Acumin Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--text-sm);
  font-weight: var(--font-normal);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}

.katun-label {
  font-family: 'Source Sans Pro', 'Acumin Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  line-height: var(--leading-normal);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* === BRAND TAGLINE === */
.katun-tagline {
  font-family: 'Source Sans Pro', 'Acumin Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--ocean-blue);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: center;
}

.katun-tagline::before,
.katun-tagline::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 1px;
  background: var(--ocean-blue);
  margin: 0 var(--space-3);
  vertical-align: middle;
}

/* === GEOMETRIC BRAND ELEMENTS === */
.katun-diamond {
  width: 24px;
  height: 24px;
  background: var(--gradient-primary);
  transform: rotate(45deg);
  border-radius: 2px;
  display: inline-block;
}

.katun-triangle {
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-bottom: 20px solid var(--katun-blue);
  display: inline-block;
}

.katun-hexagon {
  width: 24px;
  height: 24px;
  background: var(--gradient-secondary);
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  display: inline-block;
}

/* === BRAND PATTERN BACKGROUND === */
.katun-pattern {
  background-image: 
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 10px,
      rgba(0, 73, 144, 0.03) 10px,
      rgba(0, 73, 144, 0.03) 20px
    );
}

.katun-pattern-subtle {
  background-image: 
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 15px,
      rgba(0, 147, 198, 0.02) 15px,
      rgba(0, 147, 198, 0.02) 30px
    );
}

/* === BUTTON STYLES === */
.katun-btn {
  font-family: 'Source Sans Pro', 'Acumin Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: var(--font-medium);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}

.katun-btn-primary {
  background: var(--gradient-primary);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.katun-btn-primary:hover {
  background: var(--katun-blue);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
  color: var(--white);
  text-decoration: none;
}

.katun-btn-secondary {
  background: var(--white);
  color: var(--katun-blue);
  border: 2px solid var(--katun-blue);
  box-shadow: var(--shadow-sm);
}

.katun-btn-secondary:hover {
  background: var(--katun-blue);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.katun-btn-success {
  background: var(--gradient-secondary);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.katun-btn-success:hover {
  background: var(--jade);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
  color: var(--white);
  text-decoration: none;
}

/* === FORM ELEMENTS === */
.katun-form-control {
  font-family: 'Source Sans Pro', 'Acumin Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--text-base);
  padding: var(--space-3) var(--space-4);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--white);
  color: var(--text-primary);
  transition: all var(--transition-normal);
  width: 100%;
}

.katun-form-control:focus {
  outline: none;
  border-color: var(--ocean-blue);
  box-shadow: 0 0 0 3px rgba(0, 147, 198, 0.1);
}

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

.katun-form-label {
  font-family: 'Source Sans Pro', 'Acumin Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  display: block;
}

.katun-form-label.required::after {
  content: '*';
  color: #ef4444;
  margin-left: var(--space-1);
}

/* === CARD COMPONENTS === */
.katun-card {
  background: var(--white);
  border-radius: var(--radius-2xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transition: all var(--transition-normal);
}

.katun-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.katun-card-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--border);
  background: var(--light-blue);
}

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

.katun-card-footer {
  padding: var(--space-6);
  border-top: 1px solid var(--border);
  background: var(--light-sage);
}

/* === LOADING STATES === */
.katun-loading {
  position: relative;
  overflow: hidden;
}

.katun-loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 147, 198, 0.1),
    transparent
  );
  animation: katun-shimmer 1.5s infinite;
}

@keyframes katun-shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

.katun-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: var(--radius-full);
  animation: katun-spin 1s linear infinite;
  display: inline-block;
}

@keyframes katun-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* === UTILITIES === */
.katun-text-primary { color: var(--katun-blue); }
.katun-text-secondary { color: var(--ocean-blue); }
.katun-text-success { color: var(--jade); }
.katun-text-muted { color: var(--text-muted); }

.katun-bg-primary { background-color: var(--katun-blue); }
.katun-bg-secondary { background-color: var(--ocean-blue); }
.katun-bg-light { background-color: var(--light-blue); }
.katun-bg-neutral { background-color: var(--light-cool-gray); }

.katun-border-primary { border-color: var(--katun-blue); }
.katun-border-secondary { border-color: var(--ocean-blue); }

.katun-shadow { box-shadow: var(--shadow); }
.katun-shadow-lg { box-shadow: var(--shadow-lg); }
.katun-shadow-xl { box-shadow: var(--shadow-xl); }

.katun-rounded { border-radius: var(--radius); }
.katun-rounded-lg { border-radius: var(--radius-lg); }
.katun-rounded-xl { border-radius: var(--radius-xl); }
.katun-rounded-2xl { border-radius: var(--radius-2xl); }

/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
  .katun-h1 { font-size: var(--text-3xl); }
  .katun-h2 { font-size: var(--text-2xl); }
  .katun-h3 { font-size: var(--text-xl); }
  
  .katun-btn {
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-sm);
  }
  
  .katun-card-header,
  .katun-card-body,
  .katun-card-footer {
    padding: var(--space-4);
  }
}

/* === ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {
  .katun-btn,
  .katun-form-control,
  .katun-card {
    transition: none;
  }
  
  .katun-loading::after,
  .katun-spinner {
    animation: none;
  }
}

/* === HIGH CONTRAST MODE === */
@media (prefers-contrast: high) {
  :root {
    --katun-blue: #003366;
    --ocean-blue: #0066cc;
    --border: #666666;
    --text-primary: #000000;
    --text-secondary: #333333;
  }
}

/* === SUCCESS MADE SIMPLE MESSAGING === */
.katun-simple-tagline {
  font-family: 'Source Sans Pro', 'Acumin Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  color: var(--katun-blue);
  text-align: center;
  padding: var(--space-3) 0;
  margin: var(--space-4) 0;
  letter-spacing: 0.02em;
}

/* === BRAND ACCENT ELEMENTS === */
.katun-accent-line {
  height: 3px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  margin: var(--space-3) 0;
}

.katun-accent-dot {
  width: 8px;
  height: 8px;
  background: var(--ocean-blue);
  border-radius: var(--radius-full);
  display: inline-block;
  margin: 0 var(--space-2);
}

.katun-brand-corner {
  position: relative;
}

.katun-brand-corner::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-left: 20px solid transparent;
  border-top: 20px solid var(--ocean-blue);
  opacity: 0.8;
}

/* === PERFEX CRM INTEGRATION === */
/* Override default Perfex styles with Katun branding */
.btn-primary {
  background: var(--gradient-primary) !important;
  border-color: var(--katun-blue) !important;
  color: var(--white) !important;
}

.btn-primary:hover {
  background: var(--katun-blue) !important;
  border-color: var(--katun-blue) !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.form-control:focus {
  border-color: var(--ocean-blue) !important;
  box-shadow: 0 0 0 0.2rem rgba(0, 147, 198, 0.25) !important;
}

.text-primary {
  color: var(--katun-blue) !important;
}

.bg-primary {
  background-color: var(--katun-blue) !important;
}

/* === PRINT STYLES === */
@media print {
  .katun-btn,
  .katun-loading::after,
  .katun-spinner {
    background: none !important;
    color: #000000 !important;
    box-shadow: none !important;
  }
  
  .katun-card {
    border: 1px solid #000000 !important;
    box-shadow: none !important;
  }
}