/* ═══════════════════════════════════════════════════════════
   MEU MECÂNICO — style.css
═══════════════════════════════════════════════════════════ */

/* ── TOKENS ── */
:root {
    --bg:           #f5f4f0;
    --surface:      #ffffff;
    --surface2:     #f0efe9;
    --border:       #e0ddd4;
    --accent:       #1a3a2a;
    --accent-mid:   #2d6a4a;
    --accent-light: #e8f5e0;
    --highlight:    #c8f06e;
    --text:         #1a1a1a;
    --text-muted:   #8a8778;
    --tag-bg:       #e8f5e0;
    --danger:       #c0392b;
    --danger-bg:    #fdf0ee;
    --shadow-sm:    0 2px 8px rgba(26,58,42,0.07);
    --shadow-md:    0 4px 24px rgba(26,58,42,0.11);
    --shadow-lg:    0 8px 40px rgba(26,58,42,0.14);
    --r-sm:         8px;
    --r-md:         14px;
    --r-lg:         20px;
    --r-pill:       100px;
    --bubble-user:  #1a3a2a;
    --chat-bg:      #f0efe9;
    --safe-top:     env(safe-area-inset-top, 0px);
    --safe-bottom:  env(safe-area-inset-bottom, 0px);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overscroll-behavior: none; }
body { font-family: 'Sora', sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
.d-none { display: none !important; }
.text-muted  { color: var(--text-muted) !important; }
.small       { font-size: 12px !important; }
.text-center { text-align: center; }

/* ── BANNER DE ATUALIZAÇÃO ── */
.update-banner {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 9000;
    background: var(--accent); color: #fff;
    padding: 12px 16px;
    display: flex; align-items: center; gap: 12px;
    font-family: 'Sora', sans-serif; font-size: 14px; font-weight: 500;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
    animation: slideUpBanner .3s ease;
}
@keyframes slideUpBanner { from{transform:translateY(100%)} to{transform:translateY(0)} }
.update-banner span { flex: 1; }
.update-banner button {
    padding: 7px 16px; background: var(--highlight); color: var(--accent);
    border: none; border-radius: var(--r-pill); font-family: 'Sora', sans-serif;
    font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap;
    transition: background .15s;
}
.update-banner button:hover { background: #b8e060; }
.update-banner-fechar {
    background: transparent; border: none; color: rgba(255,255,255,.7);
    font-size: 20px; cursor: pointer; padding: 0 4px; line-height: 1;
    transition: color .15s;
}
.update-banner-fechar:hover { color: #fff; }

/* ── TOPBAR ── */
.app-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(245, 244, 240, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, visibility .2s ease;
}

.app-loading-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.app-loading-box {
    min-width: 180px;
    max-width: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 24px 28px;
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(224, 221, 212, 0.9);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.app-loading-spinner {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 3px solid rgba(224, 221, 212, 0.95);
    border-top-color: var(--accent);
    animation: spin .7s linear infinite;
}

.app-loading-box p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.app-topbar { position: sticky; top: 0; z-index: 200; background: var(--surface); border-bottom: 1px solid var(--border); padding: calc(var(--safe-top) + 10px) 16px 10px; display: flex; align-items: center; justify-content: space-between; min-height: 56px; }
.app-logo { display: flex; flex-direction: column; gap: 1px; line-height: 1; text-decoration: none; }
.app-logo-eyebrow { font-family: 'JetBrains Mono', monospace; font-size: 8px; letter-spacing: 3px; text-transform: uppercase; color: var(--accent-mid); }
.app-logo-name-wrap { display: flex; align-items: center; gap: 6px; }
.app-logo-img { width: 22px; height: 22px; object-fit: contain; }
.app-logo-name { font-size: 18px; font-weight: 700; color: var(--accent); letter-spacing: -0.4px; }
.app-logo-name em { font-style: normal; color: var(--accent-mid); }

/* ── MENU USUÁRIO ── */
.user-menu-wrapper { position: relative; }
.user-pill { display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px; border-radius: var(--r-pill); border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; min-height: 40px; font-family: 'Sora', sans-serif; transition: border-color .2s, box-shadow .2s; }
.user-pill:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.user-avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--accent-mid), var(--accent)); display: flex; align-items: center; justify-content: center; color: white; font-size: 11px; font-weight: 700; flex-shrink: 0; overflow: hidden; }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.user-name { font-size: 13px; font-weight: 500; color: var(--text); max-width: 80px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chevron { width: 13px; height: 13px; color: var(--text-muted); flex-shrink: 0; transition: transform .2s; }
.user-menu-wrapper.open .user-chevron { transform: rotate(180deg); }
.user-dropdown { position: absolute; top: calc(100% + 8px); right: 0; min-width: 210px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-lg); overflow: hidden; z-index: 300; opacity: 0; transform: translateY(-6px) scale(0.97); pointer-events: none; transition: opacity .18s, transform .18s; }
.user-menu-wrapper.open .user-dropdown { opacity: 1; transform: translateY(0) scale(1); pointer-events: all; }
.dd-user-info { padding: 14px 16px 12px; border-bottom: 1px solid var(--border); }
.dd-user-name { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.dd-user-email { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-item { display: flex; align-items: center; gap: 10px; padding: 12px 16px; min-height: 44px; font-family: 'Sora', sans-serif; font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer; transition: background .15s; border: none; background: none; width: 100%; text-align: left; }
.dd-item:hover { background: var(--surface2); color: var(--text); }
.dd-item svg { width: 15px; height: 15px; color: var(--text-muted); flex-shrink: 0; }
.dd-item.danger { color: var(--danger); }
.dd-item.danger svg { color: var(--danger); }
.dd-item.danger:hover { background: var(--danger-bg); }
.dd-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── APP BODY ── */
.app-body { min-height: calc(100dvh - 56px); display: flex; flex-direction: column; }

/* ── LOGIN ── */
#secao-login { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 16px calc(var(--safe-bottom) + 24px); }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 36px 28px; width: 100%; max-width: 400px; box-shadow: var(--shadow-lg); text-align: center; }
.login-logo-wrap { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 32px; }
.login-logo-icon { width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; }
.login-logo-img { width: 38px; height: 38px; object-fit: contain; }
.login-logo-text { font-size: 20px; font-weight: 700; color: var(--accent); letter-spacing: -0.4px; }
.login-logo-text em { font-style: normal; color: var(--accent-mid); }
.login-heading { font-size: 26px; font-weight: 700; color: var(--text); letter-spacing: -0.6px; margin-bottom: 6px; line-height: 1.2; }
.login-sub { font-size: 14px; color: var(--text-muted); font-weight: 300; margin-bottom: 32px; line-height: 1.6; }
.or-row { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; color: var(--text-muted); font-size: 12px; }
.or-line { flex: 1; height: 1px; background: var(--border); }
.btn-social { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 48px; padding: 12px 16px; background: var(--surface2); border: 1.5px solid var(--border); border-radius: var(--r-md); color: var(--text); font-family: 'Sora', sans-serif; font-size: 14px; font-weight: 500; cursor: pointer; margin-bottom: 10px; transition: border-color .2s, box-shadow .2s, transform .15s; }
.btn-social:hover { border-color: var(--accent); background: var(--surface); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-social:active { transform: scale(0.98); }
.btn-social svg { width: 18px; height: 18px; flex-shrink: 0; }
.login-terms { margin-top: 20px; font-size: 11px; color: var(--text-muted); line-height: 1.6; }
.login-terms a { color: var(--accent-mid); text-decoration: none; font-weight: 600; }

/* Estado de carregamento do login */
.login-loading {
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    padding: 16px 0 4px;
    animation: fadeUp .2s ease;
}
.login-loading p { font-size: 13px; color: var(--text-muted); margin: 0; }
.login-loading-spinner {
    width: 32px; height: 32px; border-radius: 50%;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── GARAGEM ── */
#secao-garagem { flex: 1; padding: 0 0 calc(var(--safe-bottom) + 24px); }
.garagem-header { padding: 20px 16px 16px; }
.garagem-eyebrow { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-muted); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 4px; }
.garagem-titulo { font-size: 24px; font-weight: 700; color: var(--text); letter-spacing: -0.6px; }
#lista-veiculos { display: grid; grid-template-columns: 1fr; gap: 12px; padding: 0 16px; }

.garagem-vazia { grid-column: 1/-1; text-align: center; padding: 48px 24px; }
.garagem-vazia-icon { font-size: 52px; margin-bottom: 16px; }
.garagem-vazia-titulo { font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: -0.4px; margin-bottom: 8px; }
.garagem-vazia-sub { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin-bottom: 24px; max-width: 280px; margin-left: auto; margin-right: auto; }
.garagem-vazia-btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 28px; background: var(--accent); color: #fff; border: none; border-radius: var(--r-pill); font-family: 'Sora', sans-serif; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .2s, transform .15s; }
.garagem-vazia-btn:hover { background: var(--accent-mid); transform: translateY(-1px); }

.vcard { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r-md); padding: 18px; cursor: pointer; display: flex; flex-direction: column; transition: border-color .2s, box-shadow .2s, transform .2s; }
.vcard:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.vcard:active { transform: scale(0.98); }
.vcard-top { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.vcard-icon { width: 48px; height: 48px; background: var(--tag-bg); border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.vcard-info { flex: 1; min-width: 0; }
.vcard-make { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-muted); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 3px; }
.vcard-model { font-size: 17px; font-weight: 700; color: var(--text); letter-spacing: -0.4px; margin-bottom: 6px; }
.vcard-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.vtag { padding: 3px 10px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--r-pill); font-size: 11px; color: var(--text-muted); font-weight: 500; }
.vcard-footer { border-top: 1px solid var(--border); padding-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vcard-actions { display: flex; gap: 6px; }
.btn-diagnosticar { display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; min-height: 40px; background: var(--highlight); color: var(--accent); border: none; border-radius: var(--r-pill); font-family: 'Sora', sans-serif; font-size: 13px; font-weight: 700; cursor: pointer; transition: background .2s, transform .15s; }
.btn-diagnosticar:hover { background: #b8e060; transform: translateY(-1px); }
.btn-diagnosticar:active { transform: scale(0.96); }
.btn-icon-acao { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: transparent; border: 1.5px solid var(--border); color: var(--text-muted); cursor: pointer; transition: background .2s, border-color .2s, color .2s; flex-shrink: 0; }
.btn-icon-acao svg { width: 15px; height: 15px; }
.btn-icon-acao:hover { background: var(--surface2); border-color: var(--accent-mid); color: var(--accent); }
.btn-icon-acao.excluir:hover { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.card-adicionar { background: transparent; border: 1.5px dashed var(--border); border-radius: var(--r-md); padding: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--text-muted); font-size: 13px; font-weight: 500; transition: border-color .2s, color .2s, background .2s; min-height: 64px; }
.card-adicionar:hover { border-color: var(--accent); color: var(--accent); background: var(--tag-bg); }
.garagem-loading { padding: 40px 0; text-align: center; color: var(--text-muted); font-size: 14px; grid-column: 1/-1; }

/* ── CHAT ── */
#secao-chat { flex: 1; display: flex; flex-direction: column; height: calc(100dvh - 56px); max-height: calc(100dvh - 56px); overflow: hidden; position: relative; }
.chat-topbar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px 16px; display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
#btn-voltar { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; min-width: 36px; background: var(--surface2); border: 1.5px solid var(--border); border-radius: var(--r-sm); color: var(--text); font-size: 16px; cursor: pointer; transition: border-color .2s; }
#btn-voltar:hover { border-color: var(--accent); }
.chat-veiculo-info { flex: 1; min-width: 0; }
#chat-nome-carro { font-size: 15px; font-weight: 600; color: var(--text); letter-spacing: -0.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-status { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--accent-mid); font-weight: 500; margin-top: 1px; }
.chat-status-dot { width: 6px; height: 6px; background: #2ecc71; border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

#janela-chat { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 16px; background: var(--chat-bg); display: flex; flex-direction: column; gap: 4px; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
#janela-chat::-webkit-scrollbar { width: 4px; }
#janela-chat::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.balao { max-width: 82%; padding: 11px 14px; border-radius: 16px; font-size: 14px; line-height: 1.6; word-wrap: break-word; box-shadow: var(--shadow-sm); animation: fadeUp .22s ease; }
@keyframes fadeUp { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
.balao-usuario { background: var(--bubble-user); color: #fff; align-self: flex-end; margin-left: 18%; border-bottom-right-radius: 4px; }
.balao-ia { background: var(--surface); color: var(--text); align-self: flex-start; margin-right: 18%; border: 1px solid var(--border); border-bottom-left-radius: 4px; line-height: 1.5; }
.balao-ia strong { color: var(--accent-mid); font-weight: 700; }
.balao-pensando { background: var(--surface2); color: var(--text-muted); align-self: flex-start; border: 1px solid var(--border); border-bottom-left-radius: 4px; font-style: italic; display: flex; align-items: center; gap: 4px; font-size: 13px; }
.dot { animation: blink 1.2s infinite; }
.dot:nth-child(2) { animation-delay: .2s; }
.dot:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,100%{opacity:.2} 50%{opacity:1} }

/* Imagem no balão: cursor pointer indica que é clicável (lightbox) */
.balao-imagem { max-width: 220px; border-radius: 10px; display: block; cursor: pointer; transition: opacity .15s; }
.balao-imagem:hover { opacity: .85; }
.balao-legenda { margin-top: 8px; margin-bottom: 0; }

.chat-msg-wrapper { display: flex; flex-direction: column; margin-bottom: 8px; width: 100%; }
.chat-msg-header { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); display: block; }
.avatar-ini { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; border: 1px solid var(--border); flex-shrink: 0; }
.nome-label { font-size: 11px; font-weight: 500; color: var(--text-muted); letter-spacing: 0.5px; }
.msg-usuario { align-items: flex-end; }
.msg-usuario .chat-msg-header { flex-direction: row-reverse; }
.msg-ia { align-items: flex-start; }

/* ── RODAPÉ DO CHAT ── */
.chat-footer { background: var(--surface); border-top: 1px solid var(--border); flex-shrink: 0; }

/* Preview — no fluxo normal acima do input, sem position:absolute */
#preview-container { padding: 10px 16px 0; display: flex; align-items: flex-end; gap: 12px; }
.preview-balao { position: relative; display: inline-block; background: var(--bubble-user); border-radius: 16px; border-bottom-right-radius: 4px; padding: 6px; max-width: 140px; box-shadow: var(--shadow-sm); }
.preview-balao img { display: block; width: 100%; max-width: 128px; border-radius: 10px; }
.btn-descartar-preview { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%; background: var(--text); color: #fff; border: 2px solid var(--surface); display: flex; align-items: center; justify-content: center; font-size: 13px; line-height: 1; cursor: pointer; transition: background .15s; }
.btn-descartar-preview:hover { background: var(--danger); }
.preview-hint { flex: 1; font-size: 12px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }

/* Linha do input — position:relative para ancorar o .menu-anexo */
.chat-input-row { display: flex; align-items: center; gap: 10px; padding: 10px 16px calc(var(--safe-bottom) + 10px); position: relative; }

.btn-acao-secundaria { width: 44px; height: 44px; min-width: 44px; background: var(--surface2); border: 1.5px solid var(--border); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all .2s; flex-shrink: 0; }
.btn-acao-secundaria svg { width: 22px; height: 22px; stroke-width: 1.8; transition: transform .2s; }
.btn-acao-secundaria.ativo { background: var(--accent-light); border-color: var(--accent); }
.btn-acao-secundaria.ativo svg { transform: rotate(45deg); }

/* Menu flutuante — âncora no .chat-input-row */
.menu-anexo { position: absolute; bottom: calc(100% + 4px); left: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-lg); display: none; flex-direction: column; overflow: hidden; animation: surgir .18s ease-out; z-index: 100; min-width: 200px; }
.menu-anexo.ativo { display: flex; }
@keyframes surgir { from{opacity:0;transform:translateY(8px) scale(.97)} to{opacity:1;transform:none} }
.btn-item-anexo { padding: 14px 18px; border: none; background: none; color: var(--text); font-family: 'Sora', sans-serif; font-size: 14px; display: flex; align-items: center; gap: 12px; cursor: pointer; text-align: left; min-height: 50px; }
.btn-item-anexo:hover { background: var(--surface2); }
.btn-item-anexo:not(:last-child) { border-bottom: 1px solid var(--border); }

#entrada-usuario { flex: 1; min-height: 44px; padding: 10px 14px; background: var(--surface2); border: 1.5px solid var(--border); border-radius: var(--r-pill); font-family: 'Sora', sans-serif; font-size: max(16px, 14px); color: var(--text); outline: none; transition: border-color .2s; }
#entrada-usuario:focus { border-color: var(--accent); background: var(--surface); }
#entrada-usuario::placeholder { color: var(--text-muted); }

#btn-enviar-chat { width: 44px; height: 44px; min-width: 44px; background: var(--accent); border: none; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .2s, transform .15s; }
#btn-enviar-chat:hover { background: var(--accent-mid); }
#btn-enviar-chat:active { transform: scale(0.92); }
#btn-enviar-chat svg { width: 18px; height: 18px; }

/* ── CÂMERA ──
   Controlada por .camera-visivel (classe JS), nunca por style inline.
   .camera-controls: X à esquerda | obturador no centro | espaçador à direita.
   max-width + margin:auto centraliza no desktop.
*/
.camera-overlay { position: fixed; inset: 0; z-index: 9999; background: #000; flex-direction: column; display: none; }
.camera-overlay.camera-visivel { display: flex; }
#video-preview { width: 100%; flex: 1; object-fit: cover; display: block; background: #111; min-height: 0; }
.camera-controls { height: 130px; display: flex; align-items: center; justify-content: space-between; padding: 0 40px calc(var(--safe-bottom) + 24px); background: #000; max-width: 600px; width: 100%; margin: 0 auto; }
.btn-disparador { width: 72px; height: 72px; border-radius: 50%; border: 5px solid #fff; background: rgba(255,255,255,0.2); cursor: pointer; transition: background .15s, transform .15s; flex-shrink: 0; }
.btn-disparador:hover { background: rgba(255,255,255,0.4); }
.btn-disparador:active { background: #fff; transform: scale(0.93); }
.btn-fechar-camera { width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,0.15); border: none; color: #fff; font-size: 22px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s; flex-shrink: 0; }
.btn-fechar-camera:hover { background: rgba(255,255,255,0.35); }
.camera-spacer { width: 44px; height: 44px; flex-shrink: 0; }

/* ── MODAL VEÍCULO ── */
.modal-content { border: none; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); font-family: 'Sora', sans-serif; }
.modal-header { border-bottom: 1px solid var(--border); padding: 18px 20px; }
.modal-title { font-size: 17px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; }
.modal-body { padding: 20px; }
.modal-body .form-label { font-size: 12px; font-weight: 600; color: var(--text-muted); letter-spacing: .5px; text-transform: uppercase; margin-bottom: 6px; }
.modal-body .form-control { min-height: 44px; border: 1.5px solid var(--border); border-radius: var(--r-sm); font-family: 'Sora', sans-serif; font-size: 14px; color: var(--text); background: var(--surface2); transition: border-color .2s; }
.modal-body .form-control:focus { border-color: var(--accent); background: var(--surface); box-shadow: none; }
#form-novo-veiculo .btn-primary { min-height: 48px; background: var(--accent); border-color: var(--accent); border-radius: var(--r-md); font-family: 'Sora', sans-serif; font-size: 14px; font-weight: 600; }
#form-novo-veiculo .btn-primary:hover { background: var(--accent-mid); border-color: var(--accent-mid); }

/* ── SHEET (SOBRE / TERMOS) ── */
.sheet-overlay { position: fixed; inset: 0; z-index: 500; background: rgba(0,0,0,0.45); display: flex; align-items: flex-end; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .25s; }
.sheet-overlay.open { opacity: 1; pointer-events: all; }
.sheet { background: var(--surface); width: 100%; height: 92dvh; border-radius: var(--r-lg) var(--r-lg) 0 0; display: flex; flex-direction: column; transform: translateY(100%); transition: transform .35s cubic-bezier(.33,1,.68,1); overflow: hidden; }
.sheet-overlay.open .sheet { transform: translateY(0); }
.sheet-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.sheet-title { font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; }
.sheet-close { width: 32px; height: 32px; background: var(--surface2); border: 1px solid var(--border); border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--text-muted); transition: background .15s; flex-shrink: 0; }
.sheet-close:hover { background: var(--border); color: var(--text); }
.sheet-iframe { width: 100%; flex: 1; border: none; min-height: 0; }

/* ── CONFIRM CUSTOMIZADO ── */
.confirm-overlay { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.confirm-overlay.open { opacity: 1; pointer-events: all; }
.confirm-box { background: var(--surface); border-radius: var(--r-lg); padding: 28px 24px 20px; width: 100%; max-width: 360px; box-shadow: var(--shadow-lg); transform: scale(0.95); transition: transform .2s; }
.confirm-overlay.open .confirm-box { transform: scale(1); }
.confirm-titulo { font-size: 17px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; margin-bottom: 10px; }
.confirm-texto  { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin-bottom: 24px; }
.confirm-acoes  { display: flex; gap: 10px; justify-content: flex-end; }
.confirm-btn { padding: 10px 20px; min-height: 42px; border: none; border-radius: var(--r-pill); font-family: 'Sora', sans-serif; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .15s, transform .15s; }
.confirm-btn:active { transform: scale(0.97); }
.confirm-btn-cancelar { background: var(--surface2); color: var(--text-muted); border: 1.5px solid var(--border); }
.confirm-btn-cancelar:hover { background: var(--border); }
.confirm-btn-ok { background: var(--accent); color: white; }
.confirm-btn-ok:hover { background: var(--accent-mid); }
.confirm-btn-ok.danger { background: var(--danger); }
.confirm-btn-ok.danger:hover { background: #a93226; }

/* ── LIGHTBOX ── */
.lightbox-overlay { position: fixed; inset: 0; z-index: 3000; background: rgba(0,0,0,0.92); display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .2s; cursor: zoom-out; }
.lightbox-overlay.open { opacity: 1; pointer-events: all; }
.lightbox-img { max-width: min(92vw, 900px); max-height: 88dvh; border-radius: var(--r-md); object-fit: contain; box-shadow: 0 8px 60px rgba(0,0,0,0.6); cursor: default; }
.lightbox-fechar { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.15); border: none; color: white; font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.lightbox-fechar:hover { background: rgba(255,255,255,0.3); }

/* ── RESPONSIVIDADE ── */
@media (min-width: 600px) {
    .login-card { padding: 44px 40px; }
    .garagem-header { padding: 24px 24px 16px; }
    #lista-veiculos { padding: 0 24px; grid-template-columns: repeat(2, 1fr); }
    .chat-topbar { padding: 12px 24px; }
    #janela-chat { padding: 20px 24px; }
    .chat-input-row { padding: 10px 24px calc(var(--safe-bottom) + 10px); }
    #preview-container { padding: 10px 24px 0; }
    .menu-anexo { left: 24px; }
}
@media (min-width: 900px) {
    #lista-veiculos { grid-template-columns: repeat(2, 1fr); }
    .balao { max-width: 68%; }
    #janela-chat { padding: 24px max(10%, 24px); }
    .sheet-overlay { align-items: center; padding: 40px; }
    .sheet { width: 75%; height: 80%; max-width: 860px; border-radius: var(--r-lg); transform: translateY(20px) scale(0.97); }
    .sheet-overlay.open .sheet { transform: translateY(0) scale(1); }
}
@media (min-width: 1200px) {
    #lista-veiculos { grid-template-columns: repeat(3, 1fr); padding: 0 32px; }
    .garagem-header { padding: 32px 32px 20px; }
}
