/* ============================================================================
   STEPS-FLOW.CSS - Layout dos steps após o CPF
   Estrutura: header + progress-bar + conteúdo + botão colado embaixo (sem scroll)
   ============================================================================ */

/* --- OCULTAR CARDS DE SELEÇÃO DE TIPO DE CONTA --- */
.react-card,
.react-card-selected {
  display: none !important;
}

/* --- PROGRESS BAR (ponto — linha tracejada clara — ponto ... até o fim) --- */
.progress-stepper {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 20px;
  background: #fff;
  margin-top: 12px;
}

.progress-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--primary);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.progress-dot.completed {
  width: 16px;
  height: 16px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-dot.completed .progress-dot-check {
  width: 11px;
  height: 11px;
  fill: #fff;
  display: block;
}

.progress-dot.active {
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.16);
}

.progress-line {
  flex: 1 1 auto;
  height: 0;
  border-top: 1px dashed #dcdce1;
  transition: border-color 0.2s ease;
}

.progress-line.completed {
  border-top-color: var(--primary);
}

/* --- CONTAINER FLOW: página trava na altura da viewport (sem scroll), footer oculto --- */
.container--flow {
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.container--flow .header,
.container--flow .progress-stepper {
  flex: 0 0 auto;
}

.container--flow .header {
  background: #fff;
}

.container--flow .step-footer {
  display: none;
}

/* Segurança: some com a seção de recompensas que sobra do render do CPF */
.container--flow .container-dynamic-banner-itens {
  display: none;
}

/* --- CONTAINER FORM: fundo branco, conteúdo em cima, botão colado embaixo --- */
.container--form #hero {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.container--form #hero .hero-content {
  flex: 1;
  height: auto;
  width: 100%;
  padding: 28px 20px 20px;
  align-items: stretch;
  text-align: left;
  justify-content: flex-start;
  gap: 12px;
  overflow-y: auto;
}

/* Título e textos em cor escura (antes eram brancos sobre o hero verde) */
.container--form .hero-title {
  color: var(--title);
  font-size: 26px;
  line-height: 1.25;
}

.container--form #hero .hero-content p,
.container--form #hero .hero-content .field-intro {
  color: var(--text-muted);
  font-size: 16px;
}

.container--form #hero .hero-content .field-intro {
  margin-bottom: 8px;
}

/* O card deixa de ser uma caixa flutuante: vira coluna que preenche a altura */
.container--form #hero .hero-content > .card {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  gap: 8px;
}

/* Botão colado na base da tela (dentro do card ou direto no hero-content) */
.container--form #hero .hero-content > .card .primary,
.container--form #hero .hero-content > .primary {
  margin-top: auto;
  margin-bottom: 0;
}

/* Card de pontos (pontos-disponiveis) continua centralizado horizontalmente */
.container--form #hero .hero-content .points-info-wrapper {
  width: 100%;
}

/* --- STEP FULL-BLEED: ocupa a tela inteira, sem o quadro de 440px --- */
.container--fullbleed {
  max-width: none;
  width: 100vw;
  margin: 0;
}

/* --- STEP BANCO: página rola normalmente (sem altura fixa), rodapé do site
   aparece em baixo. O hero vazio continua a servir de espaçador abaixo do
   header pill (position:absolute), por isso NÃO é escondido. --- */
.container--flow:has(.card[data-step="banco"]) {
  height: auto;
  min-height: 100dvh;
  overflow: visible;
}
.container--flow:has(.card[data-step="banco"]) .step-footer { display: flex; }

/* --- STEP RESGATE-PONTOS: idem — página rola normal, sem botão fixo. --- */
.container--flow:has(.card[data-step="resgate-pontos"]) {
  height: auto;
  min-height: 100dvh;
  overflow: visible;
}
.container--flow:has(.card[data-step="resgate-pontos"]) .step-footer { display: flex; }
/* Lista com altura limitada e scroll próprio: o card não cresce com todos
   os bancos; arrasta-se dentro da lista. */
.card[data-step="banco"] .option-list {
  max-height: 420px !important;
  overflow-y: auto !important;
}
/* A caixa branca em volta (o .card) encolhe: padding menor e largura mais
   enxuta, para não ficar enorme. Os cards de cada banco ficam no tamanho
   normal. */
.card[data-step="banco"] {
  max-width: 380px;
  margin: 0 auto;
  padding: 16px !important;
}

/* --- TELA DE CÁLCULO / CARREGANDO (barra de 0 a 100%) --- */
.calc-loading {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 32px 28px;
}

.calc-loading__spinner {
  margin-bottom: 6px;
}

.calc-loading__title {
  margin: 0;
  font-family: 'ItauDisplayPro', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--title);
  line-height: 1.25;
}

.calc-loading__subtitle {
  margin: 0;
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.5;
}

.calc-loading__percent {
  margin-top: 12px;
  font-family: 'ItauDisplayPro', sans-serif;
  font-size: 42px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.calc-loading__bar {
  width: 100%;
  height: 8px;
  background: #e9ece9;
  border-radius: 999px;
  overflow: hidden;
}

.calc-loading__fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #4aa81a);
}

.calc-loading__status {
  margin: 4px 0 0;
  min-height: 22px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  transition: opacity 0.16s ease;
}

/* --- CARDS DE TIPO DE CONTA (Pessoa Física / Pessoa Jurídica/MEI) --- */
.cards-container {
  display: flex;
  gap: 12px;
  width: 100%;
  margin-top: 20px;
}

.react-card {
  position: relative;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 12px 18px;
  border: 1.5px solid #dcdce1;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  min-height: 150px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.react-card:hover {
  border-color: var(--secondary);
}

.react-card.react-card-selected {
  border-color: var(--secondary);
  background: rgba(255, 98, 0, 0.04);
  border-width: 2px;
}

.react-card-elipse-container {
  position: absolute;
  top: 12px;
  left: 12px;
}

.react-card-elipse button {
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
}

.react-card-elipse-inner {
  position: relative;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid #d3d3d7;
  background: #fff;
  transition: border-color 0.2s ease;
}

.react-card-selected .react-card-elipse-inner {
  border-color: var(--secondary);
}

.react-card-selected .react-card-elipse-inner::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--secondary);
}

.icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-container img {
  width: 48px;
  height: 48px;
}

.label-radio-button-card {
  margin: 0;
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.2;
}

/* Card selecionado: título em laranja e mais forte */
.react-card-selected .label-radio-button-card {
  font-weight: 700;
  color: var(--secondary);
}

/* Área dos campos condicionais que aparecem após escolher o tipo de conta */
.account-fields {
  width: 100%;
}

/* --- TELA DE SELEÇÃO DE LIMITE (SLIDER) --- */
.limit-slider-container {
  /* Paleta local do slider: laranja Itaú como cor de ação, azul como sombra */
  --limit-accent: var(--secondary);
  --limit-accent-light: #ff8a2b;
  --limit-accent-dark: #e85400;
  --limit-track: #e9ebf0;
  --limit-shadow: 0, 30, 79;
  /* Preenchimento da trilha (0% = mínimo). Para animar junto com o valor,
     basta o JS fazer: slider.style.setProperty('--limit-progress', pct + '%') */
  --limit-progress: 0%;

  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 100%;
}

/* --- Card com o valor selecionado --- */
.limit-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-top: 12px;
  padding: 30px 26px 28px;
  border-radius: 22px;
  text-align: center;
  color: #fff;
  background:
    linear-gradient(135deg, var(--limit-accent-light) 0%, var(--limit-accent) 52%, var(--limit-accent-dark) 100%);
}

/* Brilhos decorativos (suaves, sem borda dura) */
.limit-card::before {
  content: '';
  position: absolute;
  z-index: -1;
  top: -70px;
  right: -50px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 70%);
}

.limit-card::after {
  content: '';
  position: absolute;
  z-index: -1;
  bottom: -80px;
  left: -40px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0) 70%);
}

.limit-card-label {
  margin-bottom: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}

.limit-card-value {
  font-family: 'ItauDisplayPro', 'ItauTextPro', sans-serif;
  font-size: clamp(36px, 11vw, 50px);
  font-weight: 800;
  line-height: 1.05;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 10px rgba(var(--limit-shadow), 0.18);
}

/* --- Trilha + botão de arraste --- */
.limit-slider-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 2px 2px 22px;
}

/* Referências de mínimo e máximo do range (5.000 – 500.000) */
.limit-slider-wrapper::before,
.limit-slider-wrapper::after {
  position: absolute;
  bottom: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: #8b909a;
}

.limit-slider-wrapper::before {
  content: '5.000 €';
  left: 4px;
}

.limit-slider-wrapper::after {
  content: '500.000 €';
  right: 4px;
}

.limit-slider {
  width: 100%;
  height: 30px; /* área de toque confortável */
  margin: 0;
  padding: 0;
  background: transparent;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

/* Trilha — Chrome / Safari / Edge */
.limit-slider::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--limit-accent) 0%, var(--limit-accent-light) 100%)
      left center / var(--limit-progress) 100% no-repeat,
    var(--limit-track);
  box-shadow: inset 0 1px 2px rgba(var(--limit-shadow), 0.12);
}

/* Trilha — Firefox (o preenchimento é nativo em ::-moz-range-progress) */
.limit-slider::-moz-range-track {
  height: 10px;
  border: none;
  border-radius: 999px;
  background: var(--limit-track);
  box-shadow: inset 0 1px 2px rgba(var(--limit-shadow), 0.12);
}

.limit-slider::-moz-range-progress {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--limit-accent) 0%, var(--limit-accent-light) 100%);
}

/* Botão de arraste: miolo laranja, corpo branco e anel da cor de ação */
.limit-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  margin-top: -9px; /* centraliza sobre a trilha de 10px */
  border: 3px solid var(--limit-accent);
  border-radius: 50%;
  background: radial-gradient(circle, var(--limit-accent) 0 5px, #fff 6px);
  box-shadow:
    0 6px 14px -4px rgba(255, 98, 0, 0.5),
    0 1px 3px rgba(var(--limit-shadow), 0.16);
  cursor: grab;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease;
}

.limit-slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border: 3px solid var(--limit-accent);
  border-radius: 50%;
  background: radial-gradient(circle, var(--limit-accent) 0 5px, #fff 6px);
  box-shadow:
    0 6px 14px -4px rgba(255, 98, 0, 0.5),
    0 1px 3px rgba(var(--limit-shadow), 0.16);
  cursor: grab;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease;
}

.limit-slider:hover::-webkit-slider-thumb {
  transform: scale(1.08);
}

.limit-slider:hover::-moz-range-thumb {
  transform: scale(1.08);
}

.limit-slider:focus-visible::-webkit-slider-thumb {
  box-shadow:
    0 0 0 6px rgba(255, 98, 0, 0.16),
    0 6px 14px -4px rgba(255, 98, 0, 0.5);
}

.limit-slider:focus-visible::-moz-range-thumb {
  box-shadow:
    0 0 0 6px rgba(255, 98, 0, 0.16),
    0 6px 14px -4px rgba(255, 98, 0, 0.5);
}

.limit-slider:active::-webkit-slider-thumb {
  transform: scale(1.16);
  box-shadow:
    0 0 0 8px rgba(255, 98, 0, 0.14),
    0 8px 18px -4px rgba(255, 98, 0, 0.55);
  cursor: grabbing;
}

.limit-slider:active::-moz-range-thumb {
  transform: scale(1.16);
  box-shadow:
    0 0 0 8px rgba(255, 98, 0, 0.14),
    0 8px 18px -4px rgba(255, 98, 0, 0.55);
  cursor: grabbing;
}

/* --- Resumo (limite / juros): um cartão único com divisória --- */
.limit-info {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #ecedf1;
  border-radius: 16px;
}

.limit-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid #f2f3f6;
  transition: background 0.2s ease;
}

.limit-info-row:last-child {
  border-bottom: none;
}

.limit-info-row:hover {
  background: #fafbfc;
}

.limit-info-label {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 13px;
}

.limit-info-value {
  color: var(--primary);
  font-weight: 700;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  .limit-slider::-webkit-slider-thumb {
    transition: none;
  }

  .limit-slider::-moz-range-thumb {
    transition: none;
  }
}

/* --- TELA DE SUCESSO (último step): fundo verde, ícone + texto centralizados --- */
/* Ocupa 100% da tela (sobrepõe o max-width do container em telas maiores). */
.container--success {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  margin: 0;
  z-index: 1000;
}

.container--success,
.container--success #hero {
  background: var(--secondary);
}

.container--success .wrap {
  display: none;
}

.container--success .success-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  height: 100%;
  width: 100%;
  padding: 24px;
  text-align: center;
}

.container--success .success-icon {
  width: 96px;
  height: 96px;
}

.container--success .success-text {
  margin: 0;
  color: #fff;
  font-weight: 400;
  font-size: 20px;
  line-height: 1.4;
  max-width: 320px;
}
