/* ========================================
   BASE STYLES - CSS VARIABLES & RESET
   ======================================== */

:root {
  /* ========================================
     COLOR SYSTEM
     ======================================== */
  
  /* Wise Owl Design System - Brand Colors */
  /* Sage (Primary) - Ink Night - The Sage's Logic */
  --sage: #1E293B;
  --sage-soft: #334155;
  
  /* Canvas (Neutral) - Light Gray - The Canvas */
  --canvas: #F2F4F7;
  
  /* Honey (Accent) - Golden Honey - The Caregiver's Touch */
  --honey: #EAB308;
  --honey-burnt: #CA8A04;
  
  /* Legacy aliases for backward compatibility */
  --bg-neutral: var(--canvas);  /* Light Gray - 60% */
  --text-main: var(--sage);  /* Ink Night - 30% */
  --brand-accent: var(--honey);  /* Golden Honey - 10% */
  --white: #FFFFFF;
  
  /* Primary Colors - Sage */
  --primary-color: var(--sage);  /* Ink Night */
  --primary-gradient: linear-gradient(135deg, var(--sage) 0%, #0f172a 100%);
  --primary-light: var(--sage-soft);
  --primary-dark: #0f172a;
  
  /* Accent Colors - Honey */
  --accent-color: var(--honey);  /* Golden Honey */
  --accent-light: #fde047;
  --accent-dark: var(--honey-burnt);
  
  /* Semantic Colors */
  --success-color: #28a745;
  --warning-color: var(--brand-accent);
  --danger-color: #dc3545;
  --info-color: #17a2b8;
  
  /* Bootstrap CSS Variable Overrides - Design System */
  --bs-primary: var(--honey);  /* Override Bootstrap's blue primary with Honey */
  --bs-primary-rgb: 234, 179, 8;  /* Honey RGB values */
  
  /* Neutral Colors */
  --surface-light: var(--bg-neutral);
  --gray-50: var(--bg-neutral);
  --gray-100: #e2e8f0;
  --gray-200: #cbd5e1;
  --gray-300: #94a3b8;
  --gray-400: #64748b;
  --gray-500: #475569;
  --gray-600: #334155;
  --gray-700: #1e293b;
  --gray-800: #0f172a;
  --gray-900: #020617;
  
  /* Border Colors */
  --border-color: #cbd5e1;
  
  /* Text Colors */
  --text-primary: var(--text-main);  /* Ink Night */
  --text-secondary: #64748b;
  --text-muted: var(--gray-500);
  --text-light: var(--gray-400);
  
  /* Background Colors */
  --bg-primary: var(--white);
  --bg-secondary: var(--canvas);  /* Canvas - Light Gray */
  --bg-tertiary: var(--gray-100);
  
  /* ========================================
     SPACING SCALE
     ======================================== */
  
  --spacing-xs: 0.25rem;    /* 4px */
  --spacing-sm: 0.5rem;      /* 8px */
  --spacing-md: 1rem;        /* 16px */
  --spacing-lg: 1.5rem;       /* 24px */
  --spacing-xl: 2rem;        /* 32px */
  --spacing-2xl: 3rem;       /* 48px */
  --spacing-3xl: 4rem;       /* 64px */
  
  /* ========================================
     TYPOGRAPHY SCALE
     ======================================== */
  
  /* Typography - Brand Guidelines */
  --font-family-headings: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-family-base: "Open Sans", "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-family-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
  
  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-base: 1rem;    /* 16px */
  --font-size-lg: 1.125rem;  /* 18px */
  --font-size-xl: 1.25rem;   /* 20px */
  --font-size-2xl: 1.5rem;   /* 24px */
  --font-size-3xl: 1.875rem; /* 30px */
  --font-size-4xl: 2.25rem;  /* 36px */
  
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;
  
  /* ========================================
     Z-INDEX SCALE
     ======================================== */
  
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 100000;
  --z-modal: 100001;
  --z-offcanvas: 100002;
  --z-tooltip: 100003;
  
  /* ========================================
     BORDER RADIUS
     ======================================== */
  
  --border-radius-sm: 0.25rem;  /* 4px */
  --border-radius-md: 0.375rem;  /* 6px */
  --border-radius-lg: 0.5rem;   /* 8px */
  --border-radius-xl: 0.75rem;  /* 12px */
  --border-radius-2xl: 1rem;     /* 16px */
  --border-radius-full: 9999px;
  
  /* ========================================
     SHADOWS
     ======================================== */
  
  /* Shadow System - Ink Night (no pure black) - Brand Guidelines */
  --shadow-sm: 0 1px 2px 0 rgba(30, 41, 59, 0.05); /* Ink Night - No pure black */
  --shadow-md: 0 4px 6px -1px rgba(30, 41, 59, 0.1), 0 2px 4px -1px rgba(30, 41, 59, 0.06); /* Ink Night */
  --shadow-lg: 0 10px 15px -3px rgba(30, 41, 59, 0.1), 0 4px 6px -2px rgba(30, 41, 59, 0.05); /* Ink Night */
  --shadow-xl: 0 20px 25px -5px rgba(30, 41, 59, 0.1), 0 10px 10px -5px rgba(30, 41, 59, 0.04); /* Ink Night */
  
  /* ========================================
     TRANSITIONS
     ======================================== */
  
  --transition-fast: 150ms ease-in-out;
  --transition-normal: 300ms ease-in-out;
  --transition-slow: 500ms ease-in-out;
  
  /* ========================================
     BREAKPOINTS (for reference)
     ======================================== */
  
  --breakpoint-sm: 576px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 992px;
  --breakpoint-xl: 1200px;
  --breakpoint-2xl: 1400px;
}

/* ========================================
   RESET & BASE STYLES
   ======================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  line-height: var(--line-height-normal);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);  /* 400 - Regular for body text */
  line-height: var(--line-height-normal);
  color: var(--text-main);
  background-color: var(--bg-neutral);  /* Light Gray background */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

/* Skip link for keyboard navigation */
.skip-link {
  position: absolute;
  top: -40px;
  left: var(--spacing-md);
  background: var(--primary-color);
  color: var(--white);
  padding: var(--spacing-sm) var(--spacing-md);
  text-decoration: none;
  border-radius: var(--border-radius-md);
  z-index: var(--z-modal);
  font-weight: var(--font-weight-medium);
  transition: var(--transition-fast);
}

.skip-link:focus {
  top: var(--spacing-sm);
}

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

.sr-only-focusable:focus {
  position: static;
  width: auto;
  height: auto;
  padding: inherit;
  margin: inherit;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* ========================================
   FOCUS STYLES
   ======================================== */

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

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

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

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

h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: var(--spacing-md);
  font-family: var(--font-family-headings);  /* Poppins */
  line-height: var(--line-height-tight);
  color: var(--sage);  /* text-sage */
}

/* H1: text-3xl md:text-4xl font-semibold text-sage */
h1 {
  font-size: var(--font-size-3xl);  /* 1.875rem = 30px - text-3xl */
  font-weight: var(--font-weight-semibold);  /* 600 - font-semibold */
}

@media (min-width: 768px) {
  h1 {
    font-size: var(--font-size-4xl);  /* 2.25rem = 36px - md:text-4xl */
  }
}

/* H2: text-xl md:text-2xl font-medium text-sage mb-4 */
h2 {
  font-size: var(--font-size-xl);  /* 1.25rem = 20px - text-xl */
  font-weight: var(--font-weight-medium);  /* 500 - font-medium */
  margin-bottom: var(--spacing-xl);  /* mb-4 = 1rem = 16px */
}

@media (min-width: 768px) {
  h2 {
    font-size: var(--font-size-2xl);  /* 1.5rem = 24px - md:text-2xl */
  }
}
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

/* Body text: text-base text-slate-600 leading-relaxed max-w-prose */
p {
  margin-top: 0;
  margin-bottom: var(--spacing-md);
  font-family: var(--font-family-base);  /* Open Sans */
  font-size: var(--font-size-base);  /* text-base */
  color: #475569;  /* text-slate-600 */
  line-height: var(--line-height-relaxed);  /* leading-relaxed */
  max-width: 65ch;  /* max-w-prose */
}

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

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

/* ========================================
   FORM ELEMENTS BASE
   ======================================== */

input,
button,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

button {
  cursor: pointer;
}

/* ========================================
   IMAGE OPTIMIZATION
   ======================================== */

img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

/* ========================================
   CONTAINER BASE
   ======================================== */

.container-fluid {
  max-width: 100%;
  overflow-x: hidden;
}

@media (min-width: 768px) {
  .container-fluid {
    max-width: 100%;
    padding-left: var(--spacing-xl);
    padding-right: var(--spacing-xl);
  }
}

@media (min-width: 1200px) {
  .container-fluid {
    max-width: 1200px;
    margin: 0 auto;
  }
}

/* Google brand icon (social login / connections) */
.google-icon {
  flex-shrink: 0;
  display: block;
  vertical-align: middle;
}

/* ========================================
   LUCIDE ICONS (Wise Owl: stroke 2px, sage/honey)
   ======================================== */
[data-lucide] + svg,
svg.lucide {
  stroke-width: 2;
}
/* Interactive icons: sage by default, honey on hover */
a [data-lucide],
button [data-lucide],
.btn [data-lucide] {
  color: var(--text-main);
}
a:hover [data-lucide],
button:hover [data-lucide],
.btn:hover [data-lucide] {
  color: var(--brand-accent);
}
/* Honey/primary buttons: keep icons sage so they stay visible on yellow background */
.btn-primary [data-lucide],
.btn-primary:hover [data-lucide],
.btn-primary svg.lucide,
.btn-primary:hover svg.lucide,
.btn.bg-honey [data-lucide],
.btn.bg-honey:hover [data-lucide],
.btn-login [data-lucide],
.btn-login:hover [data-lucide],
.btn-login svg.lucide,
.btn-login:hover svg.lucide,
a.btn-primary [data-lucide],
a.btn-primary:hover [data-lucide] {
  color: var(--text-main);
}
