/* =========================================================
   carXdrive Version 2.0
   Global Design System
   ========================================================= */

:root {
  /* Brand */
  --color-brand: #ff3347;
  --color-brand-hover: #ff5263;
  --color-brand-soft: rgba(255, 51, 71, 0.12);

  /* Background layers */
  --color-background: #060a10;
  --color-background-soft: #0a1018;
  --color-surface: #101923;
  --color-surface-raised: #141f2c;
  --color-surface-hover: #192636;

  /* Borders */
  --color-border: #263443;
  --color-border-soft: rgba(255, 255, 255, 0.08);
  --color-border-strong: #3a4a5d;

  /* Text */
  --color-text: #f8fafc;
  --color-text-secondary: #b6c0cc;
  --color-text-muted: #84909f;

  /* Feedback */
  --color-success: #38c793;
  --color-warning: #f5b942;
  --color-error: #ff5f67;

  /* Typography */
  --font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.35rem;
  --font-size-2xl: 1.75rem;
  --font-size-3xl: 2.4rem;
  --font-size-4xl: clamp(3rem, 7vw, 5.8rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Corners */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm:
    0 8px 24px rgba(0, 0, 0, 0.18);

  --shadow-md:
    0 18px 45px rgba(0, 0, 0, 0.28);

  --shadow-brand:
    0 12px 30px rgba(255, 51, 71, 0.2);

  /* Animation */
  --transition-fast: 150ms ease;
  --transition-base: 220ms ease;
  --transition-slow: 350ms ease;

  /* Layout */
  --page-width: 1180px;
  --header-height: 72px;
}

/* =========================================================
   Base reset
   ========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(
      circle at 50% -20%,
      rgba(255, 51, 71, 0.08),
      transparent 38%
    ),
    var(--color-background);

  color: var(--color-text);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

::selection {
  background: var(--color-brand);
  color: #ffffff;
}

/* =========================================================
   Shared page container
   ========================================================= */

.page-container {
  width: min(
    var(--page-width),
    calc(100% - 40px)
  );
  margin-inline: auto;
}

/* =========================================================
   Shared typography
   ========================================================= */

.page-eyebrow {
  margin: 0 0 var(--space-3);
  color: var(--color-brand);
  font-size: var(--font-size-xs);
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.page-title {
  margin: 0;
  max-width: 900px;
  font-size: var(--font-size-4xl);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.page-description {
  max-width: 720px;
  margin: var(--space-6) 0 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-lg);
  line-height: 1.75;
}

/* =========================================================
   Shared buttons
   ========================================================= */

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  padding: 0 var(--space-6);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  font-weight: 800;
  transition:
    transform var(--transition-base),
    background var(--transition-base),
    border-color var(--transition-base),
    color var(--transition-base),
    box-shadow var(--transition-base);
}

.button:hover {
  transform: translateY(-2px);
}

.button:active {
  transform: translateY(0);
}

.button-primary {
  background: var(--color-brand);
  color: #ffffff;
  box-shadow: var(--shadow-brand);
}

.button-primary:hover {
  background: var(--color-brand-hover);
}

.button-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}

.button-secondary:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-border-strong);
}

/* =========================================================
   Shared forms
   ========================================================= */

.form-label {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 750;
}

.form-control {
  width: 100%;
  min-height: 50px;
  padding: 0 var(--space-5);
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  outline: none;
  transition:
    background var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base);
}

.form-control::placeholder {
  color: var(--color-text-muted);
}

.form-control:hover {
  border-color: var(--color-border-strong);
}

.form-control:focus {
  background: var(--color-surface-raised);
  border-color: var(--color-brand);
  box-shadow:
    0 0 0 4px var(--color-brand-soft);
}

/* =========================================================
   Shared cards
   ========================================================= */

.surface-card {
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.025),
      transparent 45%
    ),
    var(--color-surface);

  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base);
}

.surface-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-border);
  box-shadow: var(--shadow-md);
}

/* =========================================================
   Accessibility
   ========================================================= */

:focus-visible {
  outline: 3px solid var(--color-brand);
  outline-offset: 3px;
}

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

@media (max-width: 650px) {
  .page-container {
    width: min(
      var(--page-width),
      calc(100% - 24px)
    );
  }

  .page-description {
    font-size: var(--font-size-base);
  }

  .button {
    min-height: 50px;
  }
}