/* ================================================================
   Credsure Financial Consultancy — Base Styles
   Design tokens, CSS reset, typography, and base element styles.
   ================================================================ */

/* ── Google Font ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Design Tokens ───────────────────────────────────────────── */
:root {
  /* Primary — Deep Navy Blue */
  --primary: #0F2B5B;
  --primary-light: #1A3F7A;
  --primary-dark: #0A1F42;
  --primary-rgb: 15, 43, 91;

  /* Secondary — White */
  --secondary: #FFFFFF;

  /* Accent — Emerald Green */
  --accent: #10B981;
  --accent-dark: #059669;
  --accent-light: #34D399;
  --accent-rgb: 16, 185, 129;

  /* Surfaces */
  --surface: #F8FAFC;
  --surface-alt: #F1F5F9;
  --surface-elevated: #FFFFFF;

  /* Text */
  --text-primary: #1E293B;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --text-inverse: #FFFFFF;

  /* Borders */
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --border-focus: #0F2B5B;

  /* Semantic */
  --success: #10B981;
  --error: #EF4444;
  --warning: #F59E0B;
  --info: #3B82F6;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(15, 43, 91, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 43, 91, 0.06), 0 1px 2px rgba(15, 43, 91, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 43, 91, 0.07), 0 2px 4px -2px rgba(15, 43, 91, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 43, 91, 0.08), 0 4px 6px -4px rgba(15, 43, 91, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(15, 43, 91, 0.1), 0 8px 10px -6px rgba(15, 43, 91, 0.06);
  --shadow-2xl: 0 25px 50px -12px rgba(15, 43, 91, 0.2);
  --shadow-fab: 0 4px 14px rgba(15, 43, 91, 0.25);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Font Sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;

  /* Line Heights */
  --leading-tight: 1.2;
  --leading-snug: 1.375;
  --leading-normal: 1.6;
  --leading-relaxed: 1.75;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 400ms;

  /* Z-Index Scale */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-fab: 500;
  --z-toast: 600;

  /* Layout */
  --max-width: 1200px;
  --nav-height: 72px;
  --nav-height-mobile: 64px;
}

/* ── CSS Reset ───────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--secondary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--text-primary);
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

/* ── Typography Scale ────────────────────────────────────────── */
h1 {
  font-size: clamp(2rem, 5vw, var(--text-5xl));
  letter-spacing: -0.025em;
}

h2 {
  font-size: clamp(1.5rem, 4vw, var(--text-4xl));
  letter-spacing: -0.02em;
}

h3 {
  font-size: clamp(1.25rem, 3vw, var(--text-2xl));
  letter-spacing: -0.01em;
}

h4 {
  font-size: var(--text-xl);
  font-weight: 600;
}

h5 {
  font-size: var(--text-lg);
  font-weight: 600;
}

h6 {
  font-size: var(--text-base);
  font-weight: 600;
}

/* ── Base Element Styles ─────────────────────────────────────── */
::selection {
  background-color: rgba(var(--primary-rgb), 0.15);
  color: var(--primary);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

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

/* Skip Navigation */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--primary);
  color: var(--text-inverse);
  padding: var(--space-3) var(--space-6);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-weight: 600;
  font-size: var(--text-sm);
  z-index: 9999;
  transition: top var(--duration-fast) var(--ease-out);
}

.skip-link:focus {
  top: 0;
}

/* Visually Hidden (accessible) */
.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;
}

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

/* ── High Contrast Mode ──────────────────────────────────────── */
@media (prefers-contrast: high) {
  :root {
    --border: #000000;
    --shadow-sm: 0 0 0 1px #000;
    --shadow-md: 0 0 0 2px #000;
  }
}
