/*
  CSS Limpo - Apenas regras utilizadas em index.php e index.js
  Data: 20/08/2024
*/

body {
  background: url('../img/bg.png') no-repeat center center;
  background-size: cover;
}

/* Variáveis de altura dos fixos (ajuste conforme necessário) */
:root {
  --fixed-top: 92px;     /* altura total do stepper fixo */
  --fixed-bottom: 72px;  /* altura total do rodapé fixo (botão) */
}

/* ===== Estilos do Formulário de Trial ===== */
#trial-section {
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-height: 100dvh;
  width: 100%;
}

#trial-section .card {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  width: 100% !important;
  min-height: 100dvh;
  border-radius: 0 !important;
}

#trial-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  height: 100%;
  border-radius: 0 !important;
  overflow: hidden !important; /* Adicionado para consistência */
}

#trial-section .card-header {
    border-radius: 0 !important;
}

#trial-section .card-header h5 {
  color: #7233a1;
  font-weight: 700;
}

/* Inputs e Selects */
#trial-section .form-control,
#trial-section .form-select {
  height: 45px;
  font-size: 1rem;
}

#trial-section .form-control:focus,
#trial-section .form-select:focus {
  border-color: #7233a1;
  border: 2px solid #7233a1;
  box-shadow: none;
}

#trial-section .form-control::placeholder {
  font-size: 1rem;
}

#trial-section .card-body {
  display: flex;
  flex-direction: column;
  padding: 0; /* espaçamento será controlado no formulário */
  height: 100dvh;
  box-sizing: border-box;
}

#trial-section form {
  display: flex;
  flex-direction: column;
  justify-content: center; /* Centraliza o passo */
  align-items: stretch;
  margin-top: calc(var(--fixed-top) + 12px);        /* altura do topo fixo + inset superior */
  margin-bottom: var(--fixed-bottom);               /* altura do rodapé fixo */
  min-height: calc(100dvh - (var(--fixed-top) + 12px) - var(--fixed-bottom));
  height: auto;
  padding: 0 12px;         /* respiro lateral */
  box-sizing: border-box;
  overflow: auto;          /* rolagem quando necessário */
}

/* Textarea dos Termos */
#trial-section textarea#terms-text {
  /* Ocupa o espaço disponível do container com rolagem interna */
  height: auto !important;
  min-height: 200px;
  max-height: 100%;
  overflow: auto;
  box-sizing: border-box;
  width: 100%;
  background-color: #f8f9fa; /* cinza bem claro */
  color: #212529;            /* texto escuro para contraste */
  border-color: #e9ecef;     /* borda suave no padrão Bootstrap */
}

/* Sobrescreve a altura fixa do .form-control apenas para o textarea */
#trial-section #trial-step-1 textarea#terms-text.form-control {
  height: auto !important;
  flex: 1 1 auto;
  min-height: 0; /* necessário para flex permitir overflow interno */
}

/* ===== Botão Principal de Ação (CTA) ===== */
.btn-cta {
  background: #9c27b0;
  color: #fff !important;
  padding: 0.75rem 2rem;
  border: none;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform: translateY(0) translateZ(0);
  will-change: transform, box-shadow;
  filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.4));
  -webkit-filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.4));
}

.btn-cta:hover,
.btn-cta:focus {
  transform: translateY(-6px) translateZ(0);
  opacity: 0.9;
  background-color: #9c27b0;
}

.btn-cta:active {
  transform: translateY(2px) translateZ(0);
  transition: all 0.1s ease;
  background-color: #9c27b0 !important;
}

/* Estado Desabilitado do CTA */
#trial-section .btn-cta:disabled {
  background-color: #d3d3d3 !important;
  color: #ffffff !important;
  border: none !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
  opacity: 1 !important;
}

#trial-section .btn-cta:disabled:hover,
#trial-section .btn-cta:disabled:focus {
  background-color: #d3d3d3 !important;
  color: #ffffff !important;
}

/* Efeito Ripple */
.btn-cta::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%, -50%);
  transform-origin: 50% 50%;
}

.btn-cta:focus:not(:active)::after {
  animation: ripple 1s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }
  100% {
    transform: scale(100, 100);
    opacity: 0;
  }
}

/* ===== Indicador de Passos (Stepper) ===== */
.step-indicator-wrapper {
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  box-sizing: border-box;
  width: auto;          /* deixa os limites serem definidos pelos insets do fixo */
  max-width: 100vw;     /* segurança para não ultrapassar a viewport */
  overflow-x: hidden;
  padding: 12px 16px;   /* respiro interno, não causa overflow quando fixo */
  margin: 0;            /* sem margem externa no elemento fixo */
}

.step-indicator {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0;
  margin: 0;
  list-style: none;
  position: relative;
}

.step-indicator::before {
  content: '';
  position: absolute;
  top: 13px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #e0e0e0;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 80px;
  position: relative;
}

.step-item span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: #e0e0e0;
  color: #fff;
  font-weight: bold;
  border: 2px solid #e0e0e0;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.step-item p {
  font-size: 0.8rem;
  color: #6c757d;
  margin-top: 0.25rem;
  font-weight: 500;
}

/* Estados do Stepper */
.step-item.active span {
  background-color: #9c27b0;
  border-color: #9c27b0;
}

.step-item.active p {
  color: #9c27b0;
  font-weight: 700;
}

.step-item.completed span {
  background-color: #4caf50;
  border-color: #4caf50;
}

.step-item.completed p {
  color: #212529;
}

/* ===== Transição de Passos ===== */
.form-step {
  display: none;
  will-change: transform, opacity;
}

.form-step.active {
  display: block;
  animation: slideInRight 0.4s ease both;
}

.slide-in-right {
  animation: slideInRight 0.4s ease both;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ===== Estilos do SweetAlert2 ===== */
.swal2-custom-blur {
  background: rgba(0, 0, 0, 0.45) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.swal2-btn-confirm {
  background-color: #28a745 !important;
  color: #fff !important;
  border: none !important;
  padding: 0.375rem 0.75rem !important;
  height: 40px !important;
  width: 100px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
}

.swal2-btn-confirm:hover {
  opacity: 0.8 !important;
}

/* Loader do SweetAlert2 roxo */
.swal2-loader {
  border: 0.25em solid rgba(114, 51, 161, 0.2) !important;
  border-left-color: #7233a1 !important;
}

.link-purple-bold {
  color: #7233a1 !important;
  font-weight: 700 !important;
}

/* Texto com cor tema roxa */
.text-theme {
  color: #7233a1 !important;
}

.logo {
  max-height: 175px;
}


/* ===== Layout Responsivo Essencial ===== */


/* Em telas menores, o scroll do passo pode ser menor */
@media (max-width: 768px) {
  #trial-section .step-scroll {
    height: auto; /* Deixa o conteúdo definir a altura */
    max-height: 100dvh; /* Limita para não ficar gigante */
  }
}

#trial-step-1 {
  height: 71dvh !important;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* impede que o conteúdo ultrapasse visualmente */
}

/* Garante que o textarea dentro do step-1 flexione corretamente */
#trial-step-1 #terms-text {
  flex: 1 1 auto;
  min-height: 200px;
  max-height: 100%;
  overflow: auto;
}

/* Etapa 2: igual ao container do Step 1, centralizado e sem ultrapassar o tamanho */
fieldset[data-step="2"] .step-scroll {
  height: 71dvh !important;               /* altura fixa semelhante ao step 1 */
  display: flex;
  flex-direction: column;
  overflow: auto;                          /* rolagem interna quando necessário */
  box-sizing: border-box;
}

/* Etapa 3: mesma estrutura das etapas anteriores */
fieldset[data-step="3"] .step-scroll {
  height: 71dvh !important;               /* altura fixa semelhante ao step 1 */
  display: flex;
  flex-direction: column;
  overflow: auto;                          /* rolagem interna quando necessário */
  box-sizing: border-box;
}

/* Etapa 3: mesma estrutura das etapas anteriores */
fieldset[data-step="4"] .step-scroll {
  height: 71dvh !important;               /* altura fixa semelhante ao step 1 */
  display: flex;
  flex-direction: column;
  overflow: auto;                          /* rolagem interna quando necessário */
  box-sizing: border-box;
}

.fixado-botton {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--fixed-bottom);
  display: flex;
  align-items: center;
  z-index: 1030;
  background: #fff;
}

.fixado-top {
  position: fixed;
  top: 12px;    /* margem superior visual */
  left: 12px;   /* margem esquerda visual */
  right: 12px;  /* margem direita visual */
  height: var(--fixed-top);
 
  align-items: center;
  z-index: 1030;
  background: #fff;
}

/* Removido ajuste global de .form-control para não afetar outros campos */