/* ==========================================================================
   Mútuo · App Shell — Design tokens
   ========================================================================== */
:root {
  --color-primary: #FF6A00;
  --color-primary-dark: #E25A00;
  --color-primary-light: #FFE9D9;
  --color-blue: #2F6FED;
  --color-green: #1FAA5C;
  --color-red: #E4483B;

  --color-bg: #F5F6F8;
  --color-surface: #FFFFFF;
  --color-text: #1B1D21;
  --color-text-muted: #6B7280;
  --color-border: #ECEDF0;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --shadow-card: 0 2px 10px rgba(17, 17, 17, 0.06);
  --shadow-elevated: 0 10px 30px rgba(17, 17, 17, 0.14);

  --font-sans: "Ubuntu", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: #E9EAEE;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; }

/* ==========================================================================
   App shell — full-window layout, no device mockup.
   Responsiveness + touch-friendly controls are what read as "app".
   ========================================================================== */
.app-shell {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
}

@media (min-width: 481px) {
  .app-shell {
    box-shadow: var(--shadow-elevated);
    background: var(--color-bg);
  }
  body {
    background: #E9EAEE;
  }
}

/* Top bar */
.app-topbar {
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 8px 12px;
  background: var(--color-bg);
}
.topbar-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.topbar-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--color-text);
}
.topbar-back { background: var(--color-surface); box-shadow: var(--shadow-card); }
.topbar-spacer { visibility: hidden; }

/* Scrollable content area */
.app-content {
  flex: 1;
  padding: 4px 20px 24px;
}

/* Bottom tab bar */
.tab-bar {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 12px calc(env(safe-area-inset-bottom, 0px) + 8px);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}
.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 18px;
  border-radius: var(--radius-sm);
  transition: color .15s ease;
}
.tab-item.active { color: var(--color-primary); }

/* Honeypot anti-bot: fora da tela, mas presente no DOM (bots que preenchem
   tudo indiscriminadamente acabam denunciando-se). display:none é evitado
   de propósito — alguns bots já ignoram campos display:none. */
.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  height: 0;
  overflow: hidden;
}

/* ==========================================================================
   Login screen
   ========================================================================== */
.login-screen {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding-top: 8vh;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 40px;
}
.brand-logo-img {
  width: 132px;
  height: auto;
  margin-bottom: 6px;
}
.brand-tagline {
  margin: 2px 0 0;
  font-size: 14px;
  color: var(--color-text-muted);
  font-weight: 500;
}

.login-form { display: flex; flex-direction: column; gap: 6px; }

.input-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 6px;
  display: block;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0 14px;
  margin-bottom: 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input-wrap:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-light);
}
.input-wrap--textarea { align-items: flex-start; padding: 12px 14px; }
.input-icon { color: var(--color-text-muted); flex-shrink: 0; margin-right: 10px; }

.input-field {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 16px;
  padding: 14px 0;
  color: var(--color-text);
  font-family: inherit;
  width: 100%;
}
.input-field::placeholder { color: #A6ABB3; }

.select-wrap {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0 14px;
  margin-bottom: 14px;
}
.select-wrap .input-field { padding: 14px 0; appearance: none; background: transparent; }

.form-error {
  color: var(--color-red);
  font-size: 13px;
  font-weight: 600;
  margin: 0 2px 12px;
}

.login-footnote {
  text-align: center;
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: auto;
  padding-top: 30px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  padding: 15px 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .08s ease, opacity .15s ease, background .15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-block { width: 100%; }
.btn-sm { padding: 10px 14px; font-size: 13px; border-radius: var(--radius-sm); }

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 6px 16px rgba(255, 106, 0, 0.28);
}
.btn-primary:hover { background: var(--color-primary-dark); }

.btn-ghost {
  background: transparent;
  color: var(--color-primary);
  margin-top: 8px;
}

.btn-outline {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
}

.btn-disabled,
.btn:disabled {
  background: #E4E5E8;
  color: #A1A5AC;
  box-shadow: none;
  cursor: not-allowed;
}
.btn-disabled:active,
.btn:disabled:active { transform: none; }

.btn-logout { color: var(--color-red); border-color: #F6D3D0; margin-top: 20px; }

.btn-call { background: var(--color-green); box-shadow: 0 6px 16px rgba(31, 170, 92, 0.28); margin-bottom: 24px; }

/* ==========================================================================
   Home / dashboard
   ========================================================================== */
.home-greeting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 2px 18px;
}
.greeting-hello { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.3px; }
.greeting-sub { margin: 2px 0 0; font-size: 13px; color: var(--color-text-muted); }

.avatar-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(255, 106, 0, 0.3);
}
.avatar-btn--lg { width: 72px; height: 72px; font-size: 26px; margin: 0 auto 12px; }

.status-card {
  background: linear-gradient(135deg, #FF7A1A 0%, #FF6A00 55%, #E25A00 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 12px 24px rgba(255, 106, 0, 0.25);
  margin-bottom: 26px;
}
.status-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255,255,255,0.2);
  padding: 5px 10px;
  border-radius: 20px;
}
.status-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; }
.status-plan { font-size: 12px; font-weight: 700; opacity: 0.9; }
.status-vehicle { margin: 0; font-size: 18px; font-weight: 700; }
.status-plate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2px 0 18px;
}
.status-plate { margin: 0; font-size: 13px; opacity: 0.85; letter-spacing: 1px; }
.switch-vehicle-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  color: #fff;
  background: rgba(255,255,255,0.2);
  padding: 5px 10px;
  border-radius: 20px;
}
.status-card-bottom {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid rgba(255,255,255,0.25);
  padding-top: 14px;
}
.status-card-bottom .label { display: block; font-size: 11px; opacity: 0.8; margin-bottom: 2px; }
.status-card-bottom strong { font-size: 15px; }

.section-title {
  font-size: 15px;
  font-weight: 700;
  margin: 4px 2px 12px;
  letter-spacing: -0.2px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
.quick-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-card);
  transition: transform .1s ease;
}
.quick-card:active { transform: scale(0.96); }
.quick-label { font-size: 13.5px; font-weight: 700; line-height: 1.25; }

.quick-card--disabled {
  cursor: not-allowed;
  box-shadow: none;
  background: #F0F1F3;
}
.quick-card--disabled:active { transform: none; }
.quick-card--disabled .quick-label { color: var(--color-text-muted); }

.quick-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.quick-icon--orange { background: #FFE9D9; color: var(--color-primary); }
.quick-icon--blue { background: #E4ECFE; color: var(--color-blue); }
.quick-icon--green { background: #DFF5E7; color: var(--color-green); }
.quick-icon--red { background: #FBE2E0; color: var(--color-red); }
.quick-icon--muted { background: #E4E5E8; color: #A1A5AC; }

/* ==========================================================================
   Lists / cards
   ========================================================================== */
.list-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 20px;
}
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
}
.list-row:last-child { border-bottom: none; }
.list-row--link { justify-content: space-between; }
.list-row-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.list-row-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.list-row-title { font-size: 14px; font-weight: 700; }
.list-row-sub { font-size: 12.5px; color: var(--color-text-muted); }
.list-row-end { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.list-row-end strong { font-size: 14px; }

.row-actions {
  display: flex;
  gap: 8px;
  padding: 0 16px 16px;
  border-bottom: 1px solid var(--color-border);
}
.list-card > .row-actions:last-child { border-bottom: none; }

.tag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
}
.tag--ok { background: #DFF5E7; color: var(--color-green); }
.tag--warn { background: #FFE9D9; color: var(--color-primary-dark); }

.status-badge--warn { background: rgba(255,255,255,0.2); }

/* ==========================================================================
   Seleção de veículo (associados com mais de 1 veículo)
   ========================================================================== */
.select-vehicle-screen { padding-top: 4vh; }
.select-vehicle-intro { margin-bottom: 22px; }
.select-vehicle-intro h1 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.select-vehicle-intro p {
  margin: 0;
  font-size: 13.5px;
  color: var(--color-text-muted);
}

.vehicle-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vehicle-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: transform .08s ease, border-color .15s ease;
}
.vehicle-card:active { transform: scale(0.98); }
.vehicle-card:hover { border-color: var(--color-primary); }

.vehicle-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vehicle-card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.vehicle-card-info strong { font-size: 14.5px; font-weight: 700; }
.vehicle-card-sub { font-size: 12.5px; color: var(--color-text-muted); }

.vehicle-card-arrow { color: var(--color-text-muted); flex-shrink: 0; }

/* ==========================================================================
   Generic page screen
   ========================================================================== */
.page-screen { padding-top: 6px; }
.page-intro { color: var(--color-text-muted); font-size: 13.5px; margin: 0 2px 18px; line-height: 1.5; }

.info-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.info-card .label { font-size: 12px; color: var(--color-text-muted); font-weight: 600; }
.info-card strong { font-size: 14.5px; }

.form { display: flex; flex-direction: column; margin-top: 8px; }

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: var(--color-text);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
  line-height: 1.4;
}
.sos-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #FBE2E0;
  color: var(--color-red);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}
.sos-card strong { display: block; font-size: 14.5px; color: var(--color-text); }
.sos-card p { margin: 2px 0 0; font-size: 12.5px; color: var(--color-text-muted); }

.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 18px 0 26px;
}
.profile-header h2 { margin: 0 0 8px; font-size: 18px; }

/* ==========================================================================
   Modal (bottom sheet e centralizado)
   ========================================================================== */
.modal {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, 0.5);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
}
.modal.open { display: flex; }

.modal-card {
  width: 100%;
  max-width: 480px;
  background: var(--color-surface);
  border-radius: 22px 22px 0 0;
  padding: 24px 22px calc(env(safe-area-inset-bottom, 0px) + 24px);
  animation: modal-up .2s ease;
  max-height: 85vh;
  overflow-y: auto;
}
.modal-card h3 { margin: 0 0 16px; font-size: 17px; text-align: center; }

@keyframes modal-up {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Variante centralizada, usada pelo overlay de carregamento (tela cheia) */
.modal--center {
  align-items: center;
}
.modal--center .loading-card {
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: none;
}
.modal--center .loading-card p {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

/* Spinner */
.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  display: inline-block;
  animation: spin .7s linear infinite;
}
.spinner--lg { width: 42px; height: 42px; border-width: 4px; }
@keyframes spin {
  to { transform: rotate(360deg); }
}

.pix-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 30px 0;
}
.pix-loading .spinner {
  border-color: rgba(255, 106, 0, 0.25);
  border-top-color: var(--color-primary);
}
.pix-loading p { color: var(--color-text-muted); font-size: 13.5px; margin: 0; }

.pix-erro {
  text-align: center;
  padding: 20px 4px;
  color: var(--color-text-muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.pix-resultado { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.pix-qrcode {
  width: 200px;
  height: 200px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: #fff;
  padding: 8px;
}
.pix-copia-cola {
  width: 100%;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 12px;
  font-family: monospace;
  color: var(--color-text-muted);
  resize: none;
  background: var(--color-bg);
}
.pix-copy-feedback {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--color-green);
  min-height: 16px;
  margin: 0;
}

/* ==========================================================================
   Small screens
   ========================================================================== */
@media (max-width: 380px) {
  .app-content { padding-left: 16px; padding-right: 16px; }
}
