:root {
  --bg: #080C10;
  --card: #111820;
  --border: rgba(255,255,255,.08);
  --text: #F0F4F8;
  --muted: #8A9BB0;
  --green: #00E87A;
  --green-dark: #00B85F;
  --red: #ff6b6b;
  --yellow: #ffd666;
  --font-head: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-body); background: var(--bg); color: var(--text); }

.client-auth {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.client-auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 5vw;
  border-bottom: 1px solid var(--border);
  background: rgba(8,12,16,0.92);
}

.client-auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.2rem;
}

.client-auth-logo svg { width: 34px; height: 34px; }
.plugbsb-logo-img {
  width: auto;
  height: auto;
  max-width: none;
  aspect-ratio: 773 / 397;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.client-auth-logo-mark {
  max-height: 128px;
  background: #fff;
  border-radius: 12px;
  padding: 0.35rem 0.75rem;
}
.client-auth-logo span span { color: var(--green); }

.client-auth-back {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
}

.client-auth-back:hover { color: var(--green); }

.client-auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.client-card {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.75rem;
}

.client-card-label {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
  font-weight: 600;
}

.client-card h1 {
  margin: 0 0 0.75rem;
  font-family: var(--font-head);
  font-size: 1.6rem;
}

.client-auth-form label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem; color: var(--muted); margin-top: 0.85rem; }
.client-auth-forgot {
  margin: 0.35rem 0 0;
  text-align: right;
  font-size: 0.82rem;
}
.client-auth-forgot a {
  color: var(--green);
  text-decoration: none;
  font-weight: 600;
}
.client-auth-forgot a:hover { text-decoration: underline; }
.client-success {
  margin: 1rem 0 0;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background: rgba(0, 232, 122, 0.1);
  border: 1px solid rgba(0, 232, 122, 0.35);
  color: #b8f5d4;
  font-size: 0.9rem;
}
.client-card input {
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0D1218;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}

.client-card input:focus {
  outline: none;
  border-color: rgba(0,232,122,0.5);
}

.client-card button {
  margin-top: 1.25rem;
  width: 100%;
  padding: 0.85rem;
  border: none;
  border-radius: 100px;
  background: var(--green);
  color: #000;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.client-card button:hover {
  background: var(--green-dark);
  transform: scale(1.01);
}

.client-error { color: var(--red); font-size: 0.9rem; margin-top: 0.75rem; }
.client-muted { color: var(--muted); font-size: 0.88rem; line-height: 1.55; }
.client-foot { margin-top: 1.25rem; text-align: center; }
.client-foot a { color: var(--green); text-decoration: none; font-weight: 600; }
.client-foot a:hover { text-decoration: underline; }

.client-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.client-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-head);
  font-weight: 800;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.client-logo-mark {
  max-height: 104px;
  background: #fff;
  border-radius: 12px;
  padding: 0.35rem 0.75rem;
}

.client-logo-text span { color: var(--green); }

.client-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}
.client-nav a { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.client-nav a.is-active, .client-nav a:hover { color: var(--green); }

.client-header-right { display: flex; gap: 1rem; align-items: center; font-size: 0.9rem; flex-shrink: 0; }
.client-header-right a { color: var(--green); text-decoration: none; }
.client-site-link { color: var(--muted) !important; }
.client-site-link:hover { color: var(--green) !important; }
.client-user { color: var(--muted); }

.client-main { padding: 1.25rem; max-width: 1100px; margin: 0 auto; }
.client-page-title { font-size: 1.4rem; margin: 0 0 1rem; }

.client-flash {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
}
.client-flash--success { background: rgba(0,232,122,.12); border: 1px solid rgba(0,232,122,.35); color: #7dffb8; }
.client-flash--error { background: rgba(255,107,107,.12); border: 1px solid rgba(255,107,107,.35); color: #ff9a9a; }

.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.client-card-block, .client-action-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
}
.client-card-block + .client-card-block { margin-top: 1rem; }
.client-section-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-family: var(--font-head);
  color: var(--green);
}

.client-action-card {
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}
.client-action-card:hover { border-color: rgba(0,232,122,.4); }
.client-action-card h2 { margin: 0 0 0.5rem; font-size: 1rem; color: var(--green); }
.client-action-card p { margin: 0; color: var(--muted); font-size: 0.88rem; }

.client-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.client-table th, .client-table td { padding: 0.65rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
.client-table th { background: #0d1218; color: var(--muted); }

.client-link { color: var(--green); text-decoration: none; font-weight: 600; }
.client-btn {
  display: inline-block;
  padding: 0.55rem 1rem;
  background: var(--green);
  color: #000;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-size: 0.88rem;
}
.client-toolbar { margin: 0 0 1rem; }
.client-back { margin: 0 0 1rem; }
.client-back a { color: var(--muted); text-decoration: none; }
.client-back a:hover { color: var(--green); }

.client-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}
.client-badge--pendente { background: rgba(255,193,7,.15); color: var(--yellow); }
.client-badge--aprovado { background: rgba(0,232,122,.12); color: #7dffb8; }
.client-badge--reprovado { background: rgba(255,107,107,.12); color: #ff9a9a; }

.client-vistoria-notice {
  margin: 0 0 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.client-vistoria-notice--aprovado {
  border-color: rgba(0, 232, 122, 0.35);
  background: rgba(0, 232, 122, 0.08);
}

.client-vistoria-notice--reprovado {
  border-color: rgba(255, 107, 107, 0.35);
  background: rgba(255, 107, 107, 0.08);
}

.client-vistoria-notice strong {
  display: block;
  margin-bottom: 0.35rem;
}

.client-vistoria-notice p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.client-motivo-preview {
  max-width: 220px;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

.client-form label { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.85rem; font-size: 0.85rem; color: var(--muted); }
.client-form input, .client-form textarea, .client-form select {
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0d1218;
  color: var(--text);
  font-family: inherit;
}
.client-fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 1rem; margin: 0 0 1rem; }
.client-fieldset legend { color: var(--green); padding: 0 0.35rem; }
.client-hint { font-size: 0.78rem; color: var(--muted); }
.client-hint--ok { color: #7dffb8; }
.client-hint--error { color: var(--red); }

.client-dl { margin: 0; display: grid; gap: 0.5rem; }
.client-dl dt { font-size: 0.72rem; text-transform: uppercase; color: var(--muted); }
.client-dl dd { margin: 0; }

.client-detail-header { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-bottom: 1rem; }
.client-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin-bottom: 1rem; }

.client-video { width: 100%; max-height: 360px; border-radius: 8px; background: #000; }

.client-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}
.client-photo-item { margin: 0; }
.client-photo-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; background: #0d1218; }
.client-photo-item figcaption { font-size: 0.75rem; color: var(--muted); margin-top: 0.35rem; text-align: center; }

@media (max-width: 768px) {
  .client-header {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand actions"
      "nav nav";
  }
  .client-logo { grid-area: brand; }
  .client-header-right { grid-area: actions; }
  .client-nav {
    grid-area: nav;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }
}

/* Vistoria wizard */
.vistoria-intro-title { margin: 0 0 0.75rem; font-family: var(--font-head); font-size: 1.25rem; }
.vistoria-intro-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-top: 1rem; }
.vistoria-inline-form { display: inline; margin: 0; }
.client-btn--ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.client-btn--block { width: 100%; margin-top: 0.5rem; }

.vistoria-step-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.65rem;
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}
.vistoria-step-preview li {
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
}
.vistoria-step-preview img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 0.35rem;
}

.vistoria-wizard { max-width: 480px; margin: 0 auto; }

.vistoria-step-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(0, 232, 122, 0.35);
  background: rgba(0, 232, 122, 0.08);
}
.vistoria-step-badge-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--green);
  font-weight: 700;
}
.vistoria-step-badge-num {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}
.vistoria-step-badge-num span {
  font-size: 1.1rem;
  color: var(--muted);
  font-weight: 700;
}

.vistoria-step-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}
.vistoria-step-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #1a222d;
  border: 1px solid var(--border);
}
.vistoria-step-dot.is-done {
  background: rgba(0, 232, 122, 0.35);
  border-color: rgba(0, 232, 122, 0.5);
}
.vistoria-step-dot.is-current {
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0, 232, 122, 0.2);
}

.vistoria-wizard-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.vistoria-wizard-back {
  color: var(--muted);
  text-decoration: none;
  font-size: 1.25rem;
  line-height: 1;
}
.vistoria-wizard-title {
  flex: 1;
  margin: 0;
  font-family: var(--font-head);
  font-size: 1.1rem;
}
.vistoria-wizard-progress {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.vistoria-progress-bar {
  height: 6px;
  background: #0D1218;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.65rem;
}
.vistoria-progress-bar span {
  display: block;
  height: 100%;
  background: var(--green);
  border-radius: 4px;
  transition: width 0.25s ease;
}

.vistoria-step-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem;
}
.vistoria-step-card h3 {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  font-family: var(--font-head);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.vistoria-step-icon { font-size: 1.1rem; }

.vistoria-instructions {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}
.vistoria-instructions li {
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: 0.45rem;
}
.vistoria-instructions li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--green);
}

.vistoria-guide {
  margin: 0 0 1rem;
  text-align: center;
}
.vistoria-guide img {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  background: #fff;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.vistoria-guide figcaption {
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.vistoria-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.vistoria-upload-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
.vistoria-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.85rem 0.75rem;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
}
.vistoria-btn--primary {
  background: #1a3a5c;
  color: #fff;
}
.vistoria-btn--primary:active { opacity: 0.9; }

.vistoria-upload-status { text-align: center; margin: 0.75rem 0 0; }

.vistoria-preview {
  margin: 0 0 1rem;
  padding: 0;
}
.vistoria-preview-media {
  display: block;
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0d1218;
}
.vistoria-preview figcaption {
  margin-top: 0.5rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}
.vistoria-review-actions {
  display: grid;
  gap: 0.65rem;
}
.vistoria-retake-note {
  margin: -0.35rem 0 0.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: rgba(255, 193, 7, 0.08);
  border: 1px solid rgba(255, 193, 7, 0.25);
}
.vistoria-review-back {
  margin: 1rem 0 0;
  text-align: center;
}

@media (max-width: 640px) {
  .vistoria-wizard { max-width: 100%; }
  .vistoria-upload-actions { grid-template-columns: 1fr; }
}

.client-profile-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1rem;
  align-items: center;
}
.client-profile-selfie img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.client-vehicle-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem;
  align-items: start;
}
.client-vehicle-photo {
  width: 100%;
  max-height: 100px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.client-image-lightbox-trigger,
.client-vehicle-photo-thumb {
  display: block;
  width: 100%;
  max-width: 140px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0d1218;
  cursor: zoom-in;
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
}
.client-image-lightbox-trigger:hover,
.client-image-lightbox-trigger:focus-visible {
  border-color: rgba(0, 232, 122, 0.45);
  transform: translateY(-1px);
  outline: none;
}
.client-image-lightbox-trigger img {
  width: 100%;
  max-height: 100px;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}
.client-dl { margin: 0; }
.client-dl dt {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.5rem;
}
.client-dl dt:first-child { margin-top: 0; }
.client-dl dd { margin: 0.15rem 0 0; }

.client-vehicle-banner {
  margin: 0 0 1rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(0, 232, 122, 0.05);
}
.client-vehicle-banner-label {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--green);
  font-weight: 600;
}
.client-vehicle-banner-grid {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.75rem;
  align-items: center;
}
.client-vehicle-banner-grid .client-image-lightbox-trigger {
  max-width: 72px;
}
.client-vehicle-banner-grid .client-image-lightbox-trigger img {
  width: 72px;
  height: 54px;
  max-height: none;
}
body.client-lightbox-open { overflow: hidden; }
.client-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.client-lightbox[hidden] { display: none !important; }
.client-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  cursor: zoom-out;
}
.client-lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: calc(100vh - 3rem);
}
.client-lightbox-figure { margin: 0; }
.client-lightbox-img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 8rem);
  margin: 0 auto;
  border-radius: 10px;
  object-fit: contain;
  background: #0d1218;
}
.client-lightbox-caption {
  margin-top: 0.75rem;
  text-align: center;
  color: #e8eef4;
  font-size: 0.9rem;
}
.client-lightbox-close {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  z-index: 2;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 999px;
  background: rgba(13, 18, 24, 0.92);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.client-lightbox-close:hover,
.client-lightbox-close:focus-visible {
  background: rgba(0, 232, 122, 0.2);
  outline: none;
}
@media (max-width: 640px) {
  .client-profile-grid,
  .client-vehicle-grid { grid-template-columns: 1fr; }
}
