* {
  box-sizing: border-box;
}

:root {
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, Menlo, monospace;
  --color-text: #edf2ff;
  --color-text-muted: #94a3b8;
  --color-text-soft: #cbd5e1;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --leading-tight: 1.2;
  --leading-snug: 1.35;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  background: #0b1020;
  color: var(--color-text);
}

a {
  color: #7dd3fc;
  text-decoration: none;
}

.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top left, rgba(59,130,246,.15), transparent 25%),
    radial-gradient(circle at bottom right, rgba(249,115,22,.12), transparent 30%),
    #0b1020;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 22px;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}

.brand-block {
  margin-bottom: 26px;
}

.brand-title {
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: var(--leading-tight);
}

.brand-subtitle {
  margin-top: 6px;
  color: #94a3b8;
  font-size: 14px;
}

.auth-card h1 {
  margin: 0 0 18px;
  font-size: var(--text-2xl);
  font-weight: 800;
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-form label {
  font-size: 14px;
  color: #cbd5e1;
}

.auth-form input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #25304d;
  background: #0f172a;
  color: #fff;
  outline: none;
  font-family: inherit;
  font-size: var(--text-base);
}

.auth-form input:focus {
  border-color: #3b82f6;
}

.form-error {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(220, 38, 38, .12);
  border: 1px solid rgba(248, 113, 113, .35);
  color: #fecaca;
  font-size: 14px;
}

.form-success {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(22, 163, 74, .12);
  border: 1px solid rgba(74, 222, 128, .35);
  color: #bbf7d0;
  font-size: 14px;
}

.form-hint {
  display: block;
  margin-top: -2px;
  margin-bottom: 6px;
  color: #94a3b8;
  font-size: 12px;
}

.auth-footer {
  margin-top: 18px;
  color: #94a3b8;
  font-size: 14px;
}

.btn {
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 700;
  font-family: inherit;
  font-size: var(--text-base);
  transition: .2s ease;
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.btn-primary {
  margin-top: 10px;
  background: linear-gradient(135deg, #2563eb, #f97316);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(37,99,235,.22);
}

.dashboard-body {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  background: #0b1020;
}

.sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 26px 20px;
  background: #0f172a;
  border-right: 1px solid rgba(148, 163, 184, .12);
}

.sidebar-logo {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 28px;
}

.sidebar-user {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(148,163,184,.12);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 24px;
}

.sidebar-user-label {
  color: #94a3b8;
  font-size: 13px;
}

.sidebar-user-name {
  margin-top: 6px;
  font-size: 18px;
  font-weight: 700;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-link {
  display: block;
  padding: 14px 16px;
  border-radius: 14px;
  color: #cbd5e1;
  background: transparent;
}

.nav-link.active,
.nav-link:hover {
  background: rgba(37, 99, 235, .12);
  color: #fff;
}

.btn-sidebar {
  width: 100%;
  background: #1e293b;
  color: white;
}

.main-content {
  padding: 30px;
}

.page-header h1 {
  margin: 0;
  font-size: 30px;
}

.page-header p {
  margin-top: 8px;
  color: #94a3b8;
}

.cars-grid {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}

.car-card {
  background: #111827;
  border: 1px solid rgba(148, 163, 184, .12);
  border-radius: 20px;
  padding: 20px;
}

.car-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.car-name {
  font-size: 22px;
  font-weight: 800;
}

.car-id {
  margin-top: 6px;
  color: #94a3b8;
  font-size: 13px;
}

.car-status {
  font-size: 12px;
  font-weight: 800;
  padding: 8px 12px;
  border-radius: 999px;
}

.car-status.online {
  background: rgba(34,197,94,.14);
  color: #86efac;
  border: 1px solid rgba(34,197,94,.25);
}

.car-status.offline {
  background: rgba(239,68,68,.14);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,.25);
}

.car-info {
  margin-top: 20px;
}

.car-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: #cbd5e1;
}

.battery-bar {
  height: 10px;
  background: #1e293b;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 14px;
}

.battery-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #84cc16);
  border-radius: 999px;
}

.car-actions {
  margin-top: 18px;
}
.logo img {
  max-width: 260px;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.5));
}

.auth-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.auth-card .logo-block {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.auth-card .logo-block img {
  width: 100%;
  max-width: 300px;
  height: auto;
}

.auth-title {
  text-align: center;
  margin: 0 0 18px;
}

/* === App shell (dashboard, profile, …) === */
.body-app {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  background: #050b1a;
  color: #fff;
}

.layout-app {
  display: flex;
  min-height: 100vh;
}

.sidebar-app {
  width: 260px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #0c1730 0%, #091327 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sidebar-app .logo-block {
  margin-bottom: 8px;
  margin-left: -24px;
  margin-top: -40px;
}

.sidebar-app .logo-block img {
  width: 100%;
  max-width: 360px;
  height: auto;
  display: block;
}

.sidebar-app .user-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 16px;
  margin: 16px 0 22px;
}

.sidebar-app .user-card small {
  display: block;
  color: #8ea0c9;
  margin-bottom: 6px;
  font-size: 12px;
}

.sidebar-app .user-card strong {
  font-size: 20px;
  display: block;
}

.user-balance {
  margin-top: 10px;
  font-size: 14px;
  color: #4ade80;
  font-weight: 600;
}

.menu-app {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.menu-app a {
  display: block;
  padding: 14px;
  border-radius: 14px;
  color: #dce7ff;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s;
}

.menu-app a:hover,
.menu-app a.active {
  background: linear-gradient(90deg, #11244f 0%, #0d1d41 100%);
  color: #fff;
}

.sidebar-app .logout-btn {
  margin-top: 24px;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}

.sidebar-app .logout-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.main-app {
  flex: 1;
  padding: 28px;
  overflow-y: auto;
  min-width: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}

.main-app h1,
.main-app .h1 {
  font-size: clamp(1.75rem, 2.5vw, 2.25rem);
  font-weight: 800;
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
}

.main-app h2,
.main-app .h2 {
  font-size: clamp(1.35rem, 2vw, 1.5rem);
  font-weight: 800;
  line-height: var(--leading-tight);
  letter-spacing: -0.015em;
  margin: 0 0 0.45em;
}

.main-app h3,
.main-app .h3 {
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: var(--leading-snug);
  margin: 0 0 0.4em;
}

.main-app p {
  margin: 0 0 1em;
  color: var(--color-text-soft);
}

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

@media (max-width: 900px) {
  .layout-app {
    flex-direction: column;
  }

  .sidebar-app {
    width: 100%;
  }

  .sidebar-app .logo-block {
    margin-left: 0;
    margin-top: 0;
  }
}

/* Global motion system (page load + reveal + subtle hover) */
body.fx-enter {
  opacity: 0;
  transform: translateY(8px);
}

body.fx-ready {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.42s ease, transform 0.42s ease;
}

.fx-reveal {
  opacity: 0;
  transform: translateY(16px) scale(0.985);
}

.fx-reveal.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 0.48s ease, transform 0.48s ease;
}

.fx-float {
  transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
  will-change: transform;
}

.fx-float:hover {
  transform: translateY(-3px);
  filter: brightness(1.02);
}

@media (prefers-reduced-motion: reduce) {
  body.fx-enter,
  body.fx-ready,
  .fx-reveal,
  .fx-reveal.in-view,
  .fx-float,
  .fx-float:hover {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
    filter: none !important;
  }
}
