:root {
  --navy: #102d43;
  --blue: #176b9e;
  --sky: #eaf5fb;
  --gold: #f2b84b;
  --ink: #142734;
  --muted: #657782;
  --line: #dce6eb;
  --paper: #f5f8fa;
  --danger: #b42318;
}

/* =========================
   RESET / BASE
========================= */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}


/* =========================
   ACESSIBILIDADE
========================= */

.skip {
  position: fixed;
  top: -60px;
  left: 14px;
  z-index: 99;
  background: #fff;
  padding: 10px 14px;
}

.skip:focus {
  top: 14px;
}


/* =========================
   HEADER
========================= */

header {
  height: auto;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.topocontato {
  min-height: 34px;
  padding: 6px max(20px, calc((100vw - 1160px) / 2));
  background: var(--navy);
  color: #d9e6ec;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: .72rem;
}

.topocontato ul {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.topocontato .topoJP,
.topocontato .topoQB { flex: 1 1 30%; }
.topocontato .topoEmail { flex: 1 1 24%; justify-content: center; }
.topocontato a { color: #d9e6ec; white-space: nowrap; transition: color .2s; }
.topocontato a:hover { color: #fff; }
.topocontato i { margin-right: 5px; color: var(--gold); }
.topocontato .divider,
.topocontato .email-divider { color: rgba(255,255,255,.25); }

.enroll-nav {
  width: min(1160px, calc(100% - 40px));
  height: 78px;
  margin: auto;

  display: flex;
  align-items: center;
  justify-content: space-between;
}

.enroll-nav img {
  display: block;
  width: 290px;
  height: auto;
}

.back-link {
  color: var(--blue);
  font-weight: 700;
  font-size: 0.9rem;
}

.back-link i {
  margin-right: 7px;
}


/* =========================
   INTRODUÇÃO
========================= */

.enroll-intro {
  width: min(1160px, calc(100% - 40px));
  margin: 65px auto 44px;

  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 50px;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--blue);

  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.enroll-intro h1 {
  margin: 0;

  font:
    800 clamp(2.7rem, 6vw, 5rem) / 1
    Manrope,
    sans-serif;

  letter-spacing: -0.055em;
}

.enroll-intro > div:first-child > p:last-child {
  max-width: 610px;
  margin: 18px 0 0;

  color: var(--muted);
  font-size: 1.08rem;
}


/* =========================
   BLOCO DE CONFIANÇA
========================= */

.trust {
  max-width: 330px;
  padding: 18px 20px;

  display: flex;
  align-items: center;
  gap: 15px;

  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.trust > span {
  width: 42px;
  height: 42px;

  display: grid;
  place-items: center;
  flex: none;

  border-radius: 12px;
  background: var(--sky);
  color: var(--blue);
}

.trust p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.trust strong {
  display: block;
  color: var(--ink);
  font-size: 0.9rem;
}


/* =========================
   ESTRUTURA PRINCIPAL
========================= */

.enroll-shell {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto 80px;

  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 25px;
  align-items: start;
}


/* =========================
   ETAPAS / MENU LATERAL
========================= */

.steps {
  position: sticky;
  top: 24px;

  padding: 18px;

  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.step {
  display: flex;
  align-items: center;
  gap: 13px;

  padding: 15px 10px;
  color: #8a98a1;
}

.step:not(:last-child) {
  border-bottom: 1px solid var(--line);
}

.step b {
  width: 34px;
  height: 34px;

  display: grid;
  place-items: center;
  flex: none;

  border-radius: 50%;
  background: #edf1f3;
}

.step span {
  font-weight: 700;
  font-size: 0.88rem;
}

.step small {
  display: block;
  font-weight: 500;
  font-size: 0.68rem;
}

.step.active {
  color: var(--navy);
}

.step.active b {
  background: var(--gold);
}

.step.done b {
  background: var(--blue);
  color: #fff;
}


/* =========================
   CARD DO FORMULÁRIO
========================= */

.form-card {
  min-width: 0;
  padding: clamp(26px, 5vw, 55px);

  border: 1px solid var(--line);
  border-radius: 22px;

  background: #fff;
  box-shadow: 0 16px 50px rgba(16, 45, 67, 0.08);
}

.mobile-progress {
  display: none;
}

.honeypot {
  position: absolute !important;
  left: -9999px !important;
}


/* =========================
   ETAPAS DO FORMULÁRIO
========================= */

.form-step {
  display: none;

  margin: 0;
  padding: 0;
  border: 0;
}

.form-step.active {
  display: block;
  animation: enter 0.35s ease;
}

@keyframes enter {
  from {
    opacity: 0.25;
    transform: translateY(10px);
  }
}

legend {
  padding: 0;

  font:
    800 clamp(1.75rem, 4vw, 2.6rem) / 1.1
    Manrope,
    sans-serif;

  letter-spacing: -0.04em;
}

.step-copy {
  margin: 10px 0 32px;
  color: var(--muted);
}


/* =========================
   CAMPOS
========================= */

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.span-2 {
  grid-column: 1 / -1;
}

label {
  display: block;

  color: #324b5a;
  font-size: 0.82rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 7px;
  padding: 12px 14px;

  border: 1px solid #cfdbe1;
  border-radius: 11px;

  background: #fbfcfd;
  color: var(--ink);

  font: 500 0.95rem "DM Sans";

  outline: 0;
  transition: 0.2s;
}

input,
select {
  min-height: 49px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(23, 107, 158, 0.11);
}


/* =========================
   ERROS DE VALIDAÇÃO
========================= */

.invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.09) !important;
}

.form-error {
  min-height: 20px;
  margin: 12px 0 0;

  color: var(--danger);
  font-size: 0.83rem;
  text-align: right;
}


/* =========================
   CAMPOS OPCIONAIS
========================= */

details {
  margin-top: 28px;

  border: 1px solid var(--line);
  border-radius: 14px;
}

summary {
  padding: 16px 18px;

  color: var(--blue);
  font-weight: 700;

  cursor: pointer;
  list-style: none;
}

summary i {
  margin-right: 8px;
}

.optional {
  padding: 5px 18px 20px;
}


/* =========================
   OPÇÕES / CHIPS
========================= */

.choice-group {
  margin-bottom: 28px;
}

.choice-group > span {
  display: block;
  margin-bottom: 12px;
  font-weight: 700;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.chips label input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chips label span {
  display: block;
  padding: 10px 14px;

  border: 1px solid var(--line);
  border-radius: 999px;

  background: #fff;
  color: #506672;

  font-size: 0.84rem;

  cursor: pointer;
  transition: 0.2s;
}

.chips input:checked + span {
  border-color: var(--blue);
  background: var(--sky);
  color: var(--blue);
}


/* =========================
   CONSENTIMENTO
========================= */

.consent {
  display: flex;
  align-items: flex-start;
  gap: 11px;

  margin-top: 27px;
  padding: 17px;

  border-radius: 13px;
  background: var(--sky);

  font-weight: 500;
  line-height: 1.5;
}

.consent input {
  width: 18px;
  height: 18px;
  min-height: 0;

  margin: 2px 0 0;
  flex: none;
}


/* =========================
   BOTÕES / AÇÕES
========================= */

.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;

  margin-top: 38px;
  padding-top: 25px;

  border-top: 1px solid var(--line);
}

button {
  min-height: 49px;
  padding: 0 20px;

  border-radius: 999px;

  font: 700 0.9rem "DM Sans";

  cursor: pointer;
}

.primary {
  margin-left: auto;

  border: 0;
  background: var(--gold);
  color: #17252e;
}

.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

button i {
  margin-inline: 7px;
}

button:disabled {
  opacity: 0.6;
  cursor: wait;
}


/* =========================
   TELA DE SUCESSO
========================= */

.success {
  padding: 40px 0;
  text-align: center;
}

.success > span {
  width: 72px;
  height: 72px;

  display: grid;
  place-items: center;

  margin: 0 auto 22px;

  border-radius: 50%;
  background: #e5f7ed;
  color: #16814b;

  font-size: 1.6rem;
}

.success h2 {
  margin: 0;
  font: 800 2rem Manrope;
}

.success p {
  color: var(--muted);
}

.success a {
  display: inline-block;
  margin-top: 15px;

  color: var(--blue);
  font-weight: 700;
}


/* =========================
   STATUS DO CEP
========================= */

.cep-status {
  display: block;

  min-height: 18px;
  margin-top: 6px;

  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.cep-status.loading {
  color: var(--blue);
}

.cep-status.success {
  color: #16814b;
}

.cep-status.error {
  color: var(--danger);
}


/* =========================
   FOOTER
========================= */

footer {
  padding: 28px 20px;

  background: var(--navy);
  color: #b9ccd6;

  text-align: center;
  font-size: 0.8rem;
}

footer p {
  margin: 0;
}

footer a {
  color: #fff;
}


/* =========================
   RESPONSIVO - TABLET
========================= */

@media (max-width: 991px) {
  .topocontato { display: none; }
}

@media (max-width: 850px) {
  .enroll-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .trust {
    max-width: 100%;
  }

  .enroll-shell {
    grid-template-columns: 1fr;
  }

  .steps {
    display: none;
  }

  .mobile-progress {
    display: flex;
    align-items: center;
    gap: 15px;

    margin-bottom: 30px;

    color: var(--blue);
    font-size: 0.78rem;
    font-weight: 700;
  }

  .mobile-progress > div {
    height: 5px;
    flex: 1;
    overflow: hidden;

    border-radius: 5px;
    background: #e8eef1;
  }

  .mobile-progress i {
    display: block;

    width: 25%;
    height: 100%;

    border-radius: 5px;
    background: var(--blue);

    transition: width 0.3s;
  }
}


/* =========================
   RESPONSIVO - CELULAR
========================= */

@media (max-width: 580px) {
  header {
    height: 68px;
  }

  .enroll-nav {
    width: calc(100% - 28px);
    height: 68px;
  }

  .enroll-nav img {
    width: 290px;
  }

  .back-link {
    font-size: 0;
  }

  .back-link i {
    font-size: 1rem;
  }

  .enroll-intro {
    width: calc(100% - 28px);
    margin: 40px auto 30px;
    gap: 25px;
  }

  .enroll-intro h1 {
    font-size: 2.8rem;
  }

  .enroll-shell {
    width: calc(100% - 28px);
    margin-bottom: 45px;
  }

  .form-card {
    padding: 24px 20px;
  }

  .field-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .span-2 {
    grid-column: auto;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .form-actions button {
    width: 100%;
    margin: 0;
  }

  .form-error {
    text-align: left;
  }
}


/* =========================
   ACESSIBILIDADE - REDUZIR ANIMAÇÕES
========================= */

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
/* Confirmação temporária após o envio, sem sair da página. */
.form-success-toast {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(7, 36, 54, .38);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}
.form-success-toast.visible { opacity: 1; }
.form-success-dialog {
    width: min(92vw, 430px);
    padding: 30px 28px;
    border-radius: 18px;
    border-top: 5px solid #f2b84b;
    background: #fff;
    box-shadow: 0 24px 70px rgba(6, 34, 51, .28);
    color: #29465a;
    text-align: center;
    transform: translateY(10px) scale(.98);
    transition: transform .25s ease;
}
.form-success-toast.visible .form-success-dialog { transform: translateY(0) scale(1); }
.form-success-icon {
    display: grid;
    width: 54px;
    height: 54px;
    margin: 0 auto 14px;
    place-items: center;
    border-radius: 50%;
    background: #e8f7ef;
    color: #167347;
    font-size: 30px;
    font-weight: 800;
}
.form-success-dialog strong { display: block; margin-bottom: 8px; color: #0b5f8a; font-size: 22px; }
.form-success-dialog > span:last-child { display: block; font-size: 15px; line-height: 1.55; }
@media (prefers-reduced-motion: reduce) {
    .form-success-toast,
    .form-success-dialog { transition: none; }
}
