/* ============================================
   EtaleHub Design System
   AI Office Manager for Plumbing & Heating
   ============================================ */

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

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

body {
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-family: var(--font-body);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  overflow-x: hidden;
}

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

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

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

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

ul,
ol {
  list-style: none;
}

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

/* ---------- Design Tokens ---------- */
:root {
  /* --- Colors: Dark Navy Palette --- */
  --navy-950: #060B18;
  --navy-900: #0B1426;
  --navy-800: #111D35;
  --navy-700: #1A2A4A;
  --navy-600: #243B6A;
  --navy-500: #2E4D8A;

  /* --- Colors: Slate / Neutral --- */
  --slate-900: #0F172A;
  --slate-800: #1E293B;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748B;
  --slate-400: #94A3B8;
  --slate-300: #CBD5E1;
  --slate-200: #E2E8F0;
  --slate-100: #F1F5F9;
  --slate-50:  #F8FAFC;

  /* --- Colors: Brand Blue --- */
  --blue-600: #2563EB;
  --blue-500: #3B82F6;
  --blue-400: #60A5FA;
  --blue-300: #93C5FD;
  --blue-200: #BFDBFE;
  --blue-100: #DBEAFE;
  --blue-50:  #EFF6FF;

  /* --- Colors: Teal / AI Accent --- */
  --teal-600: #0D9488;
  --teal-500: #14B8A6;
  --teal-400: #2DD4BF;
  --teal-300: #5EEAD4;
  --teal-200: #99F6E4;

  /* --- Colors: Orange / CTA Accent --- */
  --orange-600: #EA580C;
  --orange-500: #F97316;
  --orange-400: #FB923C;
  --orange-300: #FDBA74;

  /* --- Colors: Green / Success --- */
  --green-600: #16A34A;
  --green-500: #22C55E;
  --green-400: #4ADE80;
  --green-300: #86EFAC;
  --green-200: #BBF7D0;
  --green-100: #DCFCE7;

  /* --- Colors: Warning --- */
  --amber-500: #F59E0B;
  --amber-400: #FBBF24;
  --amber-300: #FCD34D;
  --amber-100: #FEF3C7;

  /* --- Colors: Danger / Error --- */
  --red-600: #DC2626;
  --red-500: #EF4444;
  --red-400: #F87171;
  --red-300: #FCA5A5;
  --red-100: #FEE2E2;

  /* --- Colors: White --- */
  --white: #FFFFFF;
  --off-white: #F8FAFC;

  /* --- Semantic Color Aliases --- */
  --bg-primary: var(--white);
  --bg-dark: var(--navy-900);
  --bg-dark-elevated: var(--navy-800);
  --bg-dark-surface: var(--navy-700);
  --bg-light: var(--slate-50);
  --bg-light-elevated: var(--white);
  --bg-section-alt: var(--slate-100);

  --text-primary: var(--slate-900);
  --text-secondary: var(--slate-600);
  --text-muted: var(--slate-400);
  --text-on-dark: var(--slate-100);
  --text-on-dark-muted: var(--slate-400);
  --text-accent: var(--blue-500);
  --text-success: var(--green-500);
  --text-warning: var(--amber-500);
  --text-danger: var(--red-500);

  --border-default: var(--slate-200);
  --border-dark: var(--navy-700);
  --border-hover: var(--slate-300);
  --border-focus: var(--blue-500);

  --brand-primary: var(--blue-500);
  --brand-primary-hover: var(--blue-600);
  --brand-secondary: var(--teal-500);
  --brand-secondary-hover: var(--teal-600);
  --brand-accent: var(--orange-500);
  --brand-accent-hover: var(--orange-600);

  /* --- Typography --- */
  --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* Font Sizes — fluid 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 */
  --text-6xl:  3.75rem;    /* 60px */
  --text-7xl:  4.5rem;     /* 72px */

  /* Font Weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;

  /* Line Heights */
  --leading-none: 1;
  --leading-tight: 1.15;
  --leading-snug: 1.3;
  --leading-normal: 1.6;
  --leading-relaxed: 1.75;

  /* Letter Spacing */
  --tracking-tight: -0.025em;
  --tracking-normal: 0;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.05em;
  --tracking-widest: 0.1em;

  /* --- Spacing Scale --- */
  --space-0:  0;
  --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 */
  --space-24: 6rem;      /* 96px */
  --space-32: 8rem;      /* 128px */
  --space-40: 10rem;     /* 160px */

  /* --- Border Radius --- */
  --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;

  /* --- Shadows --- */
  --shadow-sm:   0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md:   0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg:   0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl:   0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-2xl:  0 25px 50px -12px rgba(0, 0, 0, 0.15);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.3);
  --shadow-glow-teal: 0 0 20px rgba(20, 184, 166, 0.3);
  --shadow-dark: 0 10px 30px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 6px 16px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.06), 0 16px 40px rgba(0, 0, 0, 0.1);

  /* --- Transitions --- */
  --ease-default: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in:      cubic-bezier(0.4, 0, 1, 1);
  --ease-out:     cubic-bezier(0, 0, 0.2, 1);
  --ease-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-bounce:  cubic-bezier(0.68, -0.55, 0.265, 1.55);

  --duration-fast:    150ms;
  --duration-normal:  250ms;
  --duration-slow:    400ms;
  --duration-slower:  600ms;

  /* --- Z-Index Scale --- */
  --z-below:    -1;
  --z-base:     0;
  --z-above:    10;
  --z-sticky:   100;
  --z-nav:      200;
  --z-overlay:  300;
  --z-modal:    400;
  --z-toast:    500;
  --z-tooltip:  600;

  /* --- Container Widths --- */
  --container-sm:  640px;
  --container-md:  768px;
  --container-lg:  1024px;
  --container-xl:  1200px;
  --container-2xl: 1400px;

  /* --- Breakpoints (for reference in media queries) ---
     Mobile: 0 - 639px
     Tablet: 640px - 1023px
     Desktop: 1024px+
     Wide: 1280px+
     Ultra: 1400px+
  */
}

/* ---------- Base Typography ---------- */
h1, .h1 {
  font-family: var(--font-display);
  font-weight: var(--font-extrabold);
  font-size: clamp(2.25rem, 5vw, 4rem);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}

h2, .h2 {
  font-family: var(--font-display);
  font-weight: var(--font-bold);
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  line-height: 1.2;
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}

h3, .h3 {
  font-family: var(--font-display);
  font-weight: var(--font-bold);
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  line-height: var(--leading-snug);
  color: var(--text-primary);
}

h4, .h4 {
  font-family: var(--font-body);
  font-weight: var(--font-semibold);
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  color: var(--text-primary);
}

h5, .h5 {
  font-family: var(--font-body);
  font-weight: var(--font-semibold);
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
  color: var(--text-primary);
}

p {
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-secondary);
}

p.large {
  font-size: var(--text-lg);
}

p.small {
  font-size: var(--text-sm);
}

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

/* Dark section text overrides */
.dark-section h1,
.dark-section h2,
.dark-section h3,
.dark-section h4,
.dark-section h5,
.dark-section .h1,
.dark-section .h2,
.dark-section .h3,
.dark-section .h4,
.dark-section .h5 {
  color: var(--text-on-dark);
}

.dark-section p,
.dark-section li {
  color: var(--text-on-dark-muted);
}

/* ---------- Utility Classes ---------- */

/* Display */
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.hidden { display: none; }

/* Flexbox */
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }
.gap-10 { gap: var(--space-10); }
.gap-12 { gap: var(--space-12); }

/* Text alignment */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Text colors */
.text-accent { color: var(--text-accent); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--text-success); }
.text-warning { color: var(--text-warning); }
.text-danger { color: var(--text-danger); }
.text-white { color: var(--white); }

/* Widths */
.w-full { width: 100%; }
.max-w-sm { max-width: var(--container-sm); }
.max-w-md { max-width: var(--container-md); }
.max-w-lg { max-width: var(--container-lg); }
.max-w-xl { max-width: var(--container-xl); }
.max-w-2xl { max-width: var(--container-2xl); }

/* Margins */
.mx-auto { margin-left: auto; margin-right: auto; }

/* Visibility helpers */
.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;
}

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.sticky { position: sticky; }
.overflow-hidden { overflow: hidden; }

/* Responsive visibility */
@media (max-width: 639px) {
  .hide-mobile { display: none !important; }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .hide-tablet { display: none !important; }
}

@media (min-width: 1024px) {
  .hide-desktop { display: none !important; }
}

@media (max-width: 1023px) {
  .hide-below-desktop { display: none !important; }
}

/* ---------- Selection Styles ---------- */
::selection {
  background-color: var(--blue-200);
  color: var(--navy-900);
}

/* ---------- Scrollbar Styling ---------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

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

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

/* ---------- Focus Styles ---------- */
:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---------- Print Styles ---------- */
@media print {
  nav,
  footer,
  .no-print {
    display: none !important;
  }

  body {
    background: white;
    color: black;
    font-size: 12pt;
  }
}
