/* ============================================
   BASE STYLES - Professional Financial Design System
   ============================================ */

/* CSS Variables - Refined Professional Palette */
:root {
  /* Primary Colors - Financial Institution Palette */
  --primary-blue: #0A84FF;         /* Apple blue */
  --primary-blue-hover: #0060DF;   /* Deeper blue for hover */
  --primary-blue-light: #87C3FF;   /* Accent tint */
  --primary-blue-soft: #E6F0FF;    /* Soft background tint */
  --accent-teal: #34C759;          /* Apple green accent (used sparingly) */
  --accent-teal-light: #E5F8EB;    /* Soft green tint */
  
  /* Neutral Colors - Sophisticated grayscale */
  --neutral-50: #F5F5F7;
  --neutral-100: #ECECEF;
  --neutral-200: #E0E0E5;
  --neutral-300: #C7C7CC;
  --neutral-400: #8E8E93;
  --neutral-500: #636366;
  --neutral-600: #48484A;
  --neutral-700: #3A3A3C;
  --neutral-800: #1C1C1E;
  --neutral-900: #050505;
  
  /* Semantic Colors - Professional palette */
  --success-50: #E5F8EB;
  --success-500: #30D158;
  --success-600: #2AC056;
  --success-700: #248A3D;
  
  --warning-50: #FFF5E6;
  --warning-500: #FF9F0A;
  --warning-600: #C97800;
  
  --error-50: #FDEEEE;
  --error-500: #FF453A;
  --error-600: #D83A30;
  
  --info-50: #E8F0FF;
  --info-500: #0A84FF;
  --info-600: #0060DF;
  
  /* Gradients - Subtle and professional */
  --gradient-hero: linear-gradient(180deg, #FFFFFF 0%, #F5F5F7 100%);
  --gradient-blue: linear-gradient(180deg, #0A84FF 0%, #0060DF 100%);
  --gradient-subtle: linear-gradient(180deg, #FFFFFF 0%, #F5F5F7 100%);
  --gradient-card: linear-gradient(180deg, #FFFFFF 0%, #F7F7FB 100%);
  
  /* Glass-morphism - Refined */
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(10, 37, 64, 0.1);
  
  /* Typography - Professional system fonts */
  --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", "SF Pro Display", "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", "SF Pro Display", sans-serif;
  --font-mono: "SF Mono", Monaco, "Cascadia Code", "Consolas", monospace;
  --font-chinese: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  
  /* Font Sizes - Refined 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-regular: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  
  /* Line Heights - Apple-refined */
  --leading-tight: 1.2;        /* Headings */
  --leading-snug: 1.35;        /* Subheadings */
  --leading-normal: 1.45;      /* Body text */
  --leading-relaxed: 1.5;      /* Comfortable reading */
  --leading-loose: 1.625;      /* Extra spacious */
  
  /* Spacing Scale (8px base) */
  --space-1: 0.5rem;    /* 8px */
  --space-2: 1rem;      /* 16px */
  --space-3: 1.5rem;    /* 24px */
  --space-4: 2rem;      /* 32px */
  --space-5: 2.5rem;    /* 40px */
  --space-6: 3rem;      /* 48px */
  --space-8: 4rem;      /* 64px */
  --space-10: 5rem;     /* 80px */
  --space-12: 6rem;     /* 96px */
  --space-16: 8rem;     /* 128px */
  
  /* Container Widths */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1536px;
  
  /* Shadows - Refined depth */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 24px rgba(15, 15, 15, 0.06);
  --shadow-lg: 0 18px 36px rgba(15, 15, 15, 0.08);
  --shadow-xl: 0 26px 48px rgba(15, 15, 15, 0.12);
  --shadow-2xl: 0 40px 60px rgba(15, 15, 15, 0.16);
  --shadow-focus: 0 0 0 3px rgba(10, 132, 255, 0.2);
  
  /* Border Radius - Refined */
  --radius-sm: 0.375rem;  /* 6px */
  --radius-md: 0.5rem;    /* 8px */
  --radius-lg: 0.75rem;   /* 12px */
  --radius-xl: 1rem;      /* 16px */
  --radius-2xl: 1.5rem;   /* 24px */
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 500ms cubic-bezier(0.4, 0, 0.1, 1);
  
  /* Z-index Scale */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

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

html {
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: var(--font-regular);
  color: var(--neutral-800);
  background-color: var(--neutral-50);
  line-height: var(--leading-normal);
}

/* Typography - Apple-style hierarchy */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-semibold);
  line-height: var(--leading-tight);
  color: var(--neutral-900);
  margin-bottom: var(--space-3);
  letter-spacing: -0.02em;
}

h1 { 
  font-size: var(--text-5xl); 
  font-weight: var(--font-bold);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
h2 { 
  font-size: var(--text-4xl); 
  font-weight: var(--font-semibold);
  letter-spacing: -0.02em;
  line-height: 1.15;
}
h3 { 
  font-size: var(--text-3xl);
  font-weight: var(--font-semibold);
  letter-spacing: -0.02em;
}
h4 { 
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
}
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
  margin-bottom: var(--space-3);
  line-height: 1.5;
  color: var(--neutral-700);
  letter-spacing: -0.01em;
}

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

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

strong {
  font-weight: var(--font-semibold);
  color: var(--neutral-900);
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--neutral-100);
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-sm);
  color: var(--primary-blue);
}

/* Lists - Professional styling */
ul, ol {
  margin-bottom: var(--space-3);
  padding-left: var(--space-5);
}

li {
  margin-bottom: var(--space-2);
  color: var(--neutral-700);
}

/* Buttons Reset */
button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* Forms Reset */
input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

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

/* Tables - Professional styling */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-4);
}

th, td {
  padding: var(--space-3);
  text-align: left;
  border-bottom: 1px solid var(--neutral-200);
}

th {
  font-weight: var(--font-semibold);
  background: var(--neutral-100);
  color: var(--neutral-900);
}

/* Focus Styles - Accessibility */
*:focus-visible {
  outline: 2px solid var(--accent-teal);
  outline-offset: 2px;
}

/* Selection */
::selection {
  background: var(--primary-blue);
  color: white;
}

/* Scrollbar Styling (Webkit) - Professional */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--neutral-100);
}

::-webkit-scrollbar-thumb {
  background: var(--neutral-300);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--neutral-400);
}

/* Utility Classes */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Responsive Typography */
@media (max-width: 768px) {
  :root {
    --text-5xl: 2rem;      /* 32px on mobile */
    --text-4xl: 1.75rem;   /* 28px on mobile */
    --text-3xl: 1.5rem;    /* 24px on mobile */
  }
  
  html {
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }
}

/* Print Styles */
@media print {
  body {
    background: white;
    color: black;
  }
  
  a {
    text-decoration: underline;
  }
  
  .no-print {
    display: none !important;
  }
}
