:root {
  --navy: #0d2f73;
  --brand-dark: #0d47a1;
  --brand: #1976d2;
  --brand-light: #64b5f6;
  --text: #102b64;
  --muted: #6b7280;
  --line: #dbe4f0;
  --surface: #ffffff;
  --background: #f5f7fa;
  --danger: #b42318;
  --success: #067647;
  --gradient: linear-gradient(135deg, #0d47a1 0%, #1976d2 62%, #64b5f6 100%);
  --shadow-card: 0 24px 70px rgba(13, 47, 115, 0.14), 0 4px 14px rgba(13, 47, 115, 0.07);
  --shadow-option: 0 8px 24px rgba(13, 47, 115, 0.08);
  --radius-card: 28px;
  --radius-option: 16px;
  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 2.5rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 15%, rgba(100, 181, 246, 0.18), transparent 28rem),
    radial-gradient(circle at 85% 85%, rgba(25, 118, 210, 0.12), transparent 30rem),
    var(--background);
  font-family: "Montserrat", Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
label {
  -webkit-tap-highlight-color: transparent;
}

.page-shell {
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: 28px 16px;
}

.form-card {
  position: relative;
  width: min(100%, 460px);
  min-height: 760px;
  overflow: hidden;
  border: 1px solid rgba(13, 71, 161, 0.1);
  border-radius: var(--radius-card);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.96)),
    var(--surface);
  box-shadow: var(--shadow-card);
}

.brand-header {
  position: relative;
  z-index: 3;
  padding: 26px 28px 0;
}

.brand-logo {
  width: 150px;
  height: 102px;
  margin: 0 auto 8px;
  background-image: url("../assets/logo-domma.png");
  background-repeat: no-repeat;
  background-position: -44px -50px;
  background-size: 794px 1062px;
}

.progress-wrap {
  padding-top: 2px;
}

.progress-copy {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.progress {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.progress__item {
  position: relative;
  display: grid;
  place-items: center;
}

.progress__item:not(:first-child)::before {
  position: absolute;
  right: 50%;
  left: -50%;
  height: 2px;
  background: var(--line);
  content: "";
}

.progress__item.is-complete::before,
.progress__item.is-current::before {
  background: var(--brand);
}

.progress__item span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1.5px solid #bdc9da;
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface);
  font-size: 0.75rem;
  font-weight: 700;
  transition: 180ms ease;
}

.progress__item.is-current span,
.progress__item.is-complete span {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
  box-shadow: 0 6px 14px rgba(25, 118, 210, 0.24);
}

.progress__item.is-complete span {
  font-size: 0;
}

.progress__item.is-complete span::after {
  width: 9px;
  height: 5px;
  border-bottom: 2px solid #fff;
  border-left: 2px solid #fff;
  content: "";
  transform: rotate(-45deg) translateY(-1px);
}

.form-stage {
  position: relative;
  z-index: 2;
  padding: 24px 28px 118px;
}

.step {
  animation: step-in 320ms ease both;
}

.step__intro {
  margin-bottom: 22px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--brand);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(1.45rem, 6.2vw, 1.75rem);
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.helper-text {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.choice-group {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-group--compact {
  gap: 9px;
}

.choice-card {
  position: relative;
  display: flex;
  min-height: 72px;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-option);
  background: var(--surface);
  box-shadow: var(--shadow-option);
  cursor: pointer;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, background 180ms ease;
}

.choice-card:hover {
  border-color: rgba(25, 118, 210, 0.5);
  transform: translateY(-1px);
}

.choice-card:has(input:focus-visible) {
  outline: 3px solid rgba(100, 181, 246, 0.42);
  outline-offset: 2px;
}

.choice-card:has(input:checked) {
  border-color: var(--brand);
  background: linear-gradient(135deg, rgba(25, 118, 210, 0.07), rgba(100, 181, 246, 0.025));
  box-shadow: 0 10px 28px rgba(25, 118, 210, 0.14);
}

.choice-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.choice-card__icon {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  border-radius: 50%;
  color: var(--brand);
  background: #eef6ff;
}

.choice-card__icon svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.choice-card__label {
  flex: 1;
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 700;
}

.choice-card__check {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  place-items: center;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  color: transparent;
  background: #fff;
}

.choice-card__check svg,
.checkbox-mark svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.choice-card:has(input:checked) .choice-card__check {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
}

.choice-card--compact {
  min-height: 54px;
  gap: 11px;
  padding: 10px 14px;
}

.radio-mark {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
  border: 1.5px solid #aebdd0;
  border-radius: 50%;
  background: #fff;
}

.choice-card:has(input:checked) .radio-mark {
  border: 6px solid var(--brand);
}

.choice-card:not(.choice-card--compact) .radio-mark {
  margin-left: auto;
}

.inline-status,
.field-error,
.submit-message {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 0.75rem;
  font-weight: 500;
}

.inline-status {
  color: var(--brand);
  text-align: center;
}

.field-group {
  margin-top: 8px;
}

.field-group > label {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
}

.input-wrap {
  position: relative;
}

.input-wrap > svg {
  position: absolute;
  top: 50%;
  left: 16px;
  width: 22px;
  height: 22px;
  color: #8da2bf;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: translateY(-50%);
  pointer-events: none;
}

.input-wrap--whatsapp > svg {
  color: var(--brand);
}

.input-wrap input {
  width: 100%;
  min-height: 58px;
  padding: 0 16px 0 50px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  outline: none;
  color: var(--text);
  background: #fff;
  font-size: 0.88rem;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.input-wrap input::placeholder {
  color: #98a4b5;
}

.input-wrap input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(100, 181, 246, 0.22);
}

.input-wrap input[aria-invalid="true"] {
  border-color: var(--danger);
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 18px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.72rem;
  line-height: 1.55;
}

.consent input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.checkbox-mark {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
  border: 1.5px solid #9eb0c8;
  border-radius: 6px;
  color: transparent;
  background: #fff;
  transition: 180ms ease;
}

.consent:has(input:focus-visible) .checkbox-mark {
  outline: 3px solid rgba(100, 181, 246, 0.42);
  outline-offset: 2px;
}

.consent:has(input:checked) .checkbox-mark {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
}

.actions {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.actions--anchored {
  margin-top: 64px;
}

.button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 13px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.015em;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button--primary {
  border: 0;
  color: #fff;
  background: var(--gradient);
  box-shadow: 0 10px 20px rgba(13, 71, 161, 0.22);
}

.button--primary:not(:disabled):hover {
  box-shadow: 0 12px 24px rgba(13, 71, 161, 0.3);
  transform: translateY(-1px);
}

.button--primary:disabled {
  opacity: 0.44;
  box-shadow: none;
  cursor: not-allowed;
}

.button--secondary {
  min-height: 44px;
  border: 0;
  color: var(--brand-dark);
  background: transparent;
}

.button--secondary:hover {
  background: rgba(25, 118, 210, 0.06);
}

.button:focus-visible {
  outline: 3px solid rgba(100, 181, 246, 0.5);
  outline-offset: 3px;
}

.button--submit {
  min-height: 60px;
  padding: 10px 16px;
  line-height: 1.25;
  text-align: center;
}

.spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.button.is-loading .spinner {
  display: block;
}

.button.is-loading .button__label {
  opacity: 0.88;
}

.submit-message.is-error {
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff1f0;
}

.submit-message.is-success {
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--success);
  background: #ecfdf3;
}

.waves {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  height: 96px;
  overflow: hidden;
  pointer-events: none;
}

.waves__back,
.waves__front {
  position: absolute;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

.waves__back {
  right: -18%;
  bottom: -48px;
  left: -42%;
  height: 126px;
  background: var(--brand-light);
  transform: rotate(4deg);
}

.waves__front {
  right: -38%;
  bottom: -62px;
  left: -8%;
  height: 132px;
  background: var(--gradient);
  transform: rotate(-5deg);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

@keyframes step-in {
  from {
    opacity: 0;
    transform: translateX(14px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 479px) {
  .page-shell {
    align-items: start;
    padding: 12px;
  }

  .form-card {
    min-height: calc(100svh - 24px);
    border-radius: 24px;
  }

  .brand-header {
    padding: 18px 18px 0;
  }

  .brand-logo {
    width: 132px;
    height: 90px;
    background-position: -38px -44px;
    background-size: 699px 935px;
  }

  .progress__item span {
    width: 28px;
    height: 28px;
  }

  .form-stage {
    padding: 20px 16px 106px;
  }

  .choice-card {
    min-height: 68px;
    padding: 10px 12px;
  }

  .choice-card--compact {
    min-height: 50px;
  }

  .choice-card__icon {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .choice-card__label {
    font-size: 0.76rem;
  }
}

@media (max-width: 340px) {
  .page-shell {
    padding: 8px;
  }

  .form-card {
    min-height: calc(100svh - 16px);
    border-radius: 20px;
  }

  .brand-header {
    padding-inline: 14px;
  }

  .form-stage {
    padding-right: 13px;
    padding-left: 13px;
  }

  h1,
  h2 {
    font-size: 1.35rem;
  }

  .choice-card {
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Validação de telefone por SMS */
.otp-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1.5px solid rgba(25, 118, 210, 0.24);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(25, 118, 210, 0.07), rgba(100, 181, 246, 0.03));
}

.otp-panel__header {
  text-align: center;
}

.otp-panel__title {
  margin: 0;
  color: var(--navy);
  font-size: 0.9rem;
  font-weight: 800;
}

.otp-panel__copy {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.5;
}

.otp-panel__copy strong {
  color: var(--text);
}

.otp-field {
  margin-top: 14px;
}

.input-wrap--otp input {
  padding-left: 50px;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.input-wrap--otp > svg {
  color: var(--brand);
}

.input-wrap input:read-only {
  color: #52647c;
  background: #f5f8fc;
  cursor: default;
}

.otp-panel__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  margin-top: 8px;
}

.otp-link {
  padding: 4px 0;
  border: 0;
  color: var(--brand-dark);
  background: transparent;
  font-size: 0.68rem;
  font-weight: 800;
  cursor: pointer;
}

.otp-link:disabled {
  color: #98a4b5;
  cursor: not-allowed;
}

.otp-link:not(:disabled):hover {
  text-decoration: underline;
}

.otp-status {
  min-height: 18px;
  margin: 6px 0 0;
  color: var(--success);
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
}

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