/* ManualElite — Auto Elite */
:root {
  --navy-950: #011723;
  --navy-900: #02202f;
  --navy: #03263a;
  --navy-700: #0a3a54;
  --navy-600: #124a68;
  --brand: #4e9580;          /* verde do logo */
  --brand-strong: #3f937b;
  --accent: #3cc6a4;         /* verde-água de destaque (botões) */
  --accent-soft: #e3f4ef;
  --bg: #f3f6f8;
  --surface: #ffffff;
  --line: #e2e8ec;
  --text: #0e2433;
  --muted: #5d7180;
  --warn-bg: #fff6dc;
  --warn: #8a6200;
  --danger: #d64545;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 6px 20px rgba(3, 38, 58, .08);
  --nav-h: 68px;
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--navy-950);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
svg { flex-shrink: 0; }

/* ---------- Casca do app (centraliza em telas grandes) ---------- */
#app {
  max-width: 520px;
  min-height: 100%;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 60px rgba(0,0,0,.35);
}
.view { flex: 1; padding-bottom: calc(var(--nav-h) + 24px); animation: fade .22s ease; }
.view.no-nav { padding-bottom: 0; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Cabeçalhos ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px;
  background: var(--navy);
  color: #fff;
}
.topbar h1 { font-size: 17px; font-weight: 600; flex: 1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .icon-btn { color: #fff; }
.topbar .spacer { width: 40px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  transition: background .15s;
}
.icon-btn:hover { background: rgba(255,255,255,.08); }
.icon-btn svg { width: 22px; height: 22px; }

.brand-head {
  background: radial-gradient(120% 90% at 100% 0%, var(--navy-600) 0%, var(--navy) 55%, var(--navy-900) 100%);
  color: #fff;
  padding: 18px 16px 72px;
}
.brand-row { display: flex; align-items: center; gap: 12px; }
.brand-row .app-mark { width: 40px; height: 40px; }
.brand-name { font-size: 18px; font-weight: 700; line-height: 1.1; letter-spacing: -.2px; }
.brand-name span { color: var(--accent); }
.brand-sub { font-size: 10px; letter-spacing: 2.4px; text-transform: uppercase; opacity: .7; }
.brand-row .icon-btn { margin-left: auto; }
.greet { margin-top: 22px; font-size: 14px; opacity: .8; }
.greet strong { display: block; font-size: 22px; opacity: 1; font-weight: 600; margin-top: 2px; }

/* ---------- Busca ---------- */
.search {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border-radius: 999px;
  padding: 0 16px;
  height: 50px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.search svg { width: 20px; height: 20px; color: var(--muted); }
.search input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 15px; min-width: 0; }
.search input::placeholder { color: #9aabb6; }
.search .clear { color: var(--muted); width: 28px; height: 28px; display: none; place-items: center; border-radius: 50%; }
.search.has-value .clear { display: grid; }
.search-float { margin: -26px 16px 0; position: relative; z-index: 2; }
.search-wrap { padding: 14px 16px 6px; background: var(--navy); }
.search-wrap .search { box-shadow: none; border: 0; }

/* ---------- Seções ---------- */
.section { padding: 20px 16px 0; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.section-title h2 { font-size: 16px; font-weight: 600; }
.section-title a { font-size: 13px; color: var(--brand-strong); font-weight: 500; }

/* ---------- Grade de atalhos (tela inicial) ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 18px 16px;
  min-height: 112px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
  transition: transform .15s, background .15s;
}
.tile::after {
  content: ""; position: absolute; right: -24px; bottom: -24px; width: 90px; height: 90px;
  border-radius: 50%; background: rgba(60,198,164,.12);
}
.tile:active { transform: scale(.97); }
.tile:hover { background: var(--navy-700); }
.tile svg { width: 28px; height: 28px; color: var(--accent); }
.tile strong { font-size: 15px; font-weight: 600; }
.tile small { display: block; font-size: 12px; opacity: .65; margin-top: 2px; }

/* ---------- Chips (filtro por marca/tipo) ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px; scrollbar-width: none; background: var(--surface); border-bottom: 1px solid var(--line); }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; padding: 7px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 500;
  background: var(--bg); color: var(--muted); border: 1px solid var(--line);
}
.chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---------- Lista de veículos ---------- */
.list { background: var(--surface); }
.list-group-title { padding: 14px 16px 6px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; background: var(--bg); }
.v-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  transition: background .12s;
}
.v-item:hover { background: #f8fbfc; }
.v-item .brand-badge {
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--accent-soft); color: var(--brand-strong);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; letter-spacing: .5px;
}
.v-item .info { flex: 1; min-width: 0; }
.v-item .info strong { display: block; font-size: 15px; font-weight: 600; }
.v-item .info span { font-size: 13px; color: var(--muted); }
.v-item .fav-mini { color: #f2b400; width: 18px; height: 18px; }
.v-item .chev { color: #b4c2cb; width: 20px; height: 20px; }
.cards .v-item { border-radius: var(--radius); border: 1px solid var(--line); margin-bottom: 10px; }

.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty svg { width: 56px; height: 56px; color: #c2d0d8; margin: 0 auto 12px; }
.empty strong { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }
.empty .btn { margin-top: 18px; }
.result-count { padding: 10px 16px; font-size: 13px; color: var(--muted); }

/* ---------- Detalhe do veículo ---------- */
.v-hero {
  background: radial-gradient(130% 100% at 50% 0%, var(--navy-600) 0%, var(--navy) 60%);
  color: #fff; text-align: center;
  padding: 8px 16px 26px;
}
.v-hero .car { width: 220px; height: 110px; margin: 0 auto 6px; }
.v-hero h2 { font-size: 22px; font-weight: 600; }
.v-hero p { font-size: 14px; opacity: .75; }
.v-hero .tags { display: flex; justify-content: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.tag { font-size: 11px; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.1); }
.tag.green { background: rgba(60,198,164,.18); color: #8fe8d1; }

.menu-list { margin: -14px 16px 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; position: relative; }
.menu-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.menu-item:last-child { border-bottom: 0; }
.menu-item:hover { background: #f8fbfc; }
.menu-item .ic {
  width: 40px; height: 40px; border-radius: 12px; background: var(--brand-strong); color: #fff;
  display: grid; place-items: center;
}
.menu-item .ic svg { width: 20px; height: 20px; }
.menu-item .txt { flex: 1; }
.menu-item .txt strong { display: block; font-size: 14px; font-weight: 600; }
.menu-item .txt span { font-size: 12px; color: var(--muted); }
.menu-item .chev { width: 18px; height: 18px; color: #b4c2cb; }

/* ---------- Cartões de conteúdo ---------- */
.card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); padding: 16px; margin-bottom: 14px; }
.card h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.card h3 svg { width: 18px; height: 18px; color: var(--brand-strong); }
.card p { font-size: 14px; line-height: 1.55; color: #33495a; }
.card p + p { margin-top: 8px; }
.alert { display: flex; gap: 12px; background: var(--warn-bg); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 14px; }
.alert svg { width: 22px; height: 22px; color: #e0a100; }
.alert strong { display: block; font-size: 14px; color: #5a4300; }
.alert span { font-size: 13px; color: var(--warn); }
.alert.info { background: var(--accent-soft); }
.alert.info svg { color: var(--brand-strong); }
.alert.info strong { color: var(--navy); }
.alert.info span { color: #2f5d50; }

.sub-tabs { display: flex; gap: 6px; padding: 10px 16px; overflow-x: auto; background: var(--navy); scrollbar-width: none; position: sticky; top: 68px; z-index: 15; }
.sub-tabs::-webkit-scrollbar { display: none; }
.sub-tabs a { flex-shrink: 0; font-size: 13px; padding: 7px 12px; border-radius: 999px; color: rgba(255,255,255,.7); }
.sub-tabs a.active { background: var(--accent); color: var(--navy); font-weight: 600; }

/* Tabela de fios */
.wire-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.wire-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 600; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.wire-table td { padding: 12px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.wire-table tr:last-child td { border-bottom: 0; }
.wire { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.wire i { width: 22px; height: 8px; border-radius: 4px; display: inline-block; border: 1px solid rgba(0,0,0,.15); }

/* Diagrama */
.diagram { width: 100%; height: auto; background: #f8fbfc; border-radius: var(--radius-sm); border: 1px solid var(--line); }

/* Fotos */
.photo-main { border-radius: var(--radius-sm); overflow: hidden; background: var(--navy-900); aspect-ratio: 4/3; position: relative; }
.photo-main img, .photo-main svg { width: 100%; height: 100%; object-fit: cover; }
.photo-caption { font-size: 13px; color: var(--muted); margin-top: 10px; }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.thumb { aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 2px solid transparent; background: var(--navy-900); }
.thumb.active { border-color: var(--accent); }
.thumb img, .thumb svg { width: 100%; height: 100%; object-fit: cover; }
.badge-real { position: absolute; top: 10px; left: 10px; background: var(--accent); color: var(--navy); font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }

/* Passo a passo */
.steps { list-style: none; counter-reset: s; }
.steps li {
  counter-increment: s; position: relative;
  padding: 14px 14px 14px 58px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 10px;
  font-size: 14px; line-height: 1.5; cursor: pointer; transition: background .15s, border-color .15s;
}
.steps li::before {
  content: counter(s); position: absolute; left: 14px; top: 12px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--navy); color: #fff; font-weight: 600; font-size: 14px;
  display: grid; place-items: center;
}
.steps li.done { background: var(--accent-soft); border-color: #bfe6da; color: #476458; }
.steps li.done::before { content: "✓"; background: var(--brand-strong); }
.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 6px 0 14px; }
.progress span { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.progress-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 22px; border-radius: 14px;
  font-weight: 600; font-size: 15px;
  background: var(--accent); color: var(--navy);
  transition: filter .15s, transform .1s;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: scale(.98); }
.btn.block { width: 100%; }
.btn.dark { background: var(--navy); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn svg { width: 20px; height: 20px; }

.fav-btn.on svg { fill: #f2b400; color: #f2b400; }

/* ---------- Login ---------- */
.login {
  min-height: 100vh; min-height: 100dvh;
  background: radial-gradient(120% 70% at 100% 0%, var(--navy-600) 0%, var(--navy) 45%, var(--navy-950) 100%);
  color: #fff; display: flex; flex-direction: column; padding: 32px 24px 24px;
}
.login .logo-ae { width: 170px; margin: 18px auto 0; }
.login .hero { margin-top: auto; margin-bottom: 28px; }
.login .app-mark { width: 64px; height: 64px; margin-bottom: 16px; }
.login h1 { font-size: 34px; font-weight: 700; letter-spacing: -.5px; line-height: 1; }
.login h1 span { color: var(--accent); }
.login .hero p { margin-top: 8px; opacity: .8; font-size: 15px; }
.login .hero .line { width: 44px; height: 3px; background: var(--accent); border-radius: 2px; margin: 16px 0; }
.field { margin-bottom: 14px; }
.field label { font-size: 13px; opacity: .8; display: block; margin-bottom: 6px; }
.field .input {
  display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 14px;
  border-radius: 14px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14);
}
.field .input:focus-within { border-color: var(--accent); background: rgba(255,255,255,.1); }
.field .input svg { width: 20px; height: 20px; opacity: .6; }
.field input { flex: 1; background: transparent; border: 0; outline: 0; color: #fff; font-size: 15px; min-width: 0; }
.field input::placeholder { color: rgba(255,255,255,.4); }
.login .error { color: #ff9c9c; font-size: 13px; min-height: 18px; margin-bottom: 8px; }
.login .foot { text-align: center; font-size: 12px; opacity: .5; margin-top: 22px; }

/* ---------- Navegação inferior ---------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 520px; height: var(--nav-h);
  background: var(--navy); display: flex; z-index: 30;
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid rgba(255,255,255,.06);
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: rgba(255,255,255,.55); font-size: 11px; font-weight: 500; position: relative;
}
.bottom-nav a svg { width: 22px; height: 22px; }
.bottom-nav a.active { color: var(--accent); }
.bottom-nav a.active::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }

/* ---------- Suporte / Mais ---------- */
.support-card {
  background: var(--navy); color: #fff; border-radius: var(--radius); padding: 22px; margin-bottom: 14px;
}
.support-card .head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.support-card .head .ic { width: 52px; height: 52px; border-radius: 14px; background: var(--accent); color: var(--navy); display: grid; place-items: center; }
.support-card .head .ic svg { width: 28px; height: 28px; }
.support-card strong { font-size: 17px; }
.support-card p { font-size: 13px; opacity: .7; }
.contact-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.contact-row:last-child { border-bottom: 0; }
.contact-row svg { width: 20px; height: 20px; color: var(--brand-strong); }
.contact-row span { color: var(--muted); font-size: 12px; display: block; }

.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--brand-strong); }
.status-pill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-pill.off { background: #fde8e8; color: var(--danger); }

.about { text-align: center; padding: 26px 16px 10px; color: var(--muted); font-size: 12px; }
.about img { width: 130px; margin: 0 auto 10px; opacity: .9; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px); transform: translateX(-50%) translateY(20px);
  background: var(--navy-900); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 50; box-shadow: 0 8px 24px rgba(0,0,0,.25);
  max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.offline-bar { background: #fde8e8; color: var(--danger); font-size: 12px; text-align: center; padding: 6px; display: none; }
body.is-offline .offline-bar { display: block; }

@media (min-width: 521px) {
  body { padding: 0; }
}
