/* AUTOGO Custom Theme */

/* 1. Logo */
.logo svg { display: none !important; }
.logo__word { display: none !important; }
.logo {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}
.logo { justify-content: center !important; }
.logo::before {
  content: '';
  display: block;
  width: 40px;
  height: 23px;
  background: url('/autogo-icon.svg') center / contain no-repeat;
}

/* 4. Credit card dark */
.credit-card {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%) !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
}
.credit-card__brand,
.credit-card__num,
.credit-card__amount {
  color: #fff !important;
}

/* 8. Smaller page titles */
h1, h2, .page-title, .section-title {
  font-size: 1.15rem !important;
}

/* 9. Center no-vehicles message */
[data-testid="no-vehicles"] {
  text-align: center !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
}

/* 11. NO fade mask - removed per feedback */

/* 12. Active tab: CIRCULAR, blue bg, white icon */
.tabbar__item.is-active .tabbar__dot,
.tabbar__item .tabbar__dot {
  display: none !important;
}
.tabbar__item.is-active {
  background: var(--blue, #06a5ff) !important;
  border-radius: 50% !important;
  width: 46px !important;
  height: 46px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #fff !important;
}
.tabbar__item.is-active svg,
.tabbar__item.is-active .tabbar__icon,
.tabbar__item.is-active span {
  color: #fff !important;
  fill: #fff !important;
}

/* 13. All bubble-icon backgrounds blue */
.bubble-icon {
  background: var(--blue, #06a5ff) !important;
  color: #fff !important;
}

/* 4. Logout button BLUE bg WHITE text */
[data-testid="logout-btn"],
button.btn.btn--outline.btn--block.mt24[style*="red"] {
  background: var(--blue, #06a5ff) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 10px !important;
}
[data-testid="logout-btn"] svg {
  color: #fff !important;
  fill: #fff !important;
}

/* 3. Hide "Código" tag on profile */
p.tag.mt8 {
  display: none !important;
}

/* 6. Hide settings gear button on profile page */
a[aria-label="Configurações"],
a[href="/settings"].icon-btn {
  display: none !important;
}

/* 14. Theme toggle as list item (same style as others) */
.theme-toggle-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  border-radius: 12px;
  transition: background 0.2s;
}
.theme-toggle-item:active {
  background: rgba(255,255,255,0.05);
}
.theme-toggle-item .toggle-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--blue, #06a5ff);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.theme-toggle-item .toggle-icon svg {
  width: 20px;
  height: 20px;
  fill: #fff;
  color: #fff;
}
.theme-toggle-item .toggle-label {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  color: inherit;
}
.theme-toggle-item .toggle-chevron {
  color: var(--muted, #6c757d);
  font-size: 14px;
}

/* 15. Center referral/invite page */
[data-testid="invite-page"],
[data-testid="referral-page"],
.invite-section,
.referral-section {
  text-align: center !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
}

/* 16. Hide "Copiar Link" button, inline copy icon uses SVG not emoji */
[data-testid="copy-invite-btn"] {
  display: none !important;
}
.inline-copy-icon {
  cursor: pointer;
  margin-left: 8px;
  color: var(--blue, #06a5ff);
  vertical-align: middle;
  display: inline-flex;
  align-items: center;
}
.inline-copy-icon:hover {
  opacity: 0.7;
}
.inline-copy-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* 17. XP card */
[data-testid="xp-card"] {
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
  padding: 16px !important;
}
.xp-badge {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: #fff;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--blue, #06a5ff), #1e3a8a);
}
.xp-info {
  flex: 1;
}
.xp-info .xp-rank {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}
.xp-info .xp-bar-wrapper {
  background: var(--border, #e9ecef);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
}
.xp-info .xp-bar-fill {
  background: var(--blue, #06a5ff);
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
}

/* 10. Language selector - visible text on dark bg */
.lang-selector {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.ag-lang-btn, .ag-lang-opt {
  background: none; border: none; padding: 4px; margin: 0;
  cursor: pointer; line-height: 0; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.ag-flag {
  width: 28px !important; height: 20px !important;
  min-width: 28px; max-width: 28px; min-height: 20px; max-height: 20px;
  flex: none; border-radius: 4px;
  object-fit: cover; display: block;
  box-shadow: 0 0 0 1px rgba(128,128,128,0.25);
}
.ag-lang-menu {
  display: none;
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 1000;
  flex-direction: column; gap: 4px; padding: 6px;
  background: #fff; border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}
.dark-theme .ag-lang-menu { background: #1c2630; }
.lang-selector.is-open .ag-lang-menu { display: flex; }

/* Header brand: AUTOGO icon, centered in the app bar */
header.appbar { position: relative; }
.ag-logo-wrap {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  line-height: 0; pointer-events: none;
}
.ag-logo { height: 23px; width: auto; display: block; }

/* 3. Center empty state pages (no orders, no vehicles, etc) */
[data-testid="no-orders"],
[data-testid="no-vehicles"],
.center.mt32.muted {
  text-align: center !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 200px !important;
}

/* Patentes: ensure badge images show correctly */
.card.card--flat img[src*="/api/files/"] {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
}

/* Profile button hidden */
[data-testid="home-profile-btn"] {
  display: none !important;
}

/* Google Translate: hide its UI */
iframe.skiptranslate, .goog-te-banner-frame, #goog-gt-tt, .goog-te-balloon-frame { display: none !important; }
body { top: 0 !important; }
.goog-text-highlight { background: none !important; box-shadow: none !important; }

/* CajuPay PIX modal */
.ag-modal {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.ag-modal__box {
  position: relative;
  width: 100%; max-width: 380px;
  background: #fff; color: #1a1a2e;
  border-radius: 16px; padding: 24px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  text-align: center;
}
.dark-theme .ag-modal__box { background: #151e26; color: #eaf1f7; }
.ag-modal__close {
  position: absolute; top: 8px; right: 12px;
  background: none; border: none; font-size: 26px; cursor: pointer; color: inherit;
}
.ag-qr { width: 220px; height: 220px; max-width: 100%; object-fit: contain; background: #fff; border-radius: 8px; }
.ag-amount { font-size: 22px; font-weight: 700; margin: 0; }
.ag-code {
  width: 100%; min-height: 80px; resize: none;
  font-size: 12px; font-family: monospace; word-break: break-all;
  border: 1px solid rgba(0,0,0,0.15); border-radius: 8px; padding: 8px;
  background: transparent; color: inherit;
}
.ag-btn { background: var(--blue, #06a5ff) !important; color: #fff !important; border: none !important; border-radius: 10px !important; }
.ag-muted { opacity: 0.7; font-size: 13px; margin: 0; word-break: break-all; }
.ag-ok { color: #10b981; font-weight: 600; margin: 0; }
.ag-err { color: #ef4444; font-weight: 600; margin: 0; }

/* 3D viewer: display only, spinning loop */
model-viewer { pointer-events: none !important; touch-action: pan-y !important; }
.car-hero { display: flex !important; justify-content: center !important; align-items: center !important; }
.card:has(> .car-hero) { padding: 0 !important; overflow: hidden !important; }
.car-hero { width: 100% !important; padding: 0 !important; }
.car-hero model-viewer { width: 100% !important; height: 300px !important; margin: 0 !important; --poster-color: transparent; }

/* Splash (preloader) */
.ag-splash {
  position: fixed; inset: 0; z-index: 10001;
  background: var(--blue, #06a5ff); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px;
  transition: opacity 400ms ease;
}
.ag-splash.is-out { opacity: 0; }
.ag-splash__logo {
  width: 150px; max-width: 50vw; height: auto;
  filter: brightness(0) invert(1);
  animation: ag-scale-in 700ms cubic-bezier(.2,.8,.2,1) both, ag-float 3.5s ease-in-out 700ms infinite;
}
.ag-splash__bar {
  width: 120px; height: 4px; overflow: hidden;
  background: rgba(255,255,255,0.3); border-radius: 2px;
}
.ag-splash__bar i {
  display: block; width: 40%; height: 100%;
  background: #fff; border-radius: 2px;
  animation: ag-loading 1.4s ease-in-out infinite;
}
.ag-splash__cap {
  position: absolute; bottom: 28px; left: 0; right: 0;
  margin: 0; text-align: center; font-size: 13px; opacity: 0.85;
}
@keyframes ag-scale-in { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }
@keyframes ag-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes ag-loading { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

/* Onboarding */
.ag-onb {
  position: fixed; inset: 0; z-index: 10000;
  background: #fff; color: #1a1a2e;
  display: flex; justify-content: center;
  transition: opacity 300ms ease;
}
.dark-theme .ag-onb { background: #0f171e; color: #eaf1f7; }
.ag-onb.is-out { opacity: 0; }
.ag-onb__frame {
  width: 100%; max-width: 420px; height: 100%;
  display: flex; flex-direction: column;
  padding: 16px 0 max(24px, env(safe-area-inset-bottom));
}
.ag-onb__skip {
  align-self: flex-end; margin-right: 20px;
  background: none; border: none; color: inherit; opacity: 0.6;
  font-size: 14px; cursor: pointer; padding: 8px;
}
.ag-onb__viewport { flex: 1; min-height: 0; overflow: hidden; }
.ag-onb__track { display: flex; height: 100%; transition: transform 520ms cubic-bezier(.2,.8,.2,1); }
.ag-onb__slide {
  flex: 0 0 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 0 28px; text-align: center;
}
.ag-onb__mark { width: 140px; height: auto; margin-bottom: 12px; }
.ag-onb__slide h2 { margin: 0; font-size: 1.4rem !important; font-weight: 700; }
.ag-onb__slide p { margin: 0; opacity: 0.65; font-size: 14px; line-height: 1.5; }
.ag-onb__footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
}
.ag-onb__dots { display: flex; gap: 6px; align-items: center; }
.ag-onb__dots i {
  width: 7px; height: 7px; border-radius: 999px;
  background: rgba(6,165,255,0.25);
  transition: width 250ms ease, background 250ms ease;
}
.ag-onb__dots i.is-active { width: 22px; background: var(--blue, #06a5ff); }
.ag-onb__nav {
  min-width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid rgba(128,128,128,0.3); background: transparent; color: inherit;
  font-size: 26px; line-height: 1; cursor: pointer;
  transition: min-width 250ms ease, border-radius 250ms ease;
}
.ag-onb__nav--blue { background: var(--blue, #06a5ff); color: #fff; border: none; }
.ag-onb__nav.is-wide { min-width: 120px; border-radius: 24px; font-size: 15px; font-weight: 600; padding: 0 20px; }

/* City filter */
[data-testid="city-chips"] { display: none !important; }
.ag-city-btn {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 14px; padding: 10px 14px 10px 10px;
  border: 1px solid rgba(128,128,128,0.22); border-radius: 14px;
  background: rgba(128,128,128,0.08); color: inherit;
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease;
}
.ag-city-btn:active { background: rgba(6,165,255,0.12); border-color: var(--blue, #06a5ff); }
.ag-city-btn__ic {
  width: 30px; height: 30px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--blue, #06a5ff); color: #fff;
}
.ag-city-btn__ic svg { width: 16px; height: 16px; }
.ag-city-btn__chev { display: flex; opacity: 0.55; }
.ag-city-btn__chev svg { width: 16px; height: 16px; }

/* Bottom sheet (city filter, install prompt) */
.ag-sheet {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(0,0,0,0); display: flex; align-items: flex-end; justify-content: center;
  transition: background 250ms ease;
}
.ag-sheet.is-open { background: rgba(0,0,0,0.55); }
.ag-sheet__panel {
  width: 100%; max-width: 420px; max-height: 75vh; overflow-y: auto;
  background: #fff; color: #1a1a2e;
  border-radius: 22px 22px 0 0;
  padding: 10px 16px max(20px, env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform 250ms cubic-bezier(.2,.8,.2,1);
}
.dark-theme .ag-sheet__panel { background: #151e26; color: #eaf1f7; }
.ag-sheet.is-open .ag-sheet__panel { transform: translateY(0); }
.ag-sheet__grab { display: block; width: 40px; height: 4px; border-radius: 2px; background: rgba(128,128,128,0.35); margin: 0 auto 14px; }
.ag-sheet__title { margin: 0 4px 12px; font-size: 1.05rem !important; font-weight: 700; }
.ag-sheet__list { display: flex; flex-direction: column; gap: 6px; }
.ag-sheet__opt {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px; border: 1px solid transparent; border-radius: 14px;
  background: rgba(128,128,128,0.07); color: inherit; font: inherit; font-size: 15px;
  text-align: left; cursor: pointer;
}
.ag-sheet__opt.is-active { border-color: var(--blue, #06a5ff); background: rgba(6,165,255,0.1); }
.ag-sheet__ic {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6,165,255,0.14); color: var(--blue, #06a5ff);
}
.ag-sheet__opt.is-active .ag-sheet__ic { background: var(--blue, #06a5ff); color: #fff; }
.ag-sheet__ic svg { width: 17px; height: 17px; }
.ag-sheet__label { flex: 1; font-weight: 500; }
.ag-sheet__check { display: flex; color: var(--blue, #06a5ff); visibility: hidden; }
.ag-sheet__opt.is-active .ag-sheet__check { visibility: visible; }
.ag-sheet__check svg { width: 18px; height: 18px; }

/* PWA install prompt */
.ag-install__panel { text-align: center; padding-top: 22px; }
.ag-install__icon { width: 64px; height: 64px; border-radius: 16px; display: block; margin: 0 auto 12px; box-shadow: 0 6px 18px rgba(6,165,255,0.35); }
.ag-install__text { margin: 0 8px 18px; opacity: 0.7; font-size: 14px; line-height: 1.5; }
.ag-install__actions { display: flex; gap: 10px; }
.ag-install__later, .ag-install__go {
  flex: 1; height: 48px; border-radius: 14px; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
}
.ag-install__later { background: transparent; color: inherit; border: 1px solid rgba(128,128,128,0.3); }
.ag-install__go { background: var(--blue, #06a5ff); color: #fff; border: none; }

/* Orders: clickable cards + detail screen */
.ag-order-click { cursor: pointer; transition: transform 150ms ease; }
.ag-order-click:active { transform: scale(0.99); }
.ag-order-more {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid rgba(128,128,128,0.15);
  color: var(--blue, #06a5ff); font-size: 13px; font-weight: 600;
}
.ag-order-more svg { width: 16px; height: 16px; }
.ag-od {
  position: fixed; inset: 0; z-index: 900;
  display: flex; justify-content: center;
  background: var(--bg, #0f171e);
}
.ag-od__app {
  width: 100%; max-width: 420px; height: 100%;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.ag-od .screen__body { padding-bottom: 32px; }
.ag-od .car-row .tag { align-self: flex-start; }
body.ag-od-open { overflow: hidden; }

/* 3D model upload progress */
.ag-upload {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 9999;
  background: var(--blue, #06a5ff); color: #fff;
  padding: 10px 18px; border-radius: 12px; font-size: 14px; font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2); max-width: calc(100% - 32px);
}
.ag-upload--err { background: #ef4444; }

/* CajuPay admin card */
.ag-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 500; }
.ag-field input {
  padding: 10px 12px; border-radius: 10px;
  border: 1px solid rgba(128,128,128,0.35);
  background: transparent; color: inherit; font-size: 14px;
}

/* Remove old theme-switch-wrapper if any */
.theme-switch-wrapper {
  display: none !important;
}
