/* USABusca — camada visual moderna */
:root {
  --ink: #111c2f;
  --forest: #081b33;
  --forest-2: #102c4f;
  --paper: #f3f5f9;
  --line: #e1e6ef;
  --muted: #697588;
  --red: #cf1838;
  --red-dark: #aa102c;
  --lime: #ff7484;
  --shadow: 0 18px 50px rgba(8, 27, 51, .08);
}

body {
  background:
    radial-gradient(circle at 88% 0%, rgba(207, 24, 56, .045), transparent 25rem),
    radial-gradient(circle at 20% 85%, rgba(16, 44, 79, .045), transparent 28rem),
    var(--paper);
  -webkit-font-smoothing: antialiased;
}

button, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible {
  outline: 3px solid rgba(207, 24, 56, .24);
  outline-offset: 3px;
}

/* Marca e navegação */
.sidebar {
  background: linear-gradient(165deg, #0c2442 0%, #081b33 55%, #061526 100%);
  border-right: 1px solid rgba(255, 255, 255, .06);
  box-shadow: 12px 0 35px rgba(8, 27, 51, .08);
}
.brand { padding-bottom: 32px; }
.brand strong { font-size: 18px; letter-spacing: -.45px; }
.brand span { color: #91a4bb; letter-spacing: 1.45px; }
.brand-mark {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #e52a47, #b7112f);
  color: #fff;
  font-size: 10px;
  letter-spacing: .15px;
  border: 1px solid rgba(255, 255, 255, .2);
  box-shadow: 0 8px 20px rgba(207, 24, 56, .25);
}
.brand-mark::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(255, 255, 255, .92);
}
.brand-mark.large {
  width: 68px;
  height: 68px;
  border-radius: 19px;
  font-size: 15px;
}
.nav-item {
  position: relative;
  border: 1px solid transparent;
  border-radius: 11px;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.nav-item:hover { transform: translateX(2px); }
.nav-item.active {
  background: linear-gradient(135deg, #d91f3f, #b91130);
  border-color: rgba(255, 255, 255, .12);
  box-shadow: 0 9px 22px rgba(207, 24, 56, .2);
}
.source-badge { border-top-color: rgba(255, 255, 255, .08); }
.status-dot { box-shadow: 0 0 0 5px rgba(255, 116, 132, .09); }
.logout-button { transition: color .18s ease; }
.logout-button:hover { color: #fff; }

/* Cabeçalho */
.main { padding-top: 28px; }
.topbar {
  background: rgba(255, 255, 255, .8);
  border: 1px solid rgba(225, 230, 239, .9);
  border-radius: 17px;
  padding: 16px 20px;
  margin-bottom: 24px;
  box-shadow: 0 7px 24px rgba(8, 27, 51, .035);
  backdrop-filter: blur(14px);
}
.topbar .eyebrow { margin-bottom: 5px; }
.avatar {
  background: #0c2442;
  color: #fff;
  border: 3px solid #e8edf4;
  width: 41px;
  height: 41px;
}

/* Consulta */
.lookup-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 36px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 22px;
  background:
    radial-gradient(circle at 92% 12%, rgba(255, 116, 132, .16), transparent 18rem),
    linear-gradient(135deg, #102c4f 0%, #081b33 72%);
  box-shadow: 0 22px 48px rgba(8, 27, 51, .17);
}
.lookup-hero::before {
  content: '';
  position: absolute;
  z-index: -1;
  width: 300px;
  height: 300px;
  right: -155px;
  bottom: -190px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 50%;
  box-shadow: 0 0 0 55px rgba(255, 255, 255, .018), 0 0 0 110px rgba(255, 255, 255, .012);
}
.lookup-hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 36px;
  width: 74px;
  height: 4px;
  border-radius: 0 0 5px 5px;
  background: #e22442;
}
.lookup-hero h2 {
  font-size: clamp(25px, 2.5vw, 34px);
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 12px;
}
.lookup-hero p:not(.eyebrow) { color: #b7c4d3; line-height: 1.65; }
.vin-form {
  background: rgba(255, 255, 255, .075);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 17px;
  padding: 18px;
  backdrop-filter: blur(12px);
}
.vin-form > label { color: #d8e1ec; letter-spacing: 1.25px; }
.vin-input-row input {
  min-height: 55px;
  border: 2px solid transparent;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .12);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.vin-input-row input:focus {
  border-color: #ee4058;
  box-shadow: 0 0 0 4px rgba(238, 64, 88, .16), 0 8px 22px rgba(0, 0, 0, .12);
}
.input-meta { color: #9fb0c3; }
.button {
  min-height: 46px;
  border-radius: 11px;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.button.accent {
  background: linear-gradient(135deg, #db2140, #bb1230);
  box-shadow: 0 9px 22px rgba(207, 24, 56, .23);
}
.button.accent:hover {
  background: linear-gradient(135deg, #e72a48, #c31534);
  box-shadow: 0 12px 27px rgba(207, 24, 56, .3);
}
.button.secondary { box-shadow: 0 3px 10px rgba(8, 27, 51, .025); }
.button.secondary:hover { border-color: #bdc8d7; box-shadow: 0 7px 18px rgba(8, 27, 51, .07); }
.text-button { color: #173f6d; border-radius: 7px; }
.text-button:hover { background: rgba(23, 63, 109, .06); }

/* Estados, resultado e dados */
.empty-state {
  background: rgba(255, 255, 255, .84);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 12px 36px rgba(8, 27, 51, .045);
  backdrop-filter: blur(10px);
}
.empty-icon {
  background: linear-gradient(145deg, #fff0f3, #fce2e8);
  color: #c71837;
  border: 1px solid #f8d3da;
  box-shadow: 0 9px 22px rgba(207, 24, 56, .08);
}
.empty-features span {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: #42516a;
}
.result {
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.result-head { background: #fff; }
.result-head h2 { letter-spacing: -.9px; }
.source-pill {
  background: #eef3f9;
  border: 1px solid #dae4ef;
  color: #173f6d;
}
.vin-strip {
  background: #0c2442;
  border-top: 1px solid rgba(255, 255, 255, .06);
}
.vin-strip .text-button { color: #fff; }
.vin-strip .text-button:hover { background: rgba(255, 255, 255, .09); }
.alert { border-radius: 12px; }
.section-title { color: #26364e; }
.vehicle-grid { gap: 12px; }
.data-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.data-card:hover {
  transform: translateY(-2px);
  border-color: #cbd5e2;
  box-shadow: 0 10px 24px rgba(8, 27, 51, .06);
}
.data-card strong { color: #17263c; }
.scope-note {
  border: 1px solid #eadfe2;
  border-left: 4px solid #cf1838;
  border-radius: 12px;
  background: #fff8f9;
}
.checklist-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 17px;
}
.progress { overflow: hidden; border-radius: 999px; background: #edf0f5; }
.progress span { background: linear-gradient(90deg, #cf1838, #ed5268); }
.check-item { border-radius: 12px; transition: background .18s ease; }
.check-item:hover { background: #f7f9fc; }
.check-item input { accent-color: #cf1838; }

/* Histórico, guia e avisos */
.history-item {
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(8, 27, 51, .025);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.history-item:hover {
  transform: translateY(-2px);
  border-color: #c8d3e1;
  box-shadow: 0 12px 28px rgba(8, 27, 51, .065);
}
.history-vin {
  color: #253c5a;
  background: #f2f5f9;
  border: 1px solid #e3e9f1;
  border-radius: 7px;
  padding: 7px 9px;
}
.history-empty { background: rgba(255, 255, 255, .8); border-radius: 18px; }
.guide-grid article {
  border-radius: 16px;
  transition: transform .18s ease, box-shadow .18s ease;
}
.guide-grid article:hover { transform: translateY(-3px); box-shadow: 0 13px 30px rgba(8, 27, 51, .065); }
.guide-number { color: #cf1838; }
.provider-card {
  background: linear-gradient(135deg, #102c4f, #081b33);
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 18px;
  box-shadow: 0 16px 35px rgba(8, 27, 51, .12);
}
.provider-tag { border-color: rgba(255, 116, 132, .4); }
.toast { border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; }

/* Login */
.login-brand {
  background:
    radial-gradient(circle at 85% 20%, rgba(255, 116, 132, .14), transparent 25rem),
    linear-gradient(150deg, #102c4f 0%, #081b33 70%);
}
.login-brand::before {
  content: '';
  position: absolute;
  top: 0;
  left: clamp(40px, 8vw, 120px);
  width: 90px;
  height: 5px;
  background: #d91f3f;
  border-radius: 0 0 6px 6px;
}
.login-brand::after {
  border-color: rgba(255, 116, 132, .14);
  box-shadow: 0 0 0 80px rgba(255, 116, 132, .025), 0 0 0 160px rgba(255, 116, 132, .018);
}
.login-card {
  border-radius: 22px;
  border-color: rgba(225, 230, 239, .9);
  box-shadow: 0 24px 65px rgba(8, 27, 51, .1);
}
.login-card input {
  min-height: 49px;
  border-radius: 10px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.login-card input:focus {
  border-color: #d91f3f;
  box-shadow: 0 0 0 4px rgba(207, 24, 56, .09);
}
.login-card .button.primary {
  background: linear-gradient(135deg, #102c4f, #081b33);
  box-shadow: 0 10px 23px rgba(8, 27, 51, .17);
}

/* Leitor de código de barras */
.scan-button {
  background: rgba(255, 255, 255, .1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .18);
  white-space: nowrap;
}
.scan-button:hover { background: rgba(255, 255, 255, .17); }
.scanner-open { overflow: hidden; }
.scanner-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(3, 12, 24, .84);
  backdrop-filter: blur(12px);
}
.scanner-dialog {
  width: min(680px, 100%);
  max-height: calc(100dvh - 44px);
  overflow: auto;
  padding: 22px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 22px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .35);
}
.scanner-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 17px; }
.scanner-head h2 { margin: 0; font-size: 24px; }
.scanner-head .eyebrow { margin-bottom: 6px; }
.scanner-close {
  flex: 0 0 auto;
  width: 39px;
  height: 39px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f5f7fa;
  color: #24364f;
  font-size: 26px;
  line-height: 1;
}
.scanner-close:hover { background: #eaf0f6; }
.scanner-view {
  position: relative;
  overflow: hidden;
  height: 370px;
  background: #050b13;
  border-radius: 16px;
}
#scannerReader { width: 100%; height: 100%; border: 0 !important; }
#scannerReader video { width: 100% !important; height: 100% !important; object-fit: cover; }
#scannerReader img { display: none; }
.scanner-frame { position: absolute; inset: 0; pointer-events: none; }
.scanner-frame::after {
  content: '';
  position: absolute;
  left: 9%;
  right: 9%;
  top: 50%;
  height: 2px;
  background: #ff334f;
  box-shadow: 0 0 12px rgba(255, 51, 79, .8);
  animation: scanner-line 2.2s ease-in-out infinite;
}
.scanner-frame span { position: absolute; width: 36px; height: 36px; border-color: #fff; border-style: solid; }
.scanner-frame span:nth-child(1) { top: 25%; left: 7%; border-width: 3px 0 0 3px; border-radius: 9px 0 0; }
.scanner-frame span:nth-child(2) { top: 25%; right: 7%; border-width: 3px 3px 0 0; border-radius: 0 9px 0 0; }
.scanner-frame span:nth-child(3) { bottom: 25%; left: 7%; border-width: 0 0 3px 3px; border-radius: 0 0 0 9px; }
.scanner-frame span:nth-child(4) { bottom: 25%; right: 7%; border-width: 0 3px 3px 0; border-radius: 0 0 9px; }
@keyframes scanner-line { 0%, 100% { transform: translateY(-52px); } 50% { transform: translateY(52px); } }
.scanner-status { margin: 16px 0 6px; color: #173f6d; font-weight: 700; text-align: center; }
.scanner-help { margin: 0 auto; max-width: 520px; color: var(--muted); font-size: 12px; line-height: 1.55; text-align: center; }
@media (max-width: 760px) {
  .vin-input-row .scan-button { width: 100%; }
  .scanner-modal { padding: 12px; }
  .scanner-dialog { max-height: calc(100dvh - 24px); padding: 16px; border-radius: 18px; }
  .scanner-head h2 { font-size: 21px; }
  .scanner-view { height: min(52vh, 360px); min-height: 260px; }
}

/* Celular */
@media (max-width: 760px) {
  .main { padding: 16px 14px 100px; }
  .topbar { padding: 13px 15px; margin-bottom: 17px; border-radius: 15px; }
  .topbar h1 { font-size: 21px; }
  .lookup-hero { padding: 25px 19px 20px; border-radius: 19px; }
  .lookup-hero::after { left: 20px; width: 58px; }
  .lookup-hero h2 { font-size: 25px; letter-spacing: -.7px; }
  .vin-form { padding: 13px; border-radius: 14px; }
  .vin-input-row input { min-height: 53px; }
  .empty-state { border-radius: 18px; }
  .empty-features { align-items: center; }
  .empty-features span { width: fit-content; }
  .result { border-radius: 17px; }
  .vehicle-grid { gap: 9px; }
  .history-vin { width: fit-content; }
  .mobile-nav {
    background: rgba(8, 27, 51, .96);
    border-top: 1px solid rgba(255, 255, 255, .1);
    box-shadow: 0 -12px 32px rgba(8, 27, 51, .18);
    backdrop-filter: blur(18px);
  }
  .mobile-nav button { border-radius: 10px; min-width: 76px; }
  .mobile-nav button.active { color: #ff8290; background: rgba(255, 116, 132, .08); }
  .toast { box-shadow: 0 15px 35px rgba(8, 27, 51, .25); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
