/* Motora Platform - Paleta elegante: Teal & Âmbar */
:root {
  /* Cores principais */
  --primary: #0d7377;
  --primary-dark: #0a5c5f;
  --primary-light: #14a3a8;
  --primary-soft: rgba(13, 115, 119, 0.08);
  --accent: #c9a227;
  --accent-dark: #a8841a;
  --accent-soft: rgba(201, 162, 39, 0.12);

  /* Superfícies */
  --bg: #f7f6f4;
  --bg-warm: #faf9f7;
  --card: #ffffff;
  --card-hover: #fefefe;

  /* Texto */
  --text: #1c1c1c;
  --text-soft: #4a4a4a;
  --text-muted: #6b6b6b;

  /* Bordas e elevação */
  --border: #e5e4e1;
  --border-light: #efeeec;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 18px;
  --shadow: 0 2px 8px rgba(28, 28, 28, 0.06), 0 1px 2px rgba(28, 28, 28, 0.04);
  --shadow-md: 0 8px 24px rgba(28, 28, 28, 0.08), 0 2px 6px rgba(28, 28, 28, 0.04);
  --shadow-lg: 0 16px 40px rgba(28, 28, 28, 0.1), 0 4px 12px rgba(28, 28, 28, 0.06);
  --shadow-primary: 0 4px 14px rgba(13, 115, 119, 0.25);
  --shadow-accent: 0 4px 14px rgba(201, 162, 39, 0.3);

  /* Tipografia */
  --font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --letter-tight: -0.02em;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* ========== Header ========== */
.header {
  background: var(--card);
  border-bottom: 1px solid var(--border-light);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: var(--shadow);
  position: relative;
}
@media (max-width: 768px) {
  .header { padding: 0.75rem 1rem; }
  .header .logo { font-size: 1.25rem; }
}
.header .logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: var(--letter-tight);
  text-decoration: none !important;
}
.header .logo:hover {
  color: var(--primary-dark);
  text-decoration: none !important;
}

/* Botão menu sanduíche (visível só no mobile) */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  cursor: pointer;
  transition: background 0.2s;
}
.menu-toggle:hover {
  background: var(--bg);
}
.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.25s, opacity 0.25s;
}
.header.menu-open .menu-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.header.menu-open .menu-toggle span:nth-child(2) {
  opacity: 0;
}
.header.menu-open .menu-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.header .header-nav,
.header nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.header nav a,
.header .header-nav a {
  text-decoration: none;
  color: var(--text-soft);
  font-weight: 500;
  font-size: 0.95rem;
}
.header nav a:hover,
.header .header-nav a:hover {
  color: var(--primary);
  text-decoration: none;
}
.header .header-nav .nav-user {
  padding: 0 0.25rem;
}

/* Mobile: menu sanduíche */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
    z-index: 102;
  }
  .header .header-nav,
  .header nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(280px, 85vw);
    background: var(--card);
    box-shadow: -4px 0 20px rgba(0,0,0,0.1);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 4rem 1.5rem 1.5rem;
    z-index: 101;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
  }
  .header .header-nav a,
  .header nav a {
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 1rem;
  }
  .header .header-nav .nav-user {
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.95rem;
  }
  .header.menu-open .header-nav,
  .header.menu-open nav {
    transform: translateX(0);
  }
  .header.menu-open .header-nav .btn,
  .header.menu-open nav .btn {
    margin-top: 0.5rem;
    text-align: center;
  }
  .header.menu-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 100;
  }
}

/* ========== Botões ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
  min-height: 44px;
}
@media (max-width: 768px) {
  .btn {
    min-height: 48px;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
  }
}
.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover {
  background: var(--primary-dark);
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(13, 115, 119, 0.35);
}
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-color: var(--primary-dark);
  text-decoration: none;
  transform: translateY(-1px);
}
.btn-accent {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #1c1c1c;
  box-shadow: var(--shadow-accent);
}
.btn-accent:hover {
  background: linear-gradient(135deg, var(--accent-dark) 0%, #8b6914 100%);
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(201, 162, 39, 0.4);
}

/* ========== Container ========== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
}

/* ========== Hero ========== */
.hero {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: linear-gradient(145deg, var(--primary) 0%, var(--primary-dark) 50%);
  color: white;
  border-radius: var(--radius-lg);
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(255,255,255,0.12), transparent);
  pointer-events: none;
}
.hero h1 {
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
  letter-spacing: var(--letter-tight);
  position: relative;
}
.hero p {
  opacity: 0.95;
  font-size: 1.1rem;
  max-width: 36ch;
  margin: 0 auto;
  position: relative;
}
@media (max-width: 768px) {
  .hero {
    padding: 2rem 1rem;
    margin-bottom: 1.5rem;
  }
  .hero h1 { font-size: 1.6rem; }
  .hero p { font-size: 1rem; }
}
.hero-actions {
  margin-top: 1.75rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  position: relative;
}
.hero-actions .btn:hover { text-decoration: none; }
.hero-actions .btn-outline {
  border-color: rgba(255,255,255,0.8);
  color: white;
}
.hero-actions .btn-outline:hover {
  background: rgba(255,255,255,0.2);
  border-color: white;
  color: white;
}

/* ========== Grid de veículos ========== */
.veiculos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
@media (max-width: 480px) {
  .veiculos-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .veiculo-card .footer {
    flex-direction: column;
    align-items: stretch;
  }
  .veiculo-card .footer .btn { width: 100%; }
}
.veiculo-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-light);
}
.veiculo-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border);
}
.veiculo-card .foto {
  aspect-ratio: 16/10;
  background: linear-gradient(145deg, var(--border-light) 0%, var(--border) 100%);
  object-fit: cover;
  width: 100%;
}
.veiculo-card .body {
  padding: 1.35rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.veiculo-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
  color: var(--text);
  letter-spacing: var(--letter-tight);
}
.veiculo-card .meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}
.veiculo-card .cidade {
  font-size: 0.9rem;
  color: var(--primary);
  margin-bottom: 1rem;
  font-weight: 500;
}
.veiculo-card .footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}
.veiculo-card .preco {
  font-weight: 700;
  color: var(--primary);
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

/* ========== Página do veículo ========== */
.veiculo-detalhe {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 900px) {
  .veiculo-detalhe { grid-template-columns: 1fr; }
}
.veiculo-galeria {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--border-light);
  box-shadow: var(--shadow);
}
.veiculo-galeria img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
}
.veiculo-info h1 {
  font-size: 1.85rem;
  margin-bottom: 0.5rem;
  letter-spacing: var(--letter-tight);
  color: var(--text);
}
.veiculo-info .dados {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin: 1rem 0;
}
@media (max-width: 480px) {
  .veiculo-info .dados { grid-template-columns: 1fr; }
  .veiculo-info h1 { font-size: 1.4rem; }
}
.veiculo-info .dados span {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.veiculo-info .dados strong {
  display: block;
  color: var(--text);
}
.proprietario-card {
  background: var(--card);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 1.5rem;
  border: 1px solid var(--border-light);
}
.proprietario-card h4 {
  margin-bottom: 0.5rem;
  color: var(--text);
}
.proprietario-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ========== Formulários ========== */
.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--text);
  font-size: 0.95rem;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: var(--card);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
/* Campos em largura total e confortáveis no mobile */
.form-group input,
.form-group select,
.form-group textarea {
  min-height: 44px;
  -webkit-appearance: none;
  appearance: none;
}
@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .form-group input,
  .form-group select {
    font-size: 16px; /* evita zoom no iOS */
    min-height: 48px;
    padding: 0.75rem 1rem;
    width: 100%;
  }
  .form-group textarea {
    font-size: 16px;
    min-height: 100px;
    padding: 0.75rem 1rem;
    width: 100%;
  }
  /* Formulários com grid customizado: uma coluna no mobile */
  .card form[style*="grid"] {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }
}
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ========== Cards de painel ========== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-light);
}
@media (max-width: 768px) {
  .card {
    padding: 1.25rem;
    margin-bottom: 1.25rem;
  }
}
.card h2, .card h3 {
  margin-bottom: 1rem;
  font-size: 1.15rem;
  color: var(--text);
  letter-spacing: var(--letter-tight);
}
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  margin-bottom: 1rem;
}
table {
  width: 100%;
  min-width: 500px;
  border-collapse: collapse;
}
th, td {
  padding: 0.8rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}
@media (max-width: 768px) {
  th, td {
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
  }
  th { font-size: 0.75rem; }
}
th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-warm);
}
tr:last-child td { border-bottom: none; }
tr:hover td {
  background: var(--bg-warm);
}

/* ========== Resumos (semana/mês) ========== */
.resumo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
@media (max-width: 600px) {
  .resumo-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
  .resumo-item .value { font-size: 1.25rem; }
}
@media (max-width: 380px) {
  .resumo-grid { grid-template-columns: 1fr; }
}
.resumo-item {
  background: linear-gradient(145deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 1.35rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-primary);
  transition: transform 0.2s ease;
}
.resumo-item:hover {
  transform: translateY(-2px);
}
.resumo-item .label {
  font-size: 0.85rem;
  opacity: 0.92;
}
.resumo-item .value {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.resumo-item.danger {
  background: linear-gradient(145deg, #c24141 0%, #a33535 100%);
  box-shadow: 0 4px 14px rgba(194, 65, 65, 0.3);
}
.resumo-item.success {
  background: linear-gradient(145deg, #0d7377 0%, #0a5c5f 100%);
  box-shadow: var(--shadow-primary);
}

/* ========== Painel sidebar ========== */
.painel-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: calc(100vh - 60px);
  background: var(--bg);
}
@media (max-width: 768px) {
  .painel-layout { grid-template-columns: 1fr; }
}
.painel-sidebar {
  background: var(--card);
  border-right: 1px solid var(--border-light);
  padding: 1.5rem 0;
  box-shadow: var(--shadow);
}
.painel-sidebar a {
  display: block;
  padding: 0.8rem 1.5rem;
  color: var(--text-soft);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}
.painel-sidebar a:hover,
.painel-sidebar a.ativo {
  background: var(--primary-soft);
  color: var(--primary);
  border-left-color: var(--primary);
  text-decoration: none;
}
.painel-content {
  padding: 2rem;
  overflow-x: auto;
  background: var(--bg);
}
@media (max-width: 768px) {
  .painel-content {
    padding: 1rem;
  }
}
.dashboard-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}

/* ========== Alerts ========== */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  border: 1px solid transparent;
}
.alert-success {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}
.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}
.alert-info {
  background: #eff6ff;
  color: #1e40af;
  border-color: #bfdbfe;
}

/* ========== Página de login/cadastro ========== */
.auth-page {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--bg-warm);
}
@media (max-width: 768px) {
  .auth-page { padding: 1rem; }
}
.auth-box {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  padding: 2.25rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
}
@media (max-width: 768px) {
  .auth-box {
    padding: 1.5rem;
    max-width: 100%;
  }
}
.auth-box h1 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  color: var(--text);
  letter-spacing: var(--letter-tight);
}
.auth-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.auth-tabs a {
  flex: 1;
  text-align: center;
  padding: 0.7rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s ease;
}
.auth-tabs a.ativo {
  background: var(--primary);
  color: white;
  text-decoration: none;
  box-shadow: var(--shadow-primary);
}
.auth-tabs a:not(.ativo):hover {
  background: var(--primary-soft);
  color: var(--primary);
  text-decoration: none;
}

/* ========== Fotos na edição de veículo ========== */
.fotos-atuais-grid {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.foto-item {
  background: var(--bg-warm);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.foto-item img {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
.foto-deletar-form { margin: 0; }
.btn-deletar-foto {
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
  color: #991b1b;
  border-color: #fecaca;
}
.btn-deletar-foto:hover {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #f87171;
}

/* ========== Utilitários ========== */
.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
