/* ========================================================================== 
   Variables
   ========================================================================== */

:root {
  /* Colors */
  --color-background: #050811; /* deep cool background */
  --color-surface: #0f172a; /* elevated surfaces */
  --color-surface-alt: #111827;
  --color-text: #e5e7eb; /* soft white */
  --color-text-muted: #9ca3af;
  --color-primary: #2563eb; /* cool, trustworthy blue */
  --color-primary-soft: rgba(37, 99, 235, 0.1);
  --color-success: #10b981; /* diagnostics ok, completed */
  --color-warning: #f59e0b; /* service due soon */
  --color-danger: #ef4444; /* critical issues */

  /* Neutral grays / metallics */
  --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;

  /* Semantic backgrounds for sections */
  --color-section-dark: #020617;
  --color-section-muted: #0b1120;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 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 */

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

  /* Shadows (subtle, professional, no heavy blur) */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.35);
  --shadow-sm: 0 4px 10px rgba(15, 23, 42, 0.45);
  --shadow-md: 0 12px 30px rgba(15, 23, 42, 0.6);

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

  /* Layout */
  --container-max-width: 1120px; /* comfortable, structured */
  --page-gutter-x: 1.5rem;
}

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

/* ========================================================================== 
   Reset / Normalize
   ========================================================================== */

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

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

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

body {
  min-height: 100vh;
}

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

img {
  height: auto;
}

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

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

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

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

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

textarea {
  resize: vertical;
}

[hidden] {
  display: none !important;
}

/* ========================================================================== 
   Base Styles
   ========================================================================== */

body {
  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;
}

/* Headings: structured, professional scale */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  color: var(--gray-50);
  line-height: var(--line-height-tight);
}

h1 {
  font-size: clamp(2rem, 2.6vw, var(--font-size-5xl));
  letter-spacing: -0.03em;
  margin-bottom: var(--space-4);
}

h2 {
  font-size: clamp(1.75rem, 2.1vw, var(--font-size-4xl));
  letter-spacing: -0.02em;
  margin-bottom: var(--space-3);
}

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

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

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

h6 {
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}

p {
  margin-bottom: var(--space-3);
  /* comfortable line length */
}

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

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

strong {
  font-weight: 600;
}

/* Links: minimal, underline on hover for clarity */

a {
  color: var(--color-primary);
  text-decoration: none;
  text-underline-offset: 0.2em;
  transition: color var(--transition-base);
}

a:hover {
  text-decoration: underline;
}

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

/* Horizontal rules */

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

/* ========================================================================== 
   Accessibility & Focus
   ========================================================================== */

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

/* Remove focus for mouse users while keeping for keyboard */
:focus:not(:focus-visible) {
  outline: none;
}

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

/* ========================================================================== 
   Utilities
   ========================================================================== */

/* Layout: container */

.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--page-gutter-x);
  padding-right: var(--page-gutter-x);
}

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

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

/* 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-2);
}

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

/* Text utilities */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--color-text-muted); }

/* Spacing utilities (y-axis commonly used) */

.mt-0 { margin-top: 0 !important; }
.mt-4 { margin-top: var(--space-4) !important; }
.mt-6 { margin-top: var(--space-6) !important; }
.mt-8 { margin-top: var(--space-8) !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-4 { margin-bottom: var(--space-4) !important; }
.mb-6 { margin-bottom: var(--space-6) !important; }
.mb-8 { margin-bottom: var(--space-8) !important; }

.py-4 {
  padding-top: var(--space-4) !important;
  padding-bottom: var(--space-4) !important;
}

.py-6 {
  padding-top: var(--space-6) !important;
  padding-bottom: var(--space-6) !important;
}

.px-4 {
  padding-left: var(--space-4) !important;
  padding-right: var(--space-4) !important;
}

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

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

/* Buttons: primary CTAs for booking, quotes, contact */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  color: #f9fafb;
  font-weight: 500;
  font-size: var(--font-size-sm);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition:
    background var(--transition-base),
    box-shadow var(--transition-base),
    transform var(--transition-fast),
    border-color var(--transition-base);
}

.button:hover {
  background: linear-gradient(135deg, #1e40af, #2563eb);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
  box-shadow: var(--shadow-xs);
}

.button:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 3px;
}

.button--ghost {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(148, 163, 184, 0.5);
  box-shadow: none;
}

.button--ghost:hover {
  background: rgba(15, 23, 42, 0.95);
  border-color: #93c5fd;
}

.button--secondary {
  background: var(--color-surface);
  border-color: rgba(148, 163, 184, 0.4);
  color: var(--color-text);
  box-shadow: var(--shadow-xs);
}

.button--secondary:hover {
  background: var(--color-surface-alt);
  border-color: #60a5fa;
}

.button--danger {
  background: #b91c1c;
}

.button--danger:hover {
  background: #dc2626;
}

.button--icon-only {
  padding: 0.4rem;
  border-radius: var(--radius-full);
}

.button[disabled],
.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

/* Inputs: forms for booking, quotes, contact */

.input,
.select,
.textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.5);
  background-color: rgba(15, 23, 42, 0.8);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    background-color var(--transition-base);
}

.input::placeholder,
.textarea::placeholder {
  color: rgba(148, 163, 184, 0.9);
}

.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 1px #60a5fa;
  background-color: rgba(15, 23, 42, 0.95);
}

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

.select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #9ca3af 50%),
    linear-gradient(135deg, #9ca3af 50%, transparent 50%);
  background-position:
    calc(100% - 14px) 50%,
    calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.textarea {
  min-height: 120px;
}

.label {
  display: inline-block;
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}

.field-error {
  margin-top: var(--space-1);
  font-size: var(--font-size-xs);
  color: var(--color-danger);
}

/* Cards: for services, pricing, workshop highlights */

.card {
  position: relative;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.16), transparent 55%),
              radial-gradient(circle at bottom right, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 1));
  padding: var(--space-5);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
}

.card--muted {
  background: var(--color-surface);
  border-color: rgba(148, 163, 184, 0.25);
  box-shadow: var(--shadow-xs);
}

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

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

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

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

.card__footer {
  margin-top: var(--space-4);
}

/* Tag / pill: for service types (e.g. Diagnostics, Brakes) */

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: var(--color-text-muted);
  background-color: rgba(15, 23, 42, 0.8);
}

.pill--primary {
  border-color: rgba(37, 99, 235, 0.7);
  color: #bfdbfe;
  background-color: rgba(37, 99, 235, 0.12);
}

/* Badges for status (e.g. Available, Fully booked) */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 500;
}

.badge--success {
  background: rgba(16, 185, 129, 0.14);
  color: #6ee7b7;
}

.badge--warning {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
}

.badge--danger {
  background: rgba(239, 68, 68, 0.15);
  color: #fecaca;
}

/* Tables: for transparent pricing */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

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

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

.table th {
  font-weight: 500;
  color: var(--color-text-muted);
  border-bottom: 1px solid rgba(148, 163, 184, 0.5);
}

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

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

.table tbody tr:hover {
  background-color: rgba(37, 99, 235, 0.12);
}

.table tbody td {
  border-bottom: 1px solid rgba(30, 64, 175, 0.35);
}

/* Helper surface classes for sections */

.surface {
  background-color: var(--color-surface);
}

.surface-alt {
  background-color: var(--color-section-muted);
}

/* Subtle top border for structured sections */

.section--divider {
  border-top: 1px solid rgba(148, 163, 184, 0.25);
}
