/* ========================================================================
   Variables
   ======================================================================== */
:root {
  /* Color System */
  --color-background: #0f1722; /* Deep steel/navy background */
  --color-surface: #111827; /* Elevated surfaces (cards, header) */
  --color-surface-soft: #1f2933; /* Softer surfaces/sections */
  --color-text: #e5e7eb; /* Primary text on dark */
  --color-text-muted: #9ca3af; /* Secondary text */

  --color-primary: #2563eb; /* Corporate blue */
  --color-primary-soft: rgba(37, 99, 235, 0.12);
  --color-primary-strong: #1d4ed8;

  --color-success: #22c55e;
  --color-warning: #eab308;
  --color-danger: #ef4444;

  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2933;
  --gray-900: #111827;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Georgia", "Times New Roman", serif;
  --font-mono: "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", 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-size-5xl: 3rem;     /* 48px */

  --line-height-tight: 1.2;
  --line-height-snug: 1.35;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* Spacing scale (0–96px) */
  --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 */

  /* Border radius */
  --radius-sm: 0.25rem;  /* 4px */
  --radius-md: 0.5rem;   /* 8px */
  --radius-lg: 0.75rem;  /* 12px */
  --radius-xl: 1rem;     /* 16px */
  --radius-full: 9999px;

  /* Shadows (subtle, corporate) */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 8px 20px rgba(15, 23, 42, 0.32);
  --shadow-lg: 0 18px 45px rgba(15, 23, 42, 0.45);

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition-normal: 180ms ease-out;
  --transition-slow: 240ms ease-out;
}

/* ========================================================================
   Reset / Normalize
   ======================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul[class],
ol[class] {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

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

button {
  border: none;
  background: none;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ========================================================================
   Base Styles
   ======================================================================== */
body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  background-color: var(--color-background);
  color: var(--color-text);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

main {
  display: block;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: var(--line-height-tight);
  color: #f9fafb;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.25rem, 2vw + 1.5rem, 3rem);
  margin-bottom: var(--space-4);
}

h2 {
  font-size: clamp(1.75rem, 1.2vw + 1.5rem, 2.25rem);
  margin-bottom: var(--space-3);
}

h3 {
  font-size: 1.5rem;
  margin-bottom: var(--space-2);
}

h4 {
  font-size: 1.25rem;
  margin-bottom: var(--space-2);
}

h5 {
  font-size: 1.125rem;
  margin-bottom: var(--space-1);
}

h6 {
  font-size: 1rem;
  margin-bottom: var(--space-1);
}

p {
  margin-bottom: var(--space-4);
  color: var(--color-text);
}

p:last-child {
  margin-bottom: 0;
}

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

a:hover {
  color: var(--color-primary-strong);
}

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

strong,
b {
  font-weight: 600;
}

code,
pre {
  font-family: var(--font-mono);
}

hr {
  border: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.24);
  margin: var(--space-6) 0;
}

/* ========================================================================
   Accessibility
   ======================================================================== */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

/* Screen reader only utility */
.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,
.sr-only-focusable:focus-visible {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

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

@media (min-width: 1280px) {
  .container {
    max-width: 1240px;
  }
}

.section {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}

/* Flex helpers */
.flex {
  display: flex;
}

.inline-flex {
  display: inline-flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.flex-column {
  display: flex;
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.gap-sm {
  gap: var(--space-3);
}

.gap-md {
  gap: var(--space-4);
}

.gap-lg {
  gap: var(--space-6);
}

/* Grid helpers */
.grid {
  display: grid;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-6);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6);
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Spacing utilities (margin/padding) - minimal set for layout */
.mt-0 { margin-top: 0 !important; }
.mt-sm { margin-top: var(--space-3) !important; }
.mt-md { margin-top: var(--space-6) !important; }
.mt-lg { margin-top: var(--space-10) !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-sm { margin-bottom: var(--space-3) !important; }
.mb-md { margin-bottom: var(--space-6) !important; }
.mb-lg { margin-bottom: var(--space-10) !important; }

.pt-sm { padding-top: var(--space-3) !important; }
.pt-md { padding-top: var(--space-6) !important; }
.pt-lg { padding-top: var(--space-10) !important; }

.pb-sm { padding-bottom: var(--space-3) !important; }
.pb-md { padding-bottom: var(--space-6) !important; }
.pb-lg { padding-bottom: var(--space-10) !important; }

.text-center { text-align: center !important; }
.text-right { text-align: right !important; }

/* Width helpers */
.w-full { width: 100%; }

/* ========================================================================
   Components
   ======================================================================== */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.625rem 1.5rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: 500;
  line-height: 1.4;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color var(--transition-normal),
    color var(--transition-normal),
    border-color var(--transition-normal),
    box-shadow var(--transition-normal),
    transform var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #f9fafb;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: 0 18px 45px rgba(37, 99, 235, 0.5);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.35);
}

.btn-outline {
  background-color: transparent;
  color: #e5e7eb;
  border-color: rgba(148, 163, 184, 0.45);
}

.btn-outline:hover {
  background-color: rgba(15, 23, 42, 0.9);
  border-color: rgba(148, 163, 184, 0.8);
}

.btn-ghost {
  background-color: rgba(15, 23, 42, 0.75);
  color: #e5e7eb;
}

.btn-ghost:hover {
  background-color: rgba(17, 24, 39, 0.95);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
  transform: none;
}

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

/* Inputs & Form Controls */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.4);
  background-color: rgba(15, 23, 42, 0.9);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  line-height: 1.4;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast);
}

input::placeholder,
textarea::placeholder {
  color: var(--color-text-muted);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary-soft), 0 0 0 1px var(--color-primary);
  background-color: #020617;
}

input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

label {
  display: inline-block;
  margin-bottom: var(--space-1);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* Card */
.card {
  background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.14), transparent 55%),
    var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.card--soft {
  background-color: var(--color-surface-soft);
  box-shadow: var(--shadow-sm);
}

.card-header {
  margin-bottom: var(--space-4);
}

.card-title {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-2);
}

.card-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.card-body {
  font-size: var(--font-size-sm);
}

/* Tag / Pill (e.g., for fleet types, statuses) */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid rgba(148, 163, 184, 0.5);
  color: var(--gray-200);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.85));
}

.badge--primary {
  border-color: rgba(37, 99, 235, 0.65);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.25), rgba(15, 23, 42, 0.9));
  color: #dbeafe;
}

.badge--success {
  border-color: rgba(34, 197, 94, 0.55);
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.35), rgba(15, 23, 42, 0.9));
  color: #bbf7d0;
}

/* Navigation helpers (generic, for consistency) */
.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.88));
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.nav-link {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition:
    color var(--transition-fast),
    border-color var(--transition-fast),
    opacity var(--transition-fast);
}

.nav-link:hover {
  color: #e5e7eb;
}

.nav-link--active {
  color: #e5e7eb;
  border-color: var(--color-primary);
}

/* Hero-specific helpers for consistent look */
.hero {
  position: relative;
  padding-top: var(--space-20);
  padding-bottom: var(--space-20);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.35), transparent 60%);
  opacity: 0.7;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero-kicker {
  font-size: var(--font-size-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.hero-title {
  font-size: clamp(2.5rem, 3vw + 1.8rem, 3.5rem);
  max-width: 24ch;
}

.hero-subtitle {
  margin-top: var(--space-4);
  max-width: 42ch;
  color: var(--color-text-muted);
}

/* Status / metric blocks (for KPIs: on-time delivery, coverage, etc.) */
.metric {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.metric-label {
  font-size: var(--font-size-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.metric-value {
  font-size: var(--font-size-2xl);
  font-weight: 600;
}

.metric-caption {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* Tables (for fleet data, lane coverage, etc.) */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.table thead {
  background-color: rgba(15, 23, 42, 0.98);
}

.table th,
.table td {
  padding: 0.75rem 0.75rem;
  text-align: left;
}

.table th {
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  border-bottom: 1px solid rgba(148, 163, 184, 0.45);
}

.table tbody tr {
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.table tbody tr:nth-child(even) {
  background-color: rgba(15, 23, 42, 0.7);
}

.table tbody tr:hover {
  background-color: rgba(15, 23, 42, 0.9);
}

/* Testimonials (basic skeleton) */
.testimonial-quote {
  font-style: italic;
  color: var(--color-text);
}

.testimonial-author {
  margin-top: var(--space-3);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* Footer */
.footer {
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.24), transparent 55%),
    #020617;
  padding-top: var(--space-10);
  padding-bottom: var(--space-10);
  color: var(--color-text-muted);
}

.footer a {
  color: inherit;
}

.footer a:hover {
  color: #e5e7eb;
}

/* ========================================================================
   End of base.css
   ======================================================================== */
