/* ============================================================
   base.css — Reset, Custom Properties, Typography, Utilities
   High-craft dark fintech aesthetic (human-designed feel)
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
  scroll-behavior: smooth;
}

body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(99, 102, 241, 0.03) 0%, transparent 40%);
  background-attachment: fixed;
  min-height: 100vh;
}

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

input, button, textarea, select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

button {
  cursor: pointer;
}

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

h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.025em;
  font-weight: 600;
  color: var(--color-text);
}

ul, ol {
  list-style: none;
}

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

table {
  border-collapse: collapse;
}

/* ----- CSS Custom Properties ----- */
:root {
  /* Surface Layers */
  --color-bg:              #090b10;
  --color-surface:         #111520;
  --color-surface-2:       #171d2b;
  --color-surface-3:       #1f2638;
  
  /* Hairline Translucent Borders */
  --color-border:          rgba(255, 255, 255, 0.07);
  --color-border-light:    rgba(255, 255, 255, 0.12);
  --color-border-subtle:   rgba(255, 255, 255, 0.04);
  
  /* Typography Colors */
  --color-text:            #f1f4f9;
  --color-text-muted:      #94a3b8;
  --color-text-subtle:     #5e6d82;
  
  /* Brand / Primary — Electric Cobalt */
  --color-primary:         #3b82f6;
  --color-primary-hover:   #2563eb;
  --color-primary-active:  #1d4ed8;
  --color-primary-muted:   rgba(59, 130, 246, 0.10);
  --color-primary-glow:    rgba(59, 130, 246, 0.22);

  /* Status Colors */
  --color-success:         #10b981;
  --color-success-muted:   rgba(16, 185, 129, 0.10);
  --color-success-glow:    rgba(16, 185, 129, 0.22);
  --color-warning:         #f59e0b;
  --color-warning-muted:   rgba(245, 158, 11, 0.10);
  --color-warning-glow:    rgba(245, 158, 11, 0.22);
  --color-danger:          #ef4444;
  --color-danger-muted:    rgba(239, 68, 68, 0.10);
  --color-danger-glow:     rgba(239, 68, 68, 0.22);
  --color-info:            #6366f1;
  --color-info-muted:      rgba(99, 102, 241, 0.10);

  /* Spacing Scale */
  --spacing-xs:            4px;
  --spacing-sm:            8px;
  --spacing-md:            16px;
  --spacing-lg:            24px;
  --spacing-xl:            32px;
  --spacing-2xl:           48px;

  /* Corner Radii */
  --radius-xs:             4px;
  --radius-sm:             7px;
  --radius-md:             11px;
  --radius-lg:             16px;
  --radius-full:           9999px;

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

  /* Type Scale */
  --font-size-xs:          11px;
  --font-size-sm:          13px;
  --font-size-base:        14px;
  --font-size-md:          15px;
  --font-size-lg:          18px;
  --font-size-xl:          22px;
  --font-size-2xl:         28px;

  --font-weight-regular:   400;
  --font-weight-medium:    500;
  --font-weight-semibold:  600;
  --font-weight-bold:      700;

  /* High-Craft Ambient Shadows & Glass Edge */
  --shadow-sm:             0 1px 2px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--color-border);
  --shadow-md:             0 4px 16px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--color-border);
  --shadow-lg:             0 12px 36px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--color-border);
  --shadow-card:           0 1px 3px rgba(0, 0, 0, 0.35), 0 0 0 1px var(--color-border), inset 0 1px 0 rgba(255, 255, 255, 0.05);

  /* Animation Timings */
  --transition-fast:       120ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition:            180ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow:       280ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Dimensions */
  --sidebar-width:         248px;
  --navbar-height:         60px;
}

/* ----- Code / Monospace ----- */
code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

code {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  color: #93c5fd;
}

/* ----- Selection ----- */
::selection {
  background: rgba(59, 130, 246, 0.35);
  color: #fff;
}

/* ----- Scrollbars ----- */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* ----- Utility Classes ----- */
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1; }

.gap-xs { gap: var(--spacing-xs); }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }

.w-full { width: 100%; }
.w-100 { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-primary { color: var(--color-primary); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger  { color: var(--color-danger); }
.text-muted   { color: var(--color-text-muted); }
.text-subtle  { color: var(--color-text-subtle); }

.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;
}
