/* ============================================================
   BUSINESS DIAGNOSTIC PLATFORM — Design System
   Version: 1.0 | Dark Mode by default
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400&family=Inter:wght@300;400;500;600;700&display=swap');

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'DM Sans', sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
ul, ol { list-style: none; }
input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* ---- Color Tokens: Dark Mode ----------------------------- */
:root,
[data-theme="dark"] {
  /* Backgrounds */
  --color-bg:             #09090B;
  --color-bg-elevated:    #18181B;
  --color-bg-card:        #18181B;
  --color-bg-input:       #1C1C1F;
  --color-bg-hover:       #27272A;

  /* Borders */
  --color-border:         #27272A;
  --color-border-subtle:  #1f1f22;
  --color-border-focus:   #6366F1;

  /* Text */
  --color-text-primary:   #FAFAFA;
  --color-text-secondary: #A1A1AA;
  --color-text-muted:     #52525B;
  --color-text-inverse:   #09090B;

  /* Brand / Accent */
  --color-primary:        #6366F1;
  --color-primary-hover:  #4F52D8;
  --color-primary-light:  rgba(99, 102, 241, 0.12);
  --color-primary-glow:   rgba(99, 102, 241, 0.25);

  /* Semantic */
  --color-success:        #22D3EE;
  --color-success-bg:     rgba(34, 211, 238, 0.1);
  --color-warning:        #F59E0B;
  --color-warning-bg:     rgba(245, 158, 11, 0.1);
  --color-error:          #EF4444;
  --color-error-bg:       rgba(239, 68, 68, 0.1);
  --color-info:           #818CF8;
  --color-info-bg:        rgba(129, 140, 248, 0.1);

  /* Glass */
  --glass-bg:             rgba(24, 24, 27, 0.7);
  --glass-border:         rgba(255, 255, 255, 0.06);
  --glass-blur:           blur(16px);

  /* Shadows */
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:   0 8px 40px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.2);

  /* Radii */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-full: 9999px;

  /* Spacing scale */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* Typography */
  --font-display: 'Plus Jakarta Sans', sans-serif;
  --font-body:    'Inter', sans-serif;

  --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;
  --text-6xl:  3.75rem;
  --text-7xl:  4.5rem;

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-base:   250ms ease;
  --transition-slow:   400ms ease;
  --transition-spring: 350ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-index */
  --z-base:    0;
  --z-raised:  10;
  --z-overlay: 100;
  --z-modal:   200;
  --z-toast:   300;
  --z-top:     400;
}

/* ---- Color Tokens: Light Mode ---------------------------- */
[data-theme="light"] {
  --color-bg:             #F4F4F5;
  --color-bg-elevated:    #FFFFFF;
  --color-bg-card:        #FFFFFF;
  --color-bg-input:       #FAFAFA;
  --color-bg-hover:       #F0F0F3;

  --color-border:         #E4E4E7;
  --color-border-subtle:  #F0F0F3;
  --color-border-focus:   #6366F1;

  --color-text-primary:   #09090B;
  --color-text-secondary: #52525B;
  --color-text-muted:     #A1A1AA;
  --color-text-inverse:   #FAFAFA;

  --color-primary:        #4F52D8;
  --color-primary-hover:  #3D40C7;
  --color-primary-light:  rgba(79, 82, 216, 0.08);
  --color-primary-glow:   rgba(79, 82, 216, 0.15);

  --glass-bg:             rgba(255, 255, 255, 0.8);
  --glass-border:         rgba(0, 0, 0, 0.06);

  --shadow-sm:   0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.1);
  --shadow-lg:   0 8px 40px rgba(0,0,0,0.12);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.12);
}

/* ---- Typography Utilities -------------------------------- */
.font-display { font-family: var(--font-display); }
.font-body    { font-family: var(--font-body); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--color-text-primary);
}

.text-xs    { font-size: var(--text-xs); }
.text-sm    { font-size: var(--text-sm); }
.text-base  { font-size: var(--text-base); }
.text-lg    { font-size: var(--text-lg); }
.text-xl    { font-size: var(--text-xl); }
.text-2xl   { font-size: var(--text-2xl); }
.text-3xl   { font-size: var(--text-3xl); }
.text-4xl   { font-size: var(--text-4xl); }
.text-5xl   { font-size: var(--text-5xl); }
.text-6xl   { font-size: var(--text-6xl); }
.text-7xl   { font-size: var(--text-7xl); }

.text-primary   { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted     { color: var(--color-text-muted); }
.text-accent    { color: var(--color-primary); }
.text-success   { color: var(--color-success); }
.text-warning   { color: var(--color-warning); }
.text-error     { color: var(--color-error); }

.font-normal   { font-weight: 400; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }
.font-extrabold{ font-weight: 800; }

/* ---- Layout Utilities ------------------------------------ */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.container-wide {
  width: 100%;
  max-width: 1400px;
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.flex-center { align-items: center; justify-content: center; }
.flex-between{ align-items: center; justify-content: space-between; }
.flex-wrap   { flex-wrap: wrap; }
.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-12 { gap: var(--space-12); }

.grid { display: grid; }

.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }

.text-center { text-align: center; }
.text-left   { text-align: left; }

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