@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --color-bg: #0D0F12;
  --color-surface: #16191D;
  --color-surface-raised: #1D2126;
  --color-accent: #FF6B35;
  --color-accent-secondary: #3D5A80;
  --color-accent-text: var(--color-accent);
  --color-text: #E8E6E1;
  --color-text-dim: #9AA0A6;
  --color-border: rgba(232, 230, 225, 0.10);
  --color-danger: #E5484D;
  --color-success: #4CAF6D;

  --font-heading: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;

  --radius-sm: 4px;
  --radius-md: 8px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 40px;
  --space-6: 64px;
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 var(--space-3) 0;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 var(--space-3) 0; color: var(--color-text-dim); }

a {
  color: var(--color-accent-text);
  text-decoration: none;
  transition: color 150ms ease;
}
a:hover { text-decoration: underline; }

hr, .hairline {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-4) 0;
}

/* ---------- Layout ---------- */

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.page-center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

/* ---------- Topbar ---------- */

.topbar {
  position: relative;
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-3) 0;
}

.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1300px;
}

.back-arrow {
  position: absolute;
  top: 100%;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  color: var(--color-text-dim);
  font-size: 0.9rem;
  transition: border-color 150ms ease, color 150ms ease;
}
.back-arrow:hover { border-color: var(--color-accent-secondary); color: var(--color-text); text-decoration: none; }

.brand {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-text);
  letter-spacing: 0.02em;
}

.brand span {
  color: var(--color-accent-text);
  animation: neon-flicker 4.5s infinite;
}

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

.topbar nav a {
  color: var(--color-text-dim);
  font-size: 0.9rem;
}
.topbar nav a:hover { color: var(--color-text); text-decoration: none; }


.lang-dropdown { position: relative; }
.lang-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-raised);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}
.lang-trigger:hover { border-color: var(--color-accent-secondary); }
.lang-panel {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 30px rgba(0,0,0,0.5);
  padding: 4px;
  z-index: 30;
}
.lang-panel.open { display: block; }
.lang-panel a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 0.85rem;
}
.lang-panel a:hover { background: var(--color-surface-raised); text-decoration: none; }
.lang-panel a.active {
  background: var(--color-accent-secondary);
  color: #FFFFFF;
}
.lang-panel a.active:hover { background: var(--color-accent-secondary); }

/* ---------- Hamburger nav menu (company panel) ---------- */
.hamburger-dropdown { position: relative; }
.hamburger-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-raised);
  color: var(--color-accent);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  position: relative;
}
.hamburger-trigger:hover { border-color: var(--color-accent-secondary); }
.hamburger-panel {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 30px rgba(0,0,0,0.5);
  padding: 4px;
  z-index: 30;
}
.hamburger-panel.open { display: block; }
.hamburger-panel a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 0.85rem;
  position: relative;
}
.hamburger-panel a:hover { background: var(--color-surface-raised); text-decoration: none; }

/* ---------- Card / Surface ---------- */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.card + .card { margin-top: var(--space-3); }

/* ---------- Forms ---------- */

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

label {
  display: block;
  font-size: 0.85rem;
  color: var(--color-text-dim);
  margin-bottom: var(--space-1);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 10px 12px;
  transition: border-color 150ms ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

input.input-error, select.input-error, textarea.input-error {
  border-color: var(--color-danger);
}
.field-error {
  font-size: 0.8rem;
  color: #F3A6A8;
  margin-top: var(--space-1);
}

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

.form-hint {
  font-size: 0.8rem;
  color: var(--color-text-dim);
  margin-top: var(--space-1);
}

.password-field { position: relative; }
.password-field input { padding-right: 38px; width: 100%; }
.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--color-text-dim);
  padding: 4px 6px;
  line-height: 1;
}
.password-toggle:hover { color: var(--color-text); }

/* ---------- Modal ---------- */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--space-4);
  position: relative;
}
.modal-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: none;
  border: none;
  color: var(--color-text-dim);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}
.modal-close:hover { color: var(--color-text); }

.clickable-name {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.clickable-name:hover { color: var(--color-accent-text); }
.clickable-name .edit-hint { font-size: 0.7rem; color: var(--color-text-dim); opacity: 0; transition: opacity 0.15s; }
.clickable-name:hover .edit-hint { opacity: 1; }

.company-logo-preview {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
  transition: background-color 180ms ease, border-color 180ms ease, transform 120ms ease, opacity 150ms ease;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; animation: none; }

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  animation: neon-pulse 7s ease-in-out infinite;
}
.btn-primary:hover { background: #ff7f4f; text-decoration: none; }

.btn-secondary {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text);
}
.btn-secondary:hover { border-color: var(--color-accent-secondary); text-decoration: none; }

.btn-block { display: block; width: 100%; }

/* ---------- Alerts ---------- */

.alert {
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  font-size: 0.88rem;
  margin-bottom: var(--space-3);
}
.alert-error {
  background: rgba(229, 72, 77, 0.12);
  border: 1px solid rgba(229, 72, 77, 0.35);
  color: #F3A6A8;
}
.alert-success {
  background: rgba(76, 175, 109, 0.12);
  border: 1px solid rgba(76, 175, 109, 0.35);
  color: #A6E0BA;
}
/* ---------- Section label ---------- */

.section-label {
  color: var(--color-accent-text);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}

/* ---------- Stat cards ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-3);
}
.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}
.stat-card-clickable { cursor: pointer; transition: border-color 150ms ease, transform 150ms ease; }
.stat-card-clickable:hover { border-color: var(--color-accent-secondary); transform: translateY(-2px); }
.stat-card .stat-value {
  font-family: var(--font-heading);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1;
}
.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--color-text-dim);
  margin-top: var(--space-2);
}

/* ---------- Service record (details/summary) ---------- */

.service-record { padding: 0; }
details.service-record > summary,
.record-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
}
details.service-record > summary::-webkit-details-marker { display: none; }
.expand-hint {
  margin-left: auto;
  color: var(--color-text-dim);
  transition: transform 150ms ease;
}
details[open] > summary .expand-hint {
  transform: rotate(180deg);
}
.record-body {
  padding: 0 var(--space-4) var(--space-4);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-3);
  margin-top: var(--space-1);
}
.summary-analysis {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.summary-analysis li {
  font-size: 0.88rem;
  padding-left: 18px;
  position: relative;
}
.summary-analysis li::before {
  content: attr(data-icon);
  position: absolute;
  left: 0;
  font-size: 0.85em;
}
.summary-analysis li[data-icon="✓"]::before { color: var(--color-success); }
.summary-analysis li[data-icon="🔍"]::before { color: var(--color-accent-text); }
.summary-analysis li[data-icon="💶"]::before { color: var(--color-success); }
.summary-analysis li.has-icon-img { padding-left: 22px; }
.summary-icon-img {
  position: absolute;
  left: 0;
  top: 1px;
  width: 15px;
  height: 15px;
  object-fit: contain;
}
.record-notes {
  color: #F3A6A8;
}
.record-item-list {
  list-style: none;
  padding: 0;
  margin: var(--space-2) 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 4px 12px;
}
.record-item-list li {
  font-size: 0.85rem;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.item-icon-checked { color: var(--color-accent-text); }
.item-icon-changed { color: var(--color-success); font-weight: 700; }
.record-photos { display: flex; gap: 8px; margin-top: var(--space-3); flex-wrap: wrap; }
.record-photos img { width: 90px; height: 90px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--color-border); }

/* ---------- Badges ---------- */

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  color: var(--color-text-dim);
}

.notif-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: 2px;
  animation: neon-pulse 7s ease-in-out infinite;
}

/* ---------- Table ---------- */

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
}

th {
  color: var(--color-text-dim);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- Utility ---------- */

.text-dim { color: var(--color-text-dim); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* ---------- Neon (modified-vehicle lighting look) ---------- */

@keyframes neon-pulse {
  /* Orange */
  0%, 28% {
    box-shadow:
      0 0 6px rgba(255, 107, 53, 0.55),
      0 0 16px rgba(255, 107, 53, 0.30);
  }
  14% {
    box-shadow:
      0 0 16px rgba(255, 107, 53, 0.95),
      0 0 42px rgba(255, 107, 53, 0.55),
      0 0 70px rgba(61, 90, 128, 0.35);
  }
  /* Steel blue */
  33%, 61% {
    box-shadow:
      0 0 6px rgba(61, 90, 128, 0.55),
      0 0 16px rgba(61, 90, 128, 0.30);
  }
  47% {
    box-shadow:
      0 0 16px rgba(61, 90, 128, 0.95),
      0 0 42px rgba(61, 90, 128, 0.55),
      0 0 70px rgba(76, 175, 109, 0.35);
  }
  /* Green */
  66%, 94% {
    box-shadow:
      0 0 6px rgba(76, 175, 109, 0.55),
      0 0 16px rgba(76, 175, 109, 0.30);
  }
  80% {
    box-shadow:
      0 0 16px rgba(76, 175, 109, 0.95),
      0 0 42px rgba(76, 175, 109, 0.55),
      0 0 70px rgba(255, 107, 53, 0.35);
  }
  /* Back to orange */
  100% {
    box-shadow:
      0 0 6px rgba(255, 107, 53, 0.55),
      0 0 16px rgba(255, 107, 53, 0.30);
  }
}

@keyframes neon-flicker {
  /* Steady base color (orange) */
  0%, 30% {
    opacity: 1;
    color: var(--color-accent);
    text-shadow:
      0 0 4px var(--color-accent),
      0 0 14px var(--color-accent),
      0 0 28px rgba(255, 107, 53, 0.6);
  }
  /* Brief flicker */
  32% { opacity: 0.45; text-shadow: none; }
  34% {
    opacity: 1;
    text-shadow:
      0 0 4px var(--color-accent),
      0 0 14px var(--color-accent),
      0 0 28px rgba(255, 107, 53, 0.6);
  }
  36% { opacity: 0.5; text-shadow: none; }
  38%, 45% {
    opacity: 1;
    color: var(--color-accent);
    text-shadow:
      0 0 4px var(--color-accent),
      0 0 14px var(--color-accent),
      0 0 28px rgba(255, 107, 53, 0.6);
  }
  /* Transition to steel blue */
  60% {
    color: var(--color-accent-secondary);
    text-shadow:
      0 0 4px var(--color-accent-secondary),
      0 0 14px var(--color-accent-secondary),
      0 0 28px rgba(61, 90, 128, 0.6);
  }
  /* Transition to green */
  80% {
    color: var(--color-success);
    text-shadow:
      0 0 4px var(--color-success),
      0 0 14px var(--color-success),
      0 0 28px rgba(76, 175, 109, 0.6);
  }
  /* Back to orange */
  100% {
    color: var(--color-accent);
    text-shadow:
      0 0 4px var(--color-accent),
      0 0 14px var(--color-accent),
      0 0 28px rgba(255, 107, 53, 0.6);
  }
}

@keyframes neon-underglow {
  0%, 100% {
    opacity: 0.35;
    transform: translate(-50%, -50%) scale(0.92);
  }
  50% {
    opacity: 0.75;
    transform: translate(-50%, -50%) scale(1.08);
  }
}

.hero-image {
  position: relative;
  z-index: 0;
}
.hero-image::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 62%;
  width: 85%;
  height: 55%;
  background: radial-gradient(
    ellipse at center,
    var(--color-accent) 0%,
    var(--color-accent-secondary) 45%,
    transparent 72%
  );
  filter: blur(36px);
  z-index: -1;
  animation: neon-underglow 3.2s ease-in-out infinite;
}
.hero-image img { position: relative; z-index: 1; }

@media (prefers-reduced-motion: reduce) {
  .btn-primary,
  .brand span,
  .hero-image::before {
    animation: none !important;
  }
}
