/* ============================================================================
   BUSÃO VR — Animações Fluidas FM, Estúdio de Pintura, Logo Própria,
   Galeria Híbrida de Modelos, Letreiro LED e Showroom 0 km (Fase 8)
   ============================================================================ */

/* ==================== 1. TRANSIÇÕES & MICRO-INTERAÇÕES ==================== */
@keyframes fmFadeSlide {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fmCardPop {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fmPulseLive {
  0%, 100% { box-shadow: 0 0 0 0 rgba(31, 209, 139, 0.55); opacity: 1; }
  60%      { box-shadow: 0 0 0 6px rgba(31, 209, 139, 0); opacity: 0.85; }
}

@keyframes fmPulseCrit {
  0%, 100% { box-shadow: 0 0 0 0 rgba(242, 100, 87, 0.6); }
  60%      { box-shadow: 0 0 0 7px rgba(242, 100, 87, 0); }
}

@keyframes fmShowroomDriveIn {
  0%   { opacity: 0; transform: translateX(-95px) scale(0.95); }
  65%  { opacity: 1; transform: translateX(8px) scale(1.01); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes fmHeadlightFlash {
  0%, 18%, 36%, 100% { opacity: 0.25; transform: scaleX(0.9); }
  9%, 27%            { opacity: 1;    transform: scaleX(1.12); }
}

@keyframes fmLedMarquee {
  0%   { transform: translateX(0%); }
  100% { transform: translateX(-50%); }
}

@keyframes fmShimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Entrada suave das telas departamentais */
.fm-view-dept:not(.hidden) {
  animation: fmFadeSlide 0.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.fm-view-dept .card,
.fm-view-dept .fm-bus-card,
.fm-view-dept .fm-bay-card {
  animation: fmCardPop 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Hover elevado e responsivo em cards clicáveis */
.fm-bus-card,
.fm-slot-card,
.fm-club-card,
.cfg-option {
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.18s ease,
              box-shadow 0.18s ease,
              background-color 0.18s ease;
}

.fm-bus-card:hover,
.fm-slot-card.has-save:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.34);
}

/* Modal entrada suave */
.modal-backdrop:not(.hidden) .modal-box {
  animation: fmCardPop 0.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Pulso ao vivo no ponto do HUD e alertas críticos */
.brand-dot.is-live {
  animation: fmPulseLive 2.2s ease-in-out infinite;
}

.fm-continue-btn.is-crit {
  animation: fmPulseCrit 1.8s ease-in-out infinite;
}

/* Donut SVG com preenchimento suave */
.fm-donut circle:last-of-type {
  transition: stroke-dashoffset 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Respeita acessibilidade e preferência do jogador */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

/* ==================== 2. LOGO PRÓPRIA DA EMPRESA ==================== */
.company-badge.has-logo {
  padding: 2px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.company-badge.has-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.fm-logo-img {
  object-fit: contain;
  display: block;
  border-radius: 6px;
}

.fm-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.fm-logo-wrap.bg-light { background: #F1F5F9; padding: 3px; border: 1px solid rgba(255,255,255,0.2); }
.fm-logo-wrap.bg-dark  { background: #0B111B; padding: 3px; border: 1px solid rgba(255,255,255,0.16); }
.fm-logo-wrap.bg-transparent { background: transparent; padding: 0; }

/* ==================== 3. ESTÚDIO DE PINTURA & PRANCHA BUSOLOGIA ==================== */
.livery-stage {
  position: relative;
  width: 100%;
  flex-shrink: 0;
  background: radial-gradient(circle at 50% 25%, #1D283A 0%, #0E1522 70%, #0A0F18 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.livery-stage.is-prancha {
  background: #2C333D;
  padding: 10px;
}

.livery-stage.is-prancha > svg {
  width: 100%;
  height: auto;
  display: block;
}

.livery-stage > svg {
  max-width: 100%;
  height: auto;
  display: block;
}

.livery-stage img.prancha-upload-img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: 8px;
  background: #1B222C;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42);
}

.livery-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.livery-color-field {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0F1622;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 11.5px;
}

.livery-color-field input[type="color"] {
  width: 28px;
  height: 24px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.livery-style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 6px;
}

/* ==================== 4. GALERIA HÍBRIDA DE MODELOS (DESENHO BRANCO / FOTO REAL) ==================== */
.bus-visual-box {
  position: relative;
  width: 100%;
  background: radial-gradient(ellipse at 50% 85%, rgba(255,255,255,0.05) 0%, #0D1420 75%);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 92px;
}

.bus-visual-box.size-lg { min-height: 175px; padding: 10px; }
.bus-visual-box.size-md { min-height: 116px; padding: 8px; }
.bus-visual-box.size-sm { min-height: 82px;  padding: 6px; }

.bus-visual-box img.bus-photo-img,
.bus-visual-box canvas.bus-painted-canvas {
  width: 100%;
  height: 100%;
  max-height: 240px;
  object-fit: contain;
  display: block;
  border-radius: 6px;
  transition: transform 0.22s ease;
}

.bus-visual-box.is-clickable { cursor: zoom-in; }
.bus-visual-box.is-clickable:hover img.bus-photo-img,
.bus-visual-box.is-clickable:hover canvas.bus-painted-canvas {
  transform: scale(1.025);
}

.bus-visual-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(9, 14, 22, 0.82);
  color: #E2E8F0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(4px);
  pointer-events: none;
}

/* ==================== 5. LETREIRO LED ELETRÔNICO REALISTA ==================== */
.vr-led-board {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #070A0E;
  border: 2px solid #222B37;
  border-radius: 7px;
  padding: 5px 10px;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.85), 0 2px 6px rgba(0, 0, 0, 0.35);
}

.vr-led-board::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(0, 0, 0, 0.45) 1px, transparent 1px);
  background-size: 3px 3px;
  pointer-events: none;
}

.vr-led-code {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 13px;
  color: var(--led-color, #FFB000);
  text-shadow: 0 0 7px var(--led-color, #FFB000);
  padding-right: 8px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
  letter-spacing: 0.05em;
}

.vr-led-track {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.vr-led-scroll {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--led-color, #FFB000);
  text-shadow: 0 0 6px var(--led-color, #FFB000);
  animation: fmLedMarquee 13s linear infinite;
}

.vr-led-board:hover .vr-led-scroll {
  animation-play-state: paused;
}

/* ==================== 6. SHOWROOM REVEAL (ENTREGA 0 KM) ==================== */
.showroom-stage {
  position: relative;
  border-radius: 14px;
  padding: 22px 16px 18px;
  background: radial-gradient(circle at 50% 15%, rgba(255, 176, 0, 0.16) 0%, #111A28 52%, #090D14 100%);
  border: 1px solid rgba(255, 176, 0, 0.32);
  overflow: hidden;
  text-align: center;
}

.showroom-floor {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 14px;
  height: 16px;
  background: radial-gradient(ellipse at center, rgba(255, 176, 0, 0.22) 0%, rgba(0, 0, 0, 0) 72%);
  pointer-events: none;
}

.showroom-vehicle-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  animation: fmShowroomDriveIn 0.72s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.showroom-beam {
  position: absolute;
  right: -24px;
  bottom: 24%;
  width: 64px;
  height: 26px;
  background: linear-gradient(90deg, rgba(255, 226, 130, 0.65), rgba(255, 226, 130, 0));
  clip-path: polygon(0 35%, 100% 0, 100% 100%, 0 65%);
  animation: fmHeadlightFlash 2.2s ease-in-out infinite;
  pointer-events: none;
}

/* ==================== 7. BOTÃO DE ÁUDIO HUD ==================== */
.hud-audio-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(15, 22, 34, 0.85);
  color: var(--ink-dim);
  cursor: pointer;
  font-size: 13px;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.hud-audio-btn:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.hud-audio-btn.is-muted {
  opacity: 0.55;
  color: var(--muted);
}
