:root {
  /* =============================
   *  Color System
   * ============================= */
  --color-background: #0f1115;           /* Deep graphite background */
  --color-surface: #181b22;              /* Dark surface panels */
  --color-surface-alt: #1f242c;          /* Alternate panels/cards */
  --color-text: #f4f5f7;                 /* Primary text */
  --color-text-muted: #9da4b0;           /* Muted text */

  --color-primary: #e31b23;              /* Automotive red accents */
  --color-primary-soft: rgba(227, 27, 35, 0.1);

  --color-accent-blue: #214b8f;          /* Dark technical blue */
  --color-accent-blue-soft: rgba(33, 75, 143, 0.12);

  --color-success: #1db954;
  --color-success-soft: rgba(29, 185, 84, 0.12);
  --color-warning: #ffb400;
  --color-warning-soft: rgba(255, 180, 0, 0.16);
  --color-danger: #ff3b30;
  --color-danger-soft: rgba(255, 59, 48, 0.16);

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

  /* Borders & Dividers */
  --color-border-subtle: rgba(255, 255, 255, 0.06);
  --color-border-strong: rgba(255, 255, 255, 0.12);

  /* =============================
   *  Typography
   * ============================= */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-heading: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-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-md: 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 */

  --line-height-tight: 1.15;
  --line-height-snug: 1.3;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  --letter-spacing-tight: -0.02em;
  --letter-spacing-normal: 0;
  --letter-spacing-wide: 0.05em;

  /* =============================
   *  Spacing Scale (px)
   * ============================= */
  --space-0: 0;
  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-28: 28px;
  --space-32: 32px;
  --space-40: 40px;
  --space-48: 48px;
  --space-56: 56px;
  --space-64: 64px;
  --space-72: 72px;
  --space-80: 80px;
  --space-96: 96px;

  /* =============================
   *  Radius & Shadows
   * ============================= */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 999px;

  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.30);
  --shadow-medium: 0 16px 40px rgba(0, 0, 0, 0.45);
  --shadow-hard: 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 24px 60px rgba(0, 0, 0, 0.7);

  /* =============================
   *  Transitions & Motion
   * ============================= */
  --transition-fast: 120ms ease-out;
  --transition-normal: 180ms ease-out;
  --transition-slow: 260ms ease;

  --focus-ring-color: rgba(227, 27, 35, 0.65);
  --focus-ring-width: 2px;
  --focus-ring-offset: 2px;
}

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

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

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

body {
  min-height: 100vh;
}

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

picture {
  display: block;
}

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

button,
[type="button"],
[type="reset"],
[type="submit"] {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

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

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  padding: 0;
}

/* Remove default link underlines; handled in base styles */
a {
  text-decoration: none;
  color: inherit;
}

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

main {
  min-height: 60vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: var(--letter-spacing-tight);
  color: var(--gray-50);
}

h1 {
  font-size: var(--font-size-4xl);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-24);
}

h2 {
  font-size: var(--font-size-3xl);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-20);
}

h3 {
  font-size: var(--font-size-2xl);
  line-height: var(--line-height-snug);
  margin-bottom: var(--space-16);
}

h4 {
  font-size: var(--font-size-xl);
  line-height: var(--line-height-snug);
  margin-bottom: var(--space-12);
}

h5 {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-snug);
  margin-bottom: var(--space-8);
}

h6 {
  font-size: var(--font-size-md);
  line-height: var(--line-height-snug);
  margin-bottom: var(--space-4);
}

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

strong,
b {
  font-weight: 600;
}

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

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

a {
  color: var(--color-primary);
  font-weight: 500;
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color var(--transition-normal),
    text-decoration-color var(--transition-normal);
}

a:hover {
  color: #ff454c;
}

a:active {
  color: #bf151c;
}

a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 var(--focus-ring-width) var(--focus-ring-color);
  border-radius: var(--radius-xs);
}

hr {
  border: 0;
  border-top: 1px solid var(--color-border-subtle);
  margin: var(--space-24) 0;
}

::selection {
  background: rgba(227, 27, 35, 0.4);
  color: #ffffff;
}

/* =============================
 *  Accessibility & Focus
 * ============================= */
:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}

:focus {
  outline: none;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

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

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

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

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

.flex-row {
  flex-direction: row;
}

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

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

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

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

.gap-8 {
  gap: var(--space-8);
}

.gap-16 {
  gap: var(--space-16);
}

.gap-24 {
  gap: var(--space-24);
}

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

.grid-auto-fit-min-200 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-24);
}

/* Spacing utilities (margin / padding) */
.mt-0 {
  margin-top: 0;
}

.mt-16 {
  margin-top: var(--space-16);
}

.mt-24 {
  margin-top: var(--space-24);
}

.mt-32 {
  margin-top: var(--space-32);
}

.mb-0 {
  margin-bottom: 0;
}

.mb-16 {
  margin-bottom: var(--space-16);
}

.mb-24 {
  margin-bottom: var(--space-24);
}

.mb-32 {
  margin-bottom: var(--space-32);
}

.p-16 {
  padding: var(--space-16);
}

.p-24 {
  padding: var(--space-24);
}

.px-16 {
  padding-inline: var(--space-16);
}

.py-16 {
  padding-block: var(--space-16);
}

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

.text-right {
  text-align: right;
}

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

/* =============================
 *  Components – Buttons
 * ============================= */
.button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  padding: 10px 18px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  cursor: pointer;
  transition: background-color var(--transition-normal),
    color var(--transition-normal),
    border-color var(--transition-normal),
    box-shadow var(--transition-normal),
    transform var(--transition-fast);
  background-color: var(--color-primary);
  color: #ffffff !important;
  box-shadow: 0 10px 24px rgba(227, 27, 35, 0.45);
}

.button:hover,
.btn:hover {
  background-color: #ff454c;
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(227, 27, 35, 0.6);
}

.button:active,
.btn:active {
  background-color: #bf151c;
  transform: translateY(0);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
}

.button:focus-visible,
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 var(--focus-ring-width) var(--focus-ring-color),
    0 10px 24px rgba(227, 27, 35, 0.45);
}

.button[disabled],
.btn[disabled],
.button.is-disabled,
.btn.is-disabled {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
  transform: none;
}

/* Button variants */
.btn--secondary {
  background-color: #000000;
  color: var(--color-text) !important;
  border-color: var(--color-border-strong);
  box-shadow: none;
}

.btn--secondary:hover {
  background-color: rgba(255, 255, 255, 0.04);
  border-color: var(--color-primary);
  color:var(--color-primary) !important;
}

.btn--ghost {
  background-color: #000;
  color: var(--color-text) !important;
  border-color: transparent;
  box-shadow: none;
}

.btn--ghost:hover {
  background-color: rgba(255, 255, 255, 0.03);
  color: #000 !important;
}

.btn--danger {
  background-color: var(--color-danger);
  box-shadow: 0 10px 24px rgba(255, 59, 48, 0.45);
}

/* =============================
 *  Components – Form Controls
 * ============================= */
.input,
select,
textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background-color: #11141b;
  color: var(--color-text);
  font-size: var(--font-size-sm);
  transition: border-color var(--transition-normal),
    box-shadow var(--transition-normal),
    background-color var(--transition-normal);
}

.input::placeholder,
textarea::placeholder,
input::placeholder {
  color: var(--gray-500);
}

.input:focus-visible,
select:focus-visible,
textarea:focus-visible,
input[type="text"]:focus-visible,
input[type="email"]:focus-visible,
input[type="password"]:focus-visible,
input[type="search"]:focus-visible,
input[type="tel"]:focus-visible,
input[type="number"]:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary-soft),
    0 0 0 var(--focus-ring-width) var(--focus-ring-color);
}

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

label {
  display: inline-block;
  margin-bottom: var(--space-4);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--gray-200);
}

/* =============================
 *  Components – Card
 * ============================= */
.card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-subtle);
  padding: var(--space-20);
  box-shadow: var(--shadow-soft);
}

.card--elevated {
  box-shadow: var(--shadow-medium);
  border-color: var(--color-border-strong);
}

.card__header {
  margin-bottom: var(--space-16);
}

.card__title {
  font-family: var(--font-heading);
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-4);
}

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

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

.card__footer {
  margin-top: var(--space-16);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-8);
}

/* =============================
 *  Misc Utilities (brand feel)
 * ============================= */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  border: 1px solid var(--color-border-subtle);
  background: rgba(255, 255, 255, 0.02);
}

.badge--success {
  border-color: var(--color-success);
  color: var(--color-success);
}

.badge--warning {
  border-color: var(--color-warning);
  color: var(--color-warning);
}

.badge--danger {
  border-color: var(--color-danger);
  color: var(--color-danger);
}

/* Utility class for subtle metallic separators / headers */
.divider-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  color: var(--gray-400);
}

.divider-label::before,
.divider-label::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.0),
    rgba(255, 255, 255, 0.18),
    rgba(255, 255, 255, 0.0)
  );
}

/* A subtle metallic gradient bar – can be reused for headers or product sections */
.metal-bar {
  height: 3px;
  width: 64px;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, #c0c4cc, #ffffff, #9ca3af);
}

/* =============================
 *  Helper: Status / Feedback
 * ============================= */
.alert {
  padding: var(--space-12) var(--space-16);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  border: 1px solid transparent;
}

.alert--success {
  background-color: var(--color-success-soft);
  border-color: var(--color-success);
}

.alert--warning {
  background-color: var(--color-warning-soft);
  border-color: var(--color-warning);
}

.alert--danger {
  background-color: var(--color-danger-soft);
  border-color: var(--color-danger);
}

.alert--info {
  background-color: var(--color-accent-blue-soft);
  border-color: var(--color-accent-blue);
}
