/* RESET E BASE */
body { background: #0D1117; color: #fff; font-family: 'DM Sans', sans-serif; margin: 0; padding-bottom: 80px; }

/* ============================
   PÁGINAS DE AUTH (Login / Cadastro)
   ============================ */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; margin-bottom: -80px; }
.auth-card { background: #161B22; border: 0.5px solid #21262D; border-radius: 20px; padding: 32px 24px; width: 100%; max-width: 420px; }
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-titulo { font-size: 26px; color: #4F8EF7; margin: 8px 0 4px; }
.auth-sub { color: #8B949E; font-size: 14px; margin: 0; }
.auth-alert { border-radius: 10px; padding: 12px 16px; font-size: 13px; font-weight: 500; margin-bottom: 16px; }
.auth-alert--error   { background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.3); color: #F87171; }
.auth-alert--success { background: rgba(61,214,140,.1);  border: 1px solid rgba(61,214,140,.3);  color: #3DD68C; }
.auth-footer-link { text-align: center; margin-top: 20px; font-size: 13px; color: #8B949E; }

/* Ícone e olhinho dentro do form-field */
.form-icon { font-size: 15px; flex-shrink: 0; }
.form-eye  { background: none; border: none; cursor: pointer; font-size: 15px; padding: 0; flex-shrink: 0; }

/* Tipo de conta */
.tipo-conta-group { display: flex; gap: 10px; }
.tipo-conta-option { flex: 1; cursor: pointer; }
.tipo-conta-option input { display: none; }
.tipo-conta-card { background: #0D1117; border: 1px solid #21262D; border-radius: 12px; padding: 12px; display: flex; align-items: center; gap: 10px; transition: .15s; }
.tipo-conta-card.selected { border-color: #4F8EF7; background: rgba(79,142,247,.08); }
.tipo-icon { font-size: 22px; }
.tipo-nome { font-size: 13px; font-weight: 600; color: #fff; }
.tipo-desc { font-size: 11px; color: #8B949E; margin-top: 2px; }
* { box-sizing: border-box; }
a { color: #4F8EF7; text-decoration: none; }
h1, h2, h3, h4, .section-title { font-family: 'Sora', sans-serif; margin: 0 0 12px; }

/* BOTTOM NAV BAR (mobile) */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; height: 64px; background: #161B22; border-top: 0.5px solid #21262D; display: flex; z-index: 100; align-items: center; justify-content: space-around; }
.bottom-nav__item { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; color: #8B949E; font-size: 11px; gap: 4px; }
.bottom-nav__item.active { color: #4F8EF7; }

/* CHIPS DE FILTRO */
.filtros-chips { display: flex; gap: 8px; overflow-x: auto; padding: 16px; scrollbar-width: none; }
.filtros-chips::-webkit-scrollbar { display: none; }
.chip { background: #21262D; color: #8B949E; border-radius: 20px; padding: 6px 14px; font-size: 12px; white-space: nowrap; cursor: pointer; border: none; outline: none; transition: 0.2s; }
.chip.active { background: #4F8EF7; color: #fff; }

/* CARD DE CARONA */
.carona-card { background: #161B22; border-radius: 12px; padding: 14px; margin: 0 16px 12px; border: 0.5px solid #21262D; cursor: pointer; display: flex; flex-direction: column; gap: 10px; animation: slideUp 0.3s ease forwards; }
.carona-card__header { display: flex; gap: 10px; align-items: center; }
.carona-card__avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #4F8EF7, #A78BFA); display: flex; align-items: center; justify-content: center; font-weight: bold; color: white; font-size: 14px; }
.carona-card__info { flex: 1; }
.carona-card__nome { color: #fff; font-size: 14px; font-weight: 500; }
.carona-card__rota { color: #8B949E; font-size: 12px; margin-top: 2px; }
.carona-card__estrelas { color: #F59E0B; font-size: 11px; margin-top: 2px; }
.carona-card__preco-wrap { text-align: right; }
.carona-card__preco { color: #3DD68C; font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.carona-card__vagas { color: #8B949E; font-size: 11px; }

/* BADGES */
.badge { display: inline-block; font-size: 10px; padding: 2px 8px; border-radius: 20px; margin-left: 4px; }
.badge--verde { background: rgba(61,214,140,.15); color: #3DD68C; }
.badge--azul { background: rgba(79,142,247,.15); color: #4F8EF7; }
.badge--laranja { background: rgba(249,115,22,.15); color: #F97316; }
.badge--roxo { background: rgba(139,92,246,.15); color: #A78BFA; }

/* PAINEL IA / BOTÕES */
.painel-ia { background: #0D2137; border: 1px solid #1D4ED8; border-radius: 12px; padding: 14px; margin: 12px 16px; }
.painel-ia__titulo { color: #4F8EF7; font-size: 12px; font-weight: 600; margin-bottom: 8px; }
.painel-ia__linha { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; }
.painel-ia__label { color: #8B949E; }
.painel-ia__valor { color: #fff; font-weight: 500; }
.painel-ia__destaque { color: #3DD68C; font-size: 16px; font-weight: 700; }

.btn-primary { background: #4F8EF7; color: #fff; border-radius: 12px; border: none; padding: 14px 20px; font-size: 15px; font-weight: 600; width: 100%; cursor: pointer; transition: 0.2s; }
.btn-primary:active { background: #3B72C8; }
.btn-ghost { background: transparent; border: 0.5px solid #21262D; color: #fff; border-radius: 12px; padding: 14px 20px; font-size: 14px; font-weight:500; cursor: pointer; }
.btn-primary:disabled { opacity: 0.5; }

/* FORMULÁRIOS E CHATBOT */
.form-field { background: #161B22; border: 0.5px solid #21262D; border-radius: 10px; padding: 14px 12px; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; width: 100%; }
.form-field input, .form-field select { background: transparent; border: none; color: #fff; font-size: 14px; flex: 1; outline: none; }

/* Controles nativos — adaptar ao tema escuro */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { filter: invert(0.6); opacity: 0.7; }
input[type="datetime-local"]::-webkit-calendar-picker-indicator { filter: invert(0.6); cursor: pointer; }
input[type="checkbox"] { accent-color: #4F8EF7; width: 16px; height: 16px; cursor: pointer; }
select option { background: #161B22; color: #fff; }

.chatbot-container { display: flex; flex-direction: column; gap: 16px; padding: 16px; }
.chatbot-bubble { max-width: 85%; padding: 12px 16px; border-radius: 14px; font-size: 14px; line-height: 1.4; animation: slideUp 0.3s ease; position: relative; }
.chatbot-bubble.bot { background: #161B22; color: #fff; align-self: flex-start; border-bottom-left-radius: 4px; }
.chatbot-bubble.user { background: #4F8EF7; color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }

.chatbot-input-area { background: #161B22; border-top: 0.5px solid #21262D; padding: 16px; display: flex; gap: 8px; position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; }
.chatbot-input-area input { flex:1; background: #0D1117; border: 1px solid #21262D; color: #fff; border-radius: 20px; padding: 10px 16px; outline: none; font-size: 14px; }
.chatbot-btn { background: #4F8EF7; width: 40px; height: 40px; border-radius: 50%; color: #fff; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; }

/* ANIMAÇÕES & OUTROS */
@keyframes slideUp { from { transform: translateY(15px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); background: #161B22; border: 0.5px solid #21262D; padding: 12px 20px; border-radius: 10px; z-index: 1000; font-size: 13px; font-weight: 500; animation: slideUp 0.3s; }
.toast--success { border-color: #3DD68C; color: #3DD68C; }
.toast--error { border-color: #F87171; color: #F87171; }
.header-top { display: flex; align-items: center; padding: 16px; background: #161B22; border-bottom: 0.5px solid #21262D; position: sticky; top:0; z-index:10; }
.header-top h1 { margin: 0; font-size: 18px; flex: 1; text-align: center; }

/* TOP NAV (desktop only) */
.top-nav { display: none; }

@media (min-width: 768px) {
  .bottom-nav { display: none; }
  body { padding-bottom: 0; }
  .carona-card { max-width: 500px; margin: 0 auto 12px; }
  .chatbot-input-area { max-width: 600px; left: 50%; transform: translateX(-50%); border-radius: 12px 12px 0 0; }

  .top-nav { display: flex; align-items: center; justify-content: space-between; padding: 0 24px; height: 60px; background: #161B22; border-bottom: 0.5px solid #21262D; position: sticky; top: 0; z-index: 50; }
  .top-nav__logo { color: #4F8EF7; font-family: 'Sora', sans-serif; font-weight: 700; font-size: 18px; text-decoration: none; }
  .top-nav__links { display: flex; gap: 4px; align-items: center; }
  .top-nav__link { color: #8B949E; font-size: 14px; font-weight: 500; padding: 8px 14px; border-radius: 8px; text-decoration: none; transition: 0.15s; }
  .top-nav__link:hover { color: #fff; background: #21262D; }
  .top-nav__link.active { color: #4F8EF7; }
  .top-nav__publicar { color: #3DD68C !important; border: 1px solid rgba(61,214,140,.3); }
  .top-nav__publicar:hover { background: rgba(61,214,140,.1) !important; }

  .header-top { display: none; }
  .filtros-chips { max-width: 560px; margin: 0 auto; }
  #lista-caronas { max-width: 560px; margin: 0 auto; }
}

/* ============================
   MODAL NOVA CARONA
   ============================ */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.75); z-index: 300; display: flex; align-items: flex-end; justify-content: center; animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUpModal { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* Handle "gota" — pill puxador no topo do bottom sheet */
.modal-handle { width: 40px; height: 4px; background: #30363D; border-radius: 4px; margin: 10px auto 0; flex-shrink: 0; }

.modal-container { background: #161B22; border-radius: 24px 24px 0 0; width: 100%; max-width: 600px; max-height: 92vh; display: flex; flex-direction: column; animation: slideUpModal .28s cubic-bezier(.32,.72,0,1); }

.modal-header { position: relative; padding: 14px 16px 12px; border-bottom: 0.5px solid #21262D; flex-shrink: 0; }
.modal-close-btn { position: absolute; top: 12px; right: 14px; background: #21262D; border: none; color: #8B949E; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.modal-close-btn:hover { color: #fff; }
.modal-title { margin: 0 0 12px; font-size: 16px; text-align: center; }
.modal-toggle-group { display: flex; gap: 8px; justify-content: center; }
.modal-toggle-btn { background: #21262D; border: none; color: #8B949E; border-radius: 20px; padding: 6px 18px; font-size: 13px; cursor: pointer; transition: .15s; }
.modal-toggle-btn.active { background: #4F8EF7; color: #fff; }

.modal-body { flex: 1; overflow-y: auto; min-height: 0; }

.modal-chat-input-wrap { background: #161B22; border-top: 0.5px solid #21262D; padding: 12px 16px; display: flex; gap: 8px; flex-shrink: 0; }
.modal-chat-input { flex: 1; background: #0D1117; border: 1px solid #21262D; color: #fff; border-radius: 20px; padding: 10px 16px; outline: none; font-size: 14px; }

/* FORM nova carona */
.form-group { margin-bottom: 12px; }
.form-label { display: block; font-size: 12px; color: #8B949E; margin-bottom: 6px; font-weight: 500; }
.form-row { display: flex; gap: 10px; }
@media (max-width: 380px) { .form-row { flex-direction: column; gap: 0; } }
.calc-section { background: #0D1117; border: 0.5px solid #21262D; border-radius: 10px; padding: 12px; margin-bottom: 14px; }
.calc-section-header { display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-size: 13px; color: #4F8EF7; font-weight: 500; }

/* ============================
   CONVERSATIONS (Chat page)
   ============================ */
.chat-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 24px; text-align: center; }
.chat-section-label { font-size: 11px; font-weight: 600; color: #8B949E; text-transform: uppercase; letter-spacing: .5px; padding: 12px 16px 4px; }
.conversa-card { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 0.5px solid #21262D; cursor: pointer; transition: .15s; }
.conversa-card:hover { background: #21262D; }
.conversa-avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg,#4F8EF7,#A78BFA); display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; font-size: 15px; flex-shrink: 0; }
.conversa-info { flex: 1; min-width: 0; }
.conversa-nome { font-size: 14px; font-weight: 600; color: #fff; margin-bottom: 3px; }
.conversa-rota { font-size: 12px; color: #8B949E; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversa-hora { font-size: 11px; color: #4F8EF7; margin-top: 2px; }
.conversa-preco { text-align: right; font-size: 13px; font-weight: 700; color: #3DD68C; flex-shrink: 0; }

@media (min-width: 768px) {
  .modal-overlay { align-items: center; }
  .modal-container { border-radius: 16px; max-height: 82vh; animation: fadeIn .2s ease; }
  .modal-handle { display: none; }
  .conversa-card { max-width: 600px; margin: 0 auto; border-radius: 10px; border: 0.5px solid #21262D; margin-bottom: 6px; }
  .chat-section-label { max-width: 600px; margin: 0 auto; }
  #modal-form-mode { max-width: 600px; margin: 0 auto; }
}

/* ============================
   CADASTRO MOTORISTA — seções
   ============================ */
.motorista-secao { background: #0D1117; border: 0.5px solid #21262D; border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.motorista-secao-titulo { font-size: 13px; font-weight: 600; color: #4F8EF7; margin-bottom: 14px; letter-spacing: .3px; }

/* ============================
   BOTÃO RESERVAR no card de lista
   ============================ */
.btn-reservar-card { display: block; width: 100%; background: #3DD68C; color: #0D1117; border: none; border-radius: 10px; padding: 11px 14px; font-size: 13px; font-weight: 700; cursor: pointer; margin-top: 10px; transition: background 0.15s; }
.btn-reservar-card:hover  { background: #2cbe7b; }
.btn-reservar-card:active { background: #25a368; }
.btn-reservar-card:disabled { opacity: 0.5; cursor: default; }

/* Badge "Sua carona" no card */
.badge-dono { display: block; text-align: center; font-size: 11px; color: #4F8EF7; background: rgba(79,142,247,.1); border-radius: 8px; padding: 6px; margin-top: 8px; font-weight: 600; }

/* ============================
   BADGE STATUS VERMELHO
   ============================ */
.badge--vermelho { background: rgba(248,113,113,.15); color: #F87171; }

/* ============================
   DASHBOARD STAT CARDS
   ============================ */
.stat-card { background: #161B22; border: 0.5px solid #21262D; border-radius: 12px; padding: 12px 16px; flex-shrink: 0; min-width: 100px; }
.stat-card__label { font-size: 11px; color: #8B949E; margin-bottom: 4px; white-space: nowrap; }
.stat-card__value { font-size: 18px; font-weight: 700; color: #fff; }
.stat-card__value--green { color: #3DD68C; }

/* ============================
   FINANCIAL CARDS
   ============================ */
.fin-card { background: #161B22; border: 0.5px solid #21262D; border-radius: 12px; padding: 14px 16px; cursor: pointer; transition: border-color .15s; }
a.fin-card:hover { border-color: #4F8EF7; }
.fin-card__label { font-size: 12px; color: #8B949E; margin-bottom: 4px; }
.fin-card__value { font-size: 20px; font-weight: 700; color: #fff; }
.fin-card__value--green { color: #3DD68C; }
.fin-card__value--orange { color: #F97316; }

/* ============================
   CHAT PANEL (full screen slide-in)
   ============================ */
.chat-panel {
    position: fixed;
    inset: 0;
    background: #0D1117;
    z-index: 500;
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.25s ease;
}
@keyframes slideInRight {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}
.chat-panel__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #161B22;
    border-bottom: 0.5px solid #21262D;
    flex-shrink: 0;
}
.chat-panel__back {
    background: #21262D;
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.chat-panel__tabs {
    display: flex;
    gap: 0;
    border-bottom: 0.5px solid #21262D;
    flex-shrink: 0;
}
.chat-tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    color: #8B949E;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: .15s;
}
.chat-tab.active {
    color: #4F8EF7;
    border-bottom-color: #4F8EF7;
}
.chat-panel__mensagens {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.chat-panel__input {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: #161B22;
    border-top: 0.5px solid #21262D;
    flex-shrink: 0;
}
.chat-panel__send-btn {
    background: #4F8EF7;
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Chat messages */
.chat-msg { display: flex; flex-direction: column; max-width: 80%; }
.chat-msg--mine  { align-self: flex-end; align-items: flex-end; }
.chat-msg--other { align-self: flex-start; align-items: flex-start; }
.chat-msg__autor { font-size: 11px; color: #8B949E; margin-bottom: 3px; }
.chat-msg__bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
}
.chat-msg--mine  .chat-msg__bubble { background: #4F8EF7; color: #fff; border-bottom-right-radius: 4px; }
.chat-msg--other .chat-msg__bubble { background: #161B22; color: #fff; border-bottom-left-radius: 4px; }
.chat-msg__meta { font-size: 10px; color: #8B949E; margin-top: 3px; }

/* Chat unread badge on conversation avatar */
.chat-unread-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #F87171;
    color: #fff;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    min-width: 16px;
    text-align: center;
    border: 1.5px solid #0D1117;
}

/* Nav badge for chat */
.nav-badge-chat {
    background: #F87171;
    color: #fff;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 4px;
    margin-left: 2px;
    vertical-align: middle;
    line-height: 1;
}

/* ============================
   RATING MODAL STARS
   ============================ */
.star-btn { transition: color .15s, transform .1s; }
.star-btn:hover { transform: scale(1.15); }
.star-btn:focus { outline: none; }

/* ============================
   PASSENGER MANAGEMENT CARDS
   ============================ */
.passageiro-card {
    background: #161B22;
    border: 0.5px solid #21262D;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
}

/* ============================
   PROFILE STATS GRID
   ============================ */
@media (max-width: 767px) {
    .stat-card { min-width: 90px; }
    .fin-card__value { font-size: 18px; }
}

@media (min-width: 768px) {
    .chat-panel { max-width: 480px; right: 0; left: auto; border-left: 0.5px solid #21262D; }
    .fin-card { padding: 16px 20px; }
}
