:root {
  --bg: #F7F3FE;
  --ink: #3A2E5C;
  --muted: #7C6F9B;
  --lilac: #9B87F5;
  --lilac-deep: #7C5CE0;
  --lilac-tint: #F1EBFC;
  --lilac-tint-2: #EAE1FB;
  --peach: #FFE3D1;
  --mint: #CFF3DE;
  --mint-ink: #2F8F5B;
  --blue: #DCEBFF;
  --blue-ink: #1A5CAD;
  --line: #E7DFF7;
  --card-shadow: 0 8px 24px rgba(124, 92, 224, 0.08);
  --card-shadow-hover: 0 12px 32px rgba(124, 92, 224, 0.14);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Nunito Sans', sans-serif;
}

body {
  background-color: var(--bg);
  color: var(--ink);
}

header {
  background: linear-gradient(160deg, #A78BFA, var(--lilac-deep));
  color: white;
  text-align: center;
  padding: 20px 20px 44px;
}

header h1 {
  font-family: 'Quicksand', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 10px;
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

header p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 1rem;
}

.busca {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px;
  background-color: white;
  max-width: 900px;
  margin: -30px auto 0;
  border-radius: 20px;
  box-shadow: var(--card-shadow-hover);
  position: relative;
  z-index: 2;
}

.busca input {
  padding: 14px 16px;
  border: none;
  background: #FBF9FF;
  border-radius: 14px;
  font-size: 0.95rem;
  width: 220px;
  color: var(--ink);
}

.busca input::placeholder {
  color: #B3A8D1;
}

.busca button {
  padding: 14px 28px;
  background-color: var(--lilac-deep);
  color: white;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  font-size: 0.95rem;
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
}

.busca button:hover {
  background-color: #6A47CC;
}

main {
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card-profissional {
  background-color: white;
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.2s;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.card-profissional:hover {
  box-shadow: var(--card-shadow-hover);
}

.card-esquerda {
  display: flex;
  gap: 15px;
  flex: 1;
  min-width: 260px;
}

.foto {
  width: 96px;
  height: 96px;
  min-width: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--lilac-tint);
}

.card-info h3 {
  font-family: 'Quicksand', sans-serif;
  color: var(--ink);
  font-weight: 700;
  margin-bottom: 3px;
}

.card-info .especialidade {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.card-info .nota {
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.opinioes {
  color: var(--muted);
}

.card-detalhes {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.tag {
  background-color: var(--mint);
  color: var(--mint-ink);
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
}

.tag.tele {
  background-color: var(--blue);
  color: var(--blue-ink);
}

.card-endereco {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  margin-top: 5px;
}

.local-nome {
  font-weight: bold;
  font-size: 0.85rem;
  color: var(--ink);
}

.endereco-texto {
  font-size: 0.8rem;
  color: var(--muted);
}

.card-agenda {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1.4;
  min-width: 280px;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 0 15px;
}

.card-agenda-wrapper {
  flex: 1.4;
  min-width: 280px;
}

.agenda-endereco {
  display: none;
}

.agenda-endereco.visivel {
  display: flex;
}

.dia-coluna {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  min-width: 60px;
}

.dia-cabecalho {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 4px;
  line-height: 1.3;
}

.horario-btn {
  background-color: var(--lilac-tint);
  color: var(--lilac-deep);
  border: 1px solid var(--lilac-tint-2);
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 0.8rem;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
  min-width: 55px;
  transition: all 0.15s;
}

.horario-btn:hover {
  background-color: var(--lilac-deep);
  color: white;
}

.horario-btn.selecionado {
  background-color: var(--lilac-deep);
  color: white;
  border-color: var(--lilac-deep);
  box-shadow: 0 0 0 2px var(--lilac-tint-2);
}

.horario-vazio {
  color: #D8CFEE;
  font-size: 0.9rem;
  text-align: center;
}

.card-rodape {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  min-width: 150px;
}

.preco {
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--ink);
}

.selecao-texto {
  font-size: 0.8rem;
  color: var(--lilac-deep);
  font-weight: bold;
  min-height: 16px;
}

.btn-agendar {
  background-color: var(--lilac-deep);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 0.95rem;
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  white-space: nowrap;
}

.btn-agendar:hover {
  background-color: #6A47CC;
}

.btn-agendar:disabled {
  background-color: #E4DCF5;
  color: #B3A8D1;
  cursor: not-allowed;
}

.sem-resultado {
  text-align: center;
  color: var(--muted);
  padding: 30px;
}

@media (max-width: 800px) {
  .card-profissional {
    flex-direction: column;
  }

  .foto {
    width: 80px;
    height: 80px;
    min-width: 80px;
  }

  .card-agenda {
    border-left: none;
    border-right: none;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 15px 0;
  }

  .card-rodape {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  .busca {
    margin: -20px 16px 0;
    flex-direction: column;
  }

  .busca input {
    width: 100%;
  }
}

.abas-endereco {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  border-bottom: 1px solid var(--line);
}

.aba-endereco {
  background: none;
  border: none;
  padding: 6px 4px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.aba-endereco.ativa {
  color: var(--lilac-deep);
  font-weight: bold;
  border-bottom: 2px solid var(--lilac-deep);
}

.conteudo-endereco {
  display: none;
  padding-top: 6px;
}

.conteudo-endereco.visivel {
  display: block;
}

.header-topo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px 24px;
  max-width: 900px;
  margin: 0 auto;
}

.logo {
  font-family: 'Quicksand', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: white;
  letter-spacing: 0.01em;
}

.menu-entrar {
  position: relative;
}

.btn-entrar {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  padding: 9px 18px;
  border-radius: 100px;
  cursor: pointer;
  font-size: 14px;
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
}

.btn-entrar:hover {
  background: rgba(255, 255, 255, 0.28);
}

.menu-suspenso {
  display: none;
  position: absolute;
  right: 0;
  top: 46px;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--card-shadow-hover);
  min-width: 200px;
  overflow: hidden;
  z-index: 10;
}

.menu-suspenso.aberto {
  display: block;
}

.menu-suspenso a {
  display: block;
  padding: 12px 16px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
}

.menu-suspenso a:hover {
  background: var(--lilac-tint);
}

.menu-suspenso hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 4px 0;
}

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(58, 46, 92, 0.45);
  z-index: 100;
  justify-content: center;
  align-items: center;
}

.modal-overlay.aberto {
  display: flex;
}

.modal-caixa {
  background: #fff;
  padding: 30px;
  border-radius: 22px;
  width: 90%;
  max-width: 380px;
  position: relative;
}

.modal-fechar {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--muted);
}

.modal-caixa h2 {
  font-family: 'Quicksand', sans-serif;
  margin-bottom: 20px;
  color: var(--ink);
  font-weight: 700;
}

.modal-caixa form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-caixa input {
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: #FBF9FF;
  border-radius: 12px;
  font-size: 14px;
  color: var(--ink);
}

.btn-modal {
  background-color: var(--lilac-deep);
  color: #fff;
  border: none;
  padding: 13px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Quicksand', sans-serif;
}

.btn-modal:hover {
  background-color: #6A47CC;
}

.modal-erro {
  color: #C0392B;
  font-size: 13px;
  margin: 0;
}

.modal-sucesso {
  color: var(--mint-ink);
  font-size: 13px;
  margin: 0;
}

.tipo-usuario-escolha {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.tipo-btn {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
}

.tipo-btn.ativo {
  background: var(--lilac-deep);
  color: #fff;
  border-color: var(--lilac-deep);
}

.campos-profissional {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.horario-btn.ocupado {
  background-color: #F3F0FA;
  color: #C7BCE0;
  text-decoration: line-through;
  cursor: not-allowed;
  border-color: #EBE5F7;
}

.toggle-tipo-consulta {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.tipo-btn-consulta {
  padding: 6px 14px;
  border: 1px solid var(--lilac-tint-2);
  background: #fff;
  color: var(--lilac-deep);
  border-radius: 100px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: bold;
  transition: all 0.15s;
}

.tipo-btn-consulta:hover {
  background-color: var(--lilac-tint);
}

.tipo-btn-consulta.ativo {
  background-color: var(--lilac-deep);
  color: #fff;
  border-color: var(--lilac-deep);
}

/* ---------- COMENTÁRIOS: gatilho no card ---------- */

.ver-comentarios {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ver-comentarios:hover {
  color: var(--lilac-deep);
}

.ver-especializacoes {
  cursor: pointer;
  color: var(--lilac-deep);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  margin-bottom: 4px;
}

.ver-especializacoes:hover {
  color: #6A47CC;
}

/* ---------- MODAL DE COMENTÁRIOS (bottom sheet mobile-first) ---------- */

.modal-overlay-sheet {
  align-items: flex-end;
}

.modal-sheet {
  width: 100%;
  max-width: 100%;
  border-radius: 24px 24px 0 0;
  max-height: 75vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 24px;
  animation: subirSheet 0.25s ease-out;
}

.sheet-alca {
  width: 40px;
  height: 4px;
  background: var(--line);
  border-radius: 4px;
  margin: 0 auto 14px auto;
}

@keyframes subirSheet {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.comentarios-lista {
  overflow-y: auto;
}

.comentario-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.comentario-item:last-child {
  border-bottom: none;
}

.comentario-estrelas {
  color: #f5a623;
  font-size: 14px;
  margin-bottom: 4px;
}

.comentario-texto {
  font-size: 0.9rem;
  color: var(--ink);
  margin-bottom: 4px;
}

.comentario-autor {
  font-size: 0.75rem;
  color: var(--muted);
}

.sem-comentarios {
  color: var(--muted);
  text-align: center;
  padding: 24px 0;
}

/* ---------- MODAL DE ESPECIALIZAÇÕES ---------- */

.especializacoes-lista {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.especializacao-modal-item {
  background-color: var(--lilac-tint);
  color: var(--lilac-deep);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
}

/* Em telas maiores, o "sheet" vira um modal central comum */
@media (min-width: 700px) {
  .modal-overlay-sheet {
    align-items: center;
  }

  .modal-sheet {
    max-width: 420px;
    border-radius: 20px;
    max-height: 70vh;
    animation: none;
  }

  .sheet-alca {
    display: none;
  }
}
