/* CSS do modal de contratação extraído do index.html */

/* Custom select with search */
.custom-select-wrapper {
  position: relative;
}

.custom-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  margin-top: 4px;
  max-height: 240px;
  overflow-y: auto;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  z-index: 9999; /* Z-index muito alto para garantir que apareça */
  display: none !important; /* Forçar escondido inicialmente */
}

.custom-select-dropdown:not(.hidden) {
  display: block !important;
}

.custom-select-option {
  padding: 12px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  display: block !important; /* Forçar visibilidade das opções */
  border-bottom: 1px solid #f3f4f6;
}

.custom-select-option:last-child {
  border-bottom: none;
}

.custom-select-option:hover {
  background-color: #f3f4f6;
}

/* Dropdown de bandeira do cartão */
.bandeira-select-container {
  position: relative;
}

.bandeira-select-input {
  cursor: pointer;
}

.bandeira-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  margin-top: 4px;
  max-height: 300px;
  overflow: hidden;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  z-index: 50;
}

.bandeira-search {
  outline: none;
}

.bandeira-search:focus {
  border-color: #10b981;
}

.bandeira-options {
  max-height: 250px;
  overflow-y: auto;
}

.bandeira-option {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background-color 0.15s ease;
}

.bandeira-option:hover {
  background-color: #f3f4f6;
}

.bandeira-option.selected {
  background-color: #d1fae5;
}

.bandeira-option-logo {
  flex-shrink: 0;
  width: 48px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bandeira-option-logo svg {
  width: 100%;
  height: 100%;
  border-radius: 3px;
}

.bandeira-option-name {
  font-size: 14px;
  color: #374151;
  font-weight: 500;
}

/* Container do footer */
.footer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-height: 120px;
}

/* Garantir que apenas um footer-step seja visível por vez */
.footer-step {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.footer-step.hidden {
  display: none !important;
}

/* Animação de entrada do modal */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* Estilos do modal */
#contrato-modal {
  backdrop-filter: blur(4px);
  height: 100vh;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  overflow: auto !important;
}

#contrato-modal .bg-white {
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Estilos dos campos do formulário */
#contrato-modal input,
#contrato-modal select,
#contrato-modal textarea {
  transition: all 0.2s ease;
}

#contrato-modal input:focus,
#contrato-modal select:focus,
#contrato-modal textarea:focus {
  outline: none;
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

/* Estilos para validação */
.erro-campo {
  color: #dc2626;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  animation: fadeIn 0.3s ease-in;
}

#contrato-modal input.erro {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

#contrato-modal input.erro:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Estilos dos checkboxes */
#contrato-modal input[type="checkbox"] {
  accent-color: #22c55e;
}

/* Estilos dos radio buttons */
#contrato-modal input[type="radio"] {
  accent-color: #22c55e;
}

/* Estilos dos botões */
#contrato-modal button {
  transition: all 0.2s ease;
}

/* Estilos para os botões de quantidade de implantes */
.quantidade-implantes-container {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  overflow: hidden;
  background: white;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.quantidade-implantes-container button {
  padding: 0.125rem 0.25rem;
  color: #6b7280;
  background: white;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.quantidade-implantes-container button:hover {
  background: #f3f4f6;
  color: #374151;
}

.quantidade-implantes-container button:active {
  background: #e5e7eb;
  transform: scale(0.95);
}

.quantidade-implantes-container button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f9fafb;
}

.quantidade-implantes-container .quantidade-display {
  padding: 0.125rem 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #374151;
  background: #f9fafb;
  border-left: 1px solid #d1d5db;
  border-right: 1px solid #d1d5db;
  width: 24px;
  height: 24px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Estilos responsivos para os botões de quantidade */
@media (max-width: 640px) {
  .quantidade-implantes-container {
    flex-direction: row !important;
    border-radius: 0.375rem;
  }
  
  .quantidade-implantes-container button {
    padding: 0.125rem 0.25rem;
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
  }
  
  .quantidade-implantes-container .quantidade-display {
    padding: 0.125rem 0.25rem;
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
    border-left: 1px solid #d1d5db;
    border-right: 1px solid #d1d5db;
    border-top: none;
    border-bottom: none;
  }
}

/* Estilos para evitar quebra de linha nos preços */
.text-vibrant-green {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Estilos específicos para preços de implantes */
#preco-implantes-card,
#preco-implantes-modal {
  white-space: nowrap;
  overflow: visible;
  text-overflow: unset;
}

/* Estilos para todos os preços no modal */
#contrato-modal .text-vibrant-green,
#contrato-modal .text-sm.text-vibrant-green,
#contrato-modal .font-bold.text-vibrant-green {
  white-space: nowrap;
  overflow: visible;
  text-overflow: unset;
  min-width: fit-content;
}

.addon-card[data-addon-id="implantes"] .flex.flex-col.items-end .text-sm {
  font-size: 0.875rem;
  font-weight: 600;
}

.addon-card[data-addon-id="implantes"] .flex.flex-col.items-end .text-xs {
  font-size: 0.75rem;
  color: #6b7280;
}

.addon-card[data-addon-id="implantes"]:hover {
  border-color: #22c55e;
  background: #f0fdf4;
}

.addon-card[data-addon-id="implantes"].selected {
  border-color: #22c55e;
  background: #f0fdf4;
}

/* Estilos do popover */
.popover-elig {
  position: absolute;
  z-index: 50;
  bottom: 110%;
  left: 0;
  min-width: 260px;
  background: #fff;
  color: #222;
  border-radius: 0.75rem;
  box-shadow: 0 8px 32px 0 rgba(31,38,135,0.18);
  border: 1px solid #e5e7eb;
  padding: 1rem 1.2rem;
  font-size: 0.95rem;
  line-height: 1.4;
  display: none;
  transform: translateY(-8px);
}

.popover-elig.active {
  display: block;
}

@media (max-width: 640px) {
  .popover-elig {
    left: 50%;
    transform: translate(-50%, -8px);
    min-width: 220px;
    max-width: 90vw;
  }
}

.popover-elig-close {
  position: absolute;
  top: 0.5rem;
  right: 0.7rem;
  color: #888;
  cursor: pointer;
  font-size: 1.1rem;
}

/* Estilos dos dependentes */
#dependentes-list .bg-gray-50 {
  border: 1px solid #e5e7eb;
}

#dependentes-list button {
  transition: all 0.2s ease;
}

#dependentes-list button:hover {
  transform: scale(1.05);
}

/* Ajustar espaçamento da caixa do dependente */
.dependente-card {
  margin-bottom: 1.5rem;
}


/* Estilos das opções de pagamento */
#pagamento-opcoes label {
  transition: all 0.2s ease;
}

#pagamento-opcoes label:hover {
  border-color: #22c55e;
  transform: translateY(-2px);
}

#pagamento-opcoes input[type="radio"]:checked + div {
  border-color: #22c55e;
}

/* Estilos dos campos de cartão */
#pagamento-cartao input {
  font-family: monospace;
}

/* Responsividade */
@media (max-width: 768px) {
  #contrato-modal .max-w-lg {
    margin: 1rem;
    max-width: calc(100vw - 2rem);
  }
  
  #contrato-modal .p-8 {
    padding: 1.5rem;
  }
  
  #contrato-modal .bg-white {
    max-height: 95%;
    display: flex;
    flex-direction: column;
  }
  
  #contrato-modal .overflow-y-auto {
    padding: 1rem;
  }
  
  #contrato-modal .border-t {
    padding: 1.5rem;
    min-height: 100px;
  }
  
  #footer-dados-step {
    text-align: center;
  }
  
  #footer-dados-step .mb-4 {
    text-align: center;
  }
}

/* Estilos para loading */
.loading {
  opacity: 0.7;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #f3f4f6;
  border-top: 2px solid #22c55e;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Estilos importantes para o modal funcionar */
#contrato-modal {
  position: fixed;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
}

#contrato-modal.hidden {
  display: none !important;
}

#contrato-modal:not(.hidden) {
  display: flex !important;
}

/* Estilos para os botões CTA */
.cta-button {
  cursor: pointer;
}

#contratar-card-btn {
  cursor: pointer;
}

/* Estilos para os ícones */
[data-lucide] {
  display: inline-block;
  vertical-align: middle;
}

/* Estilos para o popover */
.popover-elig-btn {
  cursor: pointer;
}

/* Estilos para os campos de formulário */
#contrato-modal input,
#contrato-modal select {
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
}

/* Estilos para os botões do modal */
#contrato-modal button[type="submit"] {
  background-color: #22c55e !important;
  color: white !important;
  border: none !important;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
}

#contrato-modal button[type="submit"]:hover {
  background-color: #16a34a !important;
}

/* Estilos para o botão de fechar */
#close-modal-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #6b7280;
  z-index: 10;
}

#close-modal-btn:hover {
  color: #ef4444;
}

/* Estilos para os cards dos adicionais */
.addon-card {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.addon-card:hover {
  transform: translateY(-2px);
}

.addon-card.selected {
  border-color: #22c55e;
  background-color: #f0fdf4;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.15);
}

.addon-card .addon-checkbox {
  transform: scale(1.2);
}

.addon-card:hover .addon-checkbox {
  transform: scale(1.3);
}

/* Estilos para o preço dos adicionais */
.addon-card .text-vibrant-green {
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(34, 197, 94, 0.1);
}

/* Animação para seleção dos adicionais */
.addon-card input[type="checkbox"]:checked + div {
  border-color: #22c55e;
}

.addon-card input[type="checkbox"]:checked ~ div {
  border-color: #22c55e;
}


/* Responsividade para os cards */
@media (max-width: 640px) {
  .addon-card {
    padding: 0.75rem;
  }
  
  .addon-card h4 {
    font-size: 0.875rem;
  }
  
  .addon-card p {
    font-size: 0.75rem;
  }
  
  #contrato-modal .bg-white {
    max-height: 95%;
    display: flex;
    flex-direction: column;
  }
  
  #contrato-modal .overflow-y-auto {
    padding: 0.75rem;
  }
  
  #contrato-modal .border-t {
    padding: 1rem;
    min-height: 80px;
  }
}

/* Estilos dos indicadores dos passos */
.step-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0.5;
  height: auto;
  justify-content: center;
  flex: 0 0 auto; /* Não expandir, manter tamanho fixo */
  margin: 0 8px; /* Espaçamento uniforme entre ícones */
}

.step-indicator.active {
  opacity: 1;
}

.step-indicator.completed {
  opacity: 1;
}

.step-indicator.completed .step-icon {
  background-color: #22c55e;
  color: white;
}

.step-indicator.active .step-icon {
  background-color: #22c55e;
  color: white;
}

.step-indicator:not(.active):not(.completed) .step-icon {
  background-color: #e5e7eb;
  color: #6b7280;
}

.step-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.step-indicator.active .step-icon {
  border-color: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);
}

.step-indicator.completed .step-icon {
  border-color: #22c55e;
}

.step-indicator.error .step-icon {
  background-color: #ef4444;
  color: white;
  border-color: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.step-indicator.incomplete .step-icon {
  background-color: #f97316;
  color: white;
  border-color: #f97316;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.1);
}


.step-connector {
  width: 40px; /* Tamanho fixo para conectores */
  height: 2px;
  background-color: #e5e7eb;
  transition: background-color 0.3s ease;
  position: relative;
  top: 20px; /* Posicionar exatamente no centro dos ícones (48px/2 - 1px da linha) */
}

.step-indicator.completed + .step-connector {
  background-color: #22c55e;
}

/* Estilos dos passos do formulário */
.form-wrapper {
  position: relative;
  min-height: 400px; /* Altura mínima para evitar colapso */
}

.form-step {
  display: none;
  opacity: 0;
  transform: translateX(30px);
  transition: all 0.3s ease-in-out;
}

.form-step.active {
  display: block;
  opacity: 1;
  transform: translateX(0);
}

.form-step.slide-in {
  animation: slideInFromRight 0.3s ease-out forwards;
}

.form-step.slide-out {
  animation: slideOutToLeft 0.3s ease-in forwards;
}

/* Animação de entrada lateral */
@keyframes slideInFromRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutToLeft {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-30px);
  }
}

/* Container dos indicadores */
.flex.items-center.w-full.max-w-md {
  align-items: flex-start; /* Alinhar ao topo para controle preciso */
  height: 48px; /* Altura fixa para controle preciso */
  position: relative;
  justify-content: center; /* Centralizar horizontalmente o conjunto */
  max-width: 200px; /* Limitar largura para melhor centralização */
}

/* Responsividade dos indicadores */
@media (max-width: 640px) {
  .step-indicator {
    margin: 0 4px; /* Espaçamento menor no mobile */
  }
  
  .step-icon {
    width: 40px;
    height: 40px;
  }
  
  .step-connector {
    width: 20px; /* Conector menor no mobile */
    height: 2px;
    top: 19px; /* Posicionar exatamente no centro dos ícones mobile (40px/2 - 1px da linha) */
  }
  
  /* Container mobile */
  .flex.items-center.w-full.max-w-md {
    max-width: 150px; /* Largura menor no mobile */
    height: 40px; /* Altura fixa para mobile */
  }
}

/* Espaçamento consistente para campos do formulário */
.form-step > div {
  margin-bottom: 1rem;
}

.form-step > div:last-child {
  margin-bottom: 0;
}

/* Garantir espaçamento uniforme entre campos */
.form-step .flex.flex-col.md\\:flex-row {
  margin-bottom: 1rem;
}

.form-step .flex.flex-col.md\\:flex-row > div {
  margin-bottom: 0;
}

.step-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.step-label {
  text-align: center;
  width: 100%;
  line-height: 1.2;
  margin: 0;
}

.step-connector {
  flex: 1;
  max-width: 60px;
  min-width: 40px;
  height: 2px;
  position: relative;
  top: 20px; /* Posicionar exatamente no centro dos ícones (48px/2) */
}