/* ==========================================================
   FUNDO — foto do Hero com overlay escuro
========================================================== */
.app-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.app-bg__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 64% 15%;
  filter: saturate(0.9);
}

.app-bg__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(13, 17, 27, 0.55) 0%, rgba(13, 17, 27, 0.88) 55%, var(--dark) 100%),
    linear-gradient(100deg, rgba(13, 17, 27, 0.35) 0%, rgba(49, 103, 238, 0.18) 100%);
}

/* ==========================================================
   LAYOUT
========================================================== */
body {
  min-height: 100vh;
}

.app-form {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top, 0px)) 18px max(32px, env(safe-area-inset-bottom, 0px));
}

.app-form__card {
  position: relative;
  width: 100%;
  max-width: 480px;
  padding: 26px 22px 24px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.035) 100%);
  border: 1px solid var(--border-soft);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.app-form__back {
  display: inline-block;
  margin-bottom: 18px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-50);
}

.app-form__head {
  text-align: center;
  margin-bottom: 22px;
}

.app-form__eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue-soft);
  margin-bottom: 8px;
}

.app-form__title {
  font-size: clamp(21px, 6vw, 25px);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.app-form__subtitle {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-70);
  font-weight: 500;
}

/* ==========================================================
   PROGRESSO
========================================================== */
.app-progress {
  height: 5px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin-bottom: 24px;
}

.app-progress__bar {
  height: 100%;
  width: 35%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--blue-soft), var(--blue));
  box-shadow: 0 0 10px var(--blue-glow);
  transition: width 0.4s var(--ease);
}

.app-progress__label {
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--ink-50);
  text-transform: uppercase;
  margin-bottom: 22px;
}

/* ==========================================================
   ETAPAS DO FORMULÁRIO
========================================================== */
#applicationForm {
  position: relative;
}

.form-step {
  display: none;
  flex-direction: column;
  text-align: left;
  animation: step-in 0.35s var(--ease);
}

.form-step.is-active {
  display: flex;
}

@keyframes step-in {
  from { opacity: 0; transform: translateX(14px); }
  to   { opacity: 1; transform: translateX(0); }
}

.form-step label {
  font-size: 15.5px;
  line-height: 1.4;
  font-weight: 700;
  margin-bottom: 12px;
}

.form-step__note {
  margin: -4px 0 14px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-50);
  font-weight: 500;
}

.dynamic-fill {
  color: var(--blue-soft);
  font-weight: 800;
}

.form-step input[type="text"],
.form-step input[type="tel"],
.form-step input[type="email"],
.form-step textarea {
  width: 100%;
  padding: 15px 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.05);
  color: var(--white);
  font-family: var(--font);
  font-size: 15.5px;
  font-weight: 600;
  outline: none;
  resize: none;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.form-step textarea {
  font-weight: 500;
  font-size: 14.5px;
  line-height: 1.5;
}

.form-step input::placeholder,
.form-step textarea::placeholder {
  color: var(--ink-50);
  font-weight: 500;
}

.form-step input:focus,
.form-step textarea:focus {
  border-color: var(--blue);
  background: rgba(49, 103, 238, 0.08);
}

.form-step input.is-invalid,
.form-step textarea.is-invalid {
  border-color: #F0554C;
  animation: shake 0.35s var(--ease);
}

@keyframes shake {
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.field-error {
  display: none;
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: #F0857D;
}

.field-error.is-visible {
  display: block;
}

/* choice cards */
.choice-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.choice-card {
  width: 100%;
  padding: 15px 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.05);
  color: var(--white);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.15s var(--ease);
}

.choice-card:active {
  transform: scale(0.98);
}

.choice-card.is-invalid {
  border-color: #F0554C;
}

.choice-card.is-selected {
  border-color: var(--blue);
  background: linear-gradient(90deg, rgba(49, 103, 238, 0.22), rgba(49, 103, 238, 0.08));
  box-shadow: 0 0 0 1px var(--blue) inset;
}

/* botões */
.btn-primary {
  width: 100%;
  padding: 16px;
  margin-top: 20px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--blue-soft), var(--blue) 60%, #234ec4);
  color: var(--white);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 12px 28px rgba(49, 103, 238, 0.35);
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.btn-primary:active {
  transform: scale(0.98);
  box-shadow: 0 6px 16px rgba(49, 103, 238, 0.3);
}

.btn-ghost {
  padding: 16px;
  margin-top: 20px;
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--ink-70);
  font-family: var(--font);
  font-size: 14.5px;
  font-weight: 600;
  flex: 0 0 96px;
}

.form-step__actions {
  display: flex;
  gap: 10px;
}

.form-step__actions .btn-primary {
  flex: 1;
}

.form-step__actions--single {
  justify-content: flex-start;
}

.form-step__actions--single .btn-ghost {
  flex: 0 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* sucesso */
.form-step--success {
  align-items: center;
  text-align: center;
  padding: 16px 0 4px;
}

.success-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-soft), var(--blue));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(49, 103, 238, 0.4);
  margin-bottom: 18px;
}

.form-step--success h3 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 10px;
}

.form-step--success p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-70);
  max-width: 320px;
}

/* ==========================================================
   TELAS FINAIS
========================================================== */
.form-step--final p {
  max-width: none;
}

/* X1: minicurso gratuito */
.form-step[data-step="x1"] {
  gap: 14px;
}

.final__selo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 7px 12px 7px 8px;
  border-radius: var(--radius-pill);
  background: rgba(49, 103, 238, 0.14);
  border: 1px solid rgba(49, 103, 238, 0.35);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--white);
}

.final__selo-icone {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-soft), var(--blue));
}

.form-step[data-step="x1"] h3 {
  font-size: clamp(19px, 5.4vw, 23px);
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.form-step[data-step="x1"] p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-70);
  font-weight: 500;
}

.form-step[data-step="x1"] .final__sub {
  font-size: 15px;
  color: var(--white);
  font-weight: 600;
}

.form-step[data-step="x1"] .final__lista-titulo {
  margin-top: 4px;
  color: var(--white);
  font-weight: 800;
}

.final__lista {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.final__lista li {
  position: relative;
  padding: 12px 14px 12px 42px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-soft);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 600;
}

.final__lista li::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 14px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-soft), var(--blue)) center / cover;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='12'/%3E%3C/svg%3E") center / contain no-repeat;
}

.final__lista li::after {
  content: '';
  position: absolute;
  left: 19px;
  top: 18px;
  width: 8px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
}

.btn-whatsapp {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  text-align: center;
  text-decoration: none;
  background: linear-gradient(135deg, #2fd16b, #1faa52);
  box-shadow: 0 12px 28px rgba(31, 170, 82, 0.35);
}

.form-step[data-step="x1"] .final__micro {
  margin-top: -4px;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-50);
}

/* High Ticket: pré-agendamento */
.form-step[data-step="ht"] h3 {
  font-size: clamp(18px, 5vw, 21px);
  line-height: 1.35;
}

.form-step[data-step="ht"] p {
  margin-bottom: 8px;
  max-width: 420px;
}

.cal {
  width: 100%;
  margin-top: 14px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-soft);
  text-align: center;
}

.form-step--final .cal p { max-width: none; margin-bottom: 0; }

.cal__titulo {
  font-size: 16px;
  font-weight: 800;
  color: var(--white) !important;
}

.cal__sub {
  margin: 4px 0 14px !important;
  font-size: 13px !important;
}

.cal__cabecalho {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-weight: 700;
  color: var(--blue-soft);
}

.cal__nav {
  padding: 6px 12px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 16px;
}

.cal__semana,
.cal__dias {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal__semana {
  margin-bottom: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-50);
}

.cal__dia {
  padding: 9px 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--white);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 600;
}

button.cal__dia { background: rgba(49, 103, 238, 0.12); }
.cal__dia.is-disabled { color: rgba(255, 255, 255, 0.22); }
.cal__dia.is-selected,
.cal__hora.is-selected {
  background: linear-gradient(135deg, var(--blue-soft), var(--blue));
  color: var(--white);
  box-shadow: 0 6px 14px rgba(49, 103, 238, 0.35);
}

.cal__horas {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
}

.cal__horas-titulo {
  margin-bottom: 10px !important;
  font-size: 13px !important;
  font-weight: 700;
  color: var(--white) !important;
}

.cal__horas-grade {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.cal__hora {
  padding: 10px 0;
  border-radius: 9px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 600;
}

.cal__vazio {
  grid-column: 1 / -1;
  font-size: 12.5px !important;
}

.cal__confirmar { margin-top: 14px; }
.cal__confirmar:disabled { opacity: 0.65; cursor: wait; }

.cal__erro {
  margin-top: 10px !important;
  font-size: 12.5px !important;
  font-weight: 600;
  color: #F0857D !important;
}

.cal__ok { padding: 18px 6px 6px; }
.cal__ok-icone { font-size: 44px; margin-bottom: 10px; }
.cal__ok-titulo {
  margin-bottom: 8px !important;
  font-size: 19px !important;
  font-weight: 800;
  color: var(--white) !important;
}

/* tablet: card um pouco maior, sem virar layout de desktop */
@media (min-width: 600px) and (max-width: 859px) {
  .app-form__card { max-width: 520px; padding: 34px 32px 30px; }
}

/* celular deitado / telas baixas: card encosta no topo e rola normalmente */
@media (max-height: 560px) {
  .app-form { align-items: flex-start; }
}

@media (max-width: 359px) {
  .app-form { padding-left: 12px; padding-right: 12px; }
  .app-form__card { padding: 22px 16px 20px; }
  .cal { padding: 12px 10px; }
  .cal__horas-grade { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================
   DESKTOP
========================================================== */
@media (min-width: 860px) {
  .app-bg__photo {
    object-position: 60% 10%;
  }

  .app-form__card {
    max-width: 540px;
    padding: 40px 44px 38px;
  }

  .form-step__actions .btn-ghost {
    flex: 0 0 110px;
  }
}
