@charset "UTF-8";

:root {
  color-scheme: light;
  --blue: #005ca8;
  --blue-dark: #004b8a;
  --graphite: #202121;
  --muted: #626970;
  --line: #e4e8eb;
  --soft: #f7f9fa;
  --blue-soft: #f0f6fb;
  --success: #247453;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  font-synthesis: none;
  color: var(--graphite);
  background: #fff;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
a { color: inherit; }
img { display: block; max-width: 100%; }
svg { flex-shrink: 0; vertical-align: middle; }
h1, h2, h3, p, dl, dd { margin: 0; }
[hidden] { display: none !important; }
::selection { background: #d9eafb; color: var(--graphite); }
:focus-visible { outline: 3px solid #7db4e0; outline-offset: 5px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; z-index: 5; top: -100px; left: 20px; background: var(--blue); color: white; padding: 12px 20px; border-radius: 6px; }
.skip-link:focus { top: 12px; }

.site-header { border-bottom: 1px solid #edf0f2; }
.header-inner { max-width: 1160px; margin: auto; min-height: 88px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.logo { height: auto; object-fit: contain; }
.logo--detran { width: 180px; }
.logo--caieiras { width: 210px; }
.header-caption { color: #72787d; font-size: .8125rem; text-align: center; line-height: 1.7; }
.header-caption span { display: block; color: #848b90; font-size: .75rem; letter-spacing: .07em; }

main { padding: 0 20px; }
.consultation { max-width: 704px; margin: 32px auto 0; scroll-margin-top: 16px; }
.intro { margin-bottom: 20px; }
.eyebrow, .section-label { color: var(--blue); font-weight: 600; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow { margin-bottom: 6px; }
h1 { font-size: clamp(1.75rem, 3vw, 2rem); font-weight: 550; letter-spacing: -.036em; line-height: 1.2; }
.intro-description { color: var(--muted); max-width: 560px; margin-top: 10px; font-size: 1rem; line-height: 1.5; }
.consultation-card { border: 1px solid var(--line); border-radius: 12px; padding: 24px; background: #fff; }
.form-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 16px; }
.field { min-width: 0; }
.field label { display: block; color: #4a5157; font-size: .875rem; font-weight: 600; margin-bottom: 6px; }
.field input { appearance: none; -webkit-appearance: none; width: 100%; max-width: 100%; min-width: 0; height: 54px; background: #fff; border: 1px solid #d5dce1; border-radius: 6px; color: var(--graphite); padding: 12px 15px; line-height: 1.5; transition: border-color 200ms, box-shadow 200ms; }
.field input::placeholder { color: #90979d; opacity: 1; }
#plate { text-transform: uppercase; letter-spacing: .11em; }
.field input[type="date"] { letter-spacing: .015em; }
.field input::-webkit-date-and-time-value { text-align: left; }
.field input::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .6; }
.field input:hover { border-color: #a7b6c2; }
.field input:focus { border-color: var(--blue); outline: 0; box-shadow: 0 0 0 3px #005ca814; }
.field input[aria-invalid="true"] { border-color: #b73f39; }
.field-error { color: #a8342f; font-size: .8125rem; line-height: 1.45; margin-top: 7px; }
.field-error:empty { display: none; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 48px; padding: 12px 22px; border: 1px solid transparent; border-radius: 6px; font-size: .9375rem; line-height: 1.4; font-weight: 600; text-decoration: none; transition: background-color 200ms, border-color 200ms, color 200ms; }
.button--primary { color: #fff; background: var(--blue); }
.button--primary:hover { background: var(--blue-dark); }
.button--secondary { color: #4e575e; background: #fff; border-color: #dbe1e5; }
.button--secondary:hover { background: var(--soft); border-color: #aebdc8; }
.button--text { background: transparent; color: var(--blue); padding: 10px 0 10px 12px; font-weight: 500; }
.button--text:hover { color: var(--blue-dark); text-decoration: underline; text-underline-offset: 4px; }
.query-form > .button { width: 100%; justify-content: space-between; padding-left: 20px; padding-right: 20px; height: 52px; }
.form-note { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 12px; font-size: .75rem; color: #727b82; line-height: 1.5; }
.form-note .icon { width: 15px; height: 15px; }

.consultation--active { margin-top: 24px; }
.consultation--active .intro { margin-bottom: 14px; }
.consultation--active .eyebrow, .consultation--active .intro-description { display: none; }
.consultation--active h1 { font-size: 1.375rem; }
.consultation-card:not([data-state="initial"]) { padding: 0; overflow: hidden; }
#chat-panel { display: flex; flex-direction: column; max-height: min(560px, calc(100vh - 32px)); max-height: min(560px, calc(100dvh - 32px)); }
.chat-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 18px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.chat-header > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.chat-header .icon { color: var(--blue); }
.chat-header h2 { font-size: .875rem; font-weight: 600; line-height: 1.3; }
.chat-header .button { padding: 8px 0 8px 8px; min-height: 40px; font-size: .875rem; flex-shrink: 0; }
#conversation { display: flex; flex-direction: column; gap: 10px; min-height: 0; padding: 16px 18px; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: thin; scrollbar-color: #bdcbd6 transparent; overflow-anchor: none; }
#conversation:focus-visible { outline-offset: -4px; }
#conversation > div { flex-shrink: 0; min-width: 0; }
#decision-panel:empty, #reply-panel:empty, #calculation-panel:empty { display: none; }
#reply-panel { display: flex; flex-direction: column; gap: 10px; }
.chat-message { width: fit-content; max-width: 92%; padding: 10px 14px; border-radius: 2px 14px 14px; background: var(--soft); border: 1px solid var(--line); font-size: 1rem; line-height: 1.4; overflow-wrap: anywhere; }
.chat-message--user { margin-left: auto; color: #fff; background: var(--blue); border-color: var(--blue); border-radius: 14px 2px 14px 14px; }
.chat-message--assistant:has(.estimate) { width: 100%; }
.message-author { display: block; font-size: .75rem; font-weight: 600; color: var(--muted); margin-bottom: 3px; }
.chat-message--user .message-author { color: #e1effb; }
.query-date { margin-top: 3px; font-size: .875rem; }
.query-date strong { font-weight: 600; }
.plate-value { letter-spacing: .055em; white-space: nowrap; }
.lookup-status { display: flex; align-items: center; gap: 8px; }
.lookup-status:focus { outline: none; }
.lookup-status.searching { color: var(--muted); }
.lookup-status.found .icon { color: var(--success); width: 18px; height: 18px; }
.loading-dots { display: flex; gap: 4px; padding: 0 4px; }
.loading-dots i { width: 5px; height: 5px; background: var(--blue); border-radius: 50%; animation: breathe 1.2s ease-in-out infinite; }
.loading-dots i:nth-child(2) { animation-delay: 150ms; }
.loading-dots i:nth-child(3) { animation-delay: 300ms; }
.lookup-status strong { font-weight: 600; }
.estimate { margin-top: 4px; }
.estimate-intro { margin-bottom: 8px; }
.cost-list { border-top: 1px solid var(--line); }
.cost-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cost-row dt { font-size: 1rem; font-weight: 550; }
.cost-row dd { font-size: 1rem; font-weight: 550; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cost-detail { display: block; font-size: .875rem; font-weight: 400; color: var(--muted); margin-top: 1px; }
.total-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; padding: 10px 12px; margin-top: 8px; border-radius: 7px; background: #e7f0f8; }
.total-row dt { color: var(--blue); font-size: .875rem; font-weight: 600; }
.total-row dt span { display: block; color: #526d82; font-size: .75rem; font-weight: 400; margin-top: 1px; }
.total-row dd { color: var(--blue); font-size: clamp(1.25rem, 3vw, 1.5rem); font-weight: 650; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.25; }
.confirmation h2, .finished h2 { font-size: 1rem; line-height: 1.4; font-weight: 550; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.actions .button { min-height: 44px; padding: 9px 14px; font-size: .875rem; gap: 8px; }
.finished h2:focus { outline: none; }
.finished p { color: var(--muted); font-size: 1rem; margin-top: 6px; line-height: 1.4; }

.yard-section { max-width: 1120px; margin: 96px auto 80px; padding-top: 30px; border-top: 1px solid var(--line); }
.yard-section > .section-label { display: flex; align-items: center; gap: 8px; margin-bottom: 22px; color: #70777d; font-size: .6875rem; }
.yard-section > .section-label .icon { width: 16px; height: 16px; }
.map-container { width: 100%; height: 390px; background: #f0f3f4; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.map-container iframe { border: 0; display: block; width: 100%; height: 100%; }
.map-fallback { height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px; padding: 24px; text-align: center; color: var(--muted); }
.map-fallback span { font-size: .875rem; }
.yard-info { padding-top: 32px; }
.yard-heading .section-label { color: #70777d; font-size: .6875rem; }
.yard-heading h2 { font-size: 1.5rem; line-height: 1.4; font-weight: 550; letter-spacing: -.025em; margin-top: 9px; }
.yard-heading p { font-size: .875rem; color: var(--muted); margin-top: 6px; }
.contact-grid { display: grid; grid-template-columns: 1.45fr 1fr; gap: 48px; margin-top: 30px; }
.contact-item { display: flex; gap: 15px; }
.contact-item > .icon { color: var(--blue); margin-top: 2px; }
.contact-item + .contact-item { padding-left: 36px; border-left: 1px solid var(--line); }
.contact-item h3 { font-size: .8125rem; font-weight: 600; color: var(--muted); margin-bottom: 7px; }
.contact-item address { font-style: normal; font-size: .9375rem; line-height: 1.75; }
.phone-number { font-size: 1.125rem; letter-spacing: -.01em; }
.text-link { display: inline-flex; align-items: center; gap: 8px; color: var(--blue); min-height: 44px; font-size: .875rem; text-decoration: none; font-weight: 600; margin-top: 6px; }
.text-link .icon { width: 16px; height: 16px; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.site-footer { background: var(--graphite); color: #bfc3c5; }
.footer-inner { max-width: 1160px; margin: auto; min-height: 92px; padding: 26px 20px; display: flex; align-items: center; justify-content: space-between; gap: 24px; font-size: .75rem; }
.footer-inner > span { color: #e5e7e8; }
.footer-separator { display: inline-block; margin: 0 10px; color: #777f83; }

.enter { animation: enter 320ms ease-out both; }
@keyframes enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes breathe { 0%, 65%, 100% { opacity: .3; } 30% { opacity: 1; } }

@media (max-width: 760px) {
  .header-inner { min-height: 80px; }
  .header-caption { display: none; }
  .consultation { margin-top: 24px; }
  .yard-section { margin-top: 64px; margin-bottom: 48px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 6px; }
}
@media (max-width: 520px) {
  main { padding: 0 18px; }
  .header-inner { min-height: 72px; padding: 16px 18px; gap: 22px; }
  .logo--detran { width: 132px; max-width: 43%; }
  .logo--caieiras { width: 158px; max-width: 49%; }
  .consultation { margin-top: 20px; }
  .intro { margin-bottom: 16px; }
  h1 { font-size: 1.75rem; }
  .intro-description { margin-top: 8px; }
  .consultation-card { padding: 18px; border-radius: 10px; }
  .form-fields { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .field label { font-size: .875rem; }
  .field input { height: 48px; }
  .form-note { align-items: flex-start; text-align: left; justify-content: flex-start; }
  .form-note .icon { margin-top: 3px; }
  .chat-header { padding: 8px 12px; gap: 8px; }
  .chat-header > div > .icon { display: none; }
  #conversation { padding: 12px; gap: 8px; }
  #reply-panel { gap: 8px; }
  .chat-message { max-width: 96%; padding: 9px 11px; }
  .total-row { padding: 8px 10px; }
  .actions .button { flex: 1 1 auto; }
  .map-container { height: 280px; border-radius: 8px; }
  .yard-section { padding-top: 24px; }
  .yard-info { padding-top: 26px; }
  .yard-heading h2 { font-size: 1.375rem; }
  .contact-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .contact-item + .contact-item { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; padding-top: 24px; }
  .contact-item { gap: 12px; }
  .footer-inner { padding: 26px 18px; }
}
@media (max-width: 350px) {
  main { padding: 0 12px; }
  .consultation-card { padding: 16px; }
  .chat-header { flex-wrap: wrap; gap: 0 8px; }
  #conversation { padding: 10px; }
  .chat-message { max-width: 100%; }
  .cost-row { gap: 8px; }
  .cost-row { flex-wrap: wrap; }
}
@media (max-height: 700px) and (min-width: 521px) {
  .consultation { margin-top: 20px; }
  .intro { margin-bottom: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
/* Pagamento dentro da conversa, sem deslocar o layout em telas pequenas. */
.pix-code { width: 100%; box-sizing: border-box; resize: vertical; margin: 8px 0 12px; padding: 12px; font: inherit; overflow-wrap: anywhere; border: 1px solid #aebcca; border-radius: 8px; }
.pix-qrcode { width: min(100%, 280px); margin: 16px auto; background: #fff; }
.pix-qrcode svg { display: block; width: 100%; height: auto; }
#payer-form .field { margin: 12px 0; }
#payment-error { color: #a51d2d; }
.payment-note { margin-top: 16px; font-size: .875rem; }
button:disabled { opacity: .6; cursor: wait; }
/* Atendimento fixo com espaço para as áreas seguras do celular. */
.whatsapp-float { position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); z-index: 100; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: #128c46; color: #fff; box-shadow: 0 4px 16px #0003; }
.whatsapp-float .icon { width: 32px; height: 32px; }
.whatsapp-float:hover, .button--whatsapp:hover { background: #096d34; color: #fff; }
.whatsapp-float:focus-visible { outline: 3px solid #162e51; outline-offset: 4px; }
.button.button--whatsapp { background: #128c46; color: #fff; text-decoration: none; }
body .site-footer { padding-bottom: 90px; }
