/* ─────────────────────────────────────
   RESET LOCAL CONTROLADO
───────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  line-height: 1.4;
  color: #333333;
  -webkit-text-size-adjust: 100%;
  background-color: #ffffff;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
}

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

/* ─────────────────────────────────────
   PAGE
───────────────────────────────────── */
.frame {
  width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  background-color: #ffffff;
}

.page-wrapper {
  width: 100%;
  max-width: 1440px;
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  align-items: stretch;
  background-color: #ffffff;
  overflow: hidden;
}

/* ─────────────────────────────────────
   HERO
───────────────────────────────────── */
.hero-image {
  flex: 0 0 43%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
  padding: clamp(24px, 3vw, 40px);
}

.hero-image::before {
  content: "";
  width: clamp(260px, 28vw, 360px);
  aspect-ratio: 1 / 1;
  display: block;
  border-radius: 50%;
  background-image: url("./img/foto_rafael.jpg");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center 12%;
  background-color: #d6e4f0;
  border: 6px solid #f47920;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.10);
  flex-shrink: 0;
}

/* ─────────────────────────────────────
   FORM PANEL
───────────────────────────────────── */
.form-panel {
  flex: 1 1 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(32px, 4vw, 56px) clamp(20px, 4vw, 88px);
  background-color: #ffffff;
}

/* ─────────────────────────────────────
   LOGO
───────────────────────────────────── */
.logo-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: clamp(16px, 1.8vw, 26px);
  width: 100%;
}

.logo-img {
  display: block;
  width: clamp(180px, 20vw, 340px);
  max-width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.08));
}

/* ─────────────────────────────────────
   HEADING
───────────────────────────────────── */
.form-heading {
  font-family: Arial, sans-serif;
  font-size: clamp(24px, 2.3vw, 36px);
  font-weight: 400;
  color: #f47920;
  text-align: center;
  line-height: 1.2;
  margin: 0 auto clamp(18px, 1.8vw, 28px);
  max-width: 620px;
  white-space: normal;
  text-wrap: balance;
}

.form-heading .highlight {
  font-weight: 700;
  color: #00316B;
}

/* ─────────────────────────────────────
   FORM
───────────────────────────────────── */
.registration-form {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.3vw, 18px);
}

.form-step {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.3vw, 18px);
}

.is-hidden {
  display: none !important;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field-label {
  font-family: Arial, sans-serif;
  font-size: clamp(15px, 1vw, 18px);
  font-weight: 400;
  color: #333333;
  text-align: center;
  line-height: 1.2;
}

.field-input {
  width: 100%;
  min-width: 0;
  height: 54px;
  border: 2px solid #f47920;
  border-radius: 999px;
  padding: 0 20px;
  font-family: Arial, sans-serif;
  font-size: clamp(15px, 1vw, 17px);
  color: #333333;
  background-color: #ffffff;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field-input::placeholder {
  color: #8b8b8b;
  opacity: 1;
}

.field-input:focus {
  border-color: #d4640f;
  box-shadow: 0 0 0 3px rgba(244, 121, 32, 0.18);
}

/* ─────────────────────────────────────
   CONSENT
───────────────────────────────────── */
.consent-group {
  display: flex;
  align-items: flex-start;
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  width: 100%;
}

.consent-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.consent-custom-checkbox {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  margin-top: 2px;
  border: 2px solid #f47920;
  border-radius: 50%;
  background-color: #ffffff;
  transition: 0.2s ease;
}

.consent-checkbox:checked + .consent-custom-checkbox {
  background-color: #f47920;
  border-color: #f47920;
}

.consent-checkbox:focus-visible + .consent-custom-checkbox {
  outline: 2px solid #4a90e2;
  outline-offset: 2px;
}

.consent-text {
  font-family: Arial, sans-serif;
  font-size: clamp(14px, 1vw, 17px);
  font-weight: 700;
  line-height: 1.38;
  color: #333333;
}

/* ─────────────────────────────────────
   BUTTONS
───────────────────────────────────── */
.submit-btn,
.btn-secondary {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  height: 56px;
  border-radius: 999px;
  font-family: Arial, sans-serif;
  font-size: clamp(15px, 1vw, 20px);
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  text-align: center;
  padding: 0 18px;
  white-space: normal;
  line-height: 1.1;
}

.submit-btn {
  border: none;
  background-color: #f47920;
  color: #ffffff;
  text-transform: uppercase;
}

.submit-btn:hover {
  background-color: #d4640f;
}

.submit-btn:active {
  transform: scale(0.98);
}

.submit-btn:focus-visible {
  outline: 2px solid #4a90e2;
  outline-offset: 3px;
}

.submit-btn:disabled {
  background-color: #f7a76f;
  cursor: not-allowed;
}

.btn-secondary {
  border: 2px solid #f47920;
  background: transparent;
  color: #f47920;
}

.btn-secondary:hover {
  background-color: rgba(244, 121, 32, 0.07);
}

.btn-secondary:focus-visible {
  outline: 2px solid #4a90e2;
  outline-offset: 3px;
}

.form-feedback {
  min-height: 18px;
  margin: -1px 0 0;
  text-align: center;
  font-family: Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.form-feedback.is-error { color: #c0392b; }
.form-feedback.is-success { color: #1f7a43; }

/* ─────────────────────────────────────
   AUTOCOMPLETE
───────────────────────────────────── */
.autocomplete-wrapper {
  position: relative;
  width: 100%;
}

.autocomplete-list {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 2px solid #f47920;
  border-radius: 14px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 200;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
}

.autocomplete-item {
  padding: 10px 18px;
  font-family: Arial, sans-serif;
  font-size: 14px;
  color: #333333;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.autocomplete-item:hover {
  background-color: rgba(244, 121, 32, 0.09);
}

/* ─────────────────────────────────────
   BACK BUTTON
───────────────────────────────────── */
.btn-back {
  display: block;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  color: #f47920;
  font-family: Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 0;
  text-align: center;
  transition: color 0.2s ease;
  appearance: none;
}

.btn-back:hover {
  color: #d4640f;
}

.btn-back:focus-visible {
  outline: 2px solid #4a90e2;
  outline-offset: 2px;
  border-radius: 8px;
}

/* ─────────────────────────────────────
   EXISTS PANEL
───────────────────────────────────── */
.exists-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
  padding: 2px 0;
}

.exists-title {
  margin: 0;
  font-family: Arial, sans-serif;
  font-size: clamp(20px, 1.5vw, 28px);
  font-weight: 700;
  color: #00316b;
  line-height: 1.2;
}

.exists-subtitle {
  margin: 0;
  font-family: Arial, sans-serif;
  font-size: clamp(14px, 1vw, 18px);
  color: #555555;
  line-height: 1.4;
}

.exists-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ─────────────────────────────────────
   DISCLAIMER
───────────────────────────────────── */
.disclaimer {
  width: 100%;
  max-width: 560px;
  margin: 4px auto 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.disclaimer p {
  margin: 0;
  font-family: Arial, sans-serif;
  font-size: 10.5px;
  font-weight: 400;
  color: #555555;
  line-height: 1.4;
  text-align: justify;
  text-wrap: pretty;
}

/* ─────────────────────────────────────
   LARGE DESKTOP
───────────────────────────────────── */
@media (min-width: 1600px) {
  .page-wrapper {
    max-width: 1560px;
  }

  .registration-form,
  .disclaimer {
    max-width: 590px;
  }
}

/* ─────────────────────────────────────
   DESKTOP / NOTEBOOK
───────────────────────────────────── */
@media (max-width: 1200px) {
  .page-wrapper {
    max-width: 100%;
  }

  .form-panel {
    padding: 38px 32px;
  }

  .hero-image::before {
    width: clamp(250px, 30vw, 340px);
  }
}

/* ─────────────────────────────────────
   TABLET LANDSCAPE / SMALL NOTEBOOK
───────────────────────────────────── */
@media (max-width: 991px) {
  .page-wrapper {
    flex-direction: column;
  }

  .hero-image {
    flex: none;
    width: 100%;
    min-height: auto;
    padding: 24px 18px 8px;
  }

  .hero-image::before {
    width: clamp(200px, 48vw, 300px);
  }

  .form-panel {
    min-height: auto;
    flex: none;
    width: 100%;
    padding: 26px 18px 22px;
    justify-content: flex-start;
  }

  .registration-form,
  .disclaimer,
  .form-heading {
    max-width: 100%;
  }
}

/* ─────────────────────────────────────
   MOBILE / TABLET PADRÃO COMPACTO
───────────────────────────────────── */
@media (max-width: 768px) {
  .hero-image {
    padding: 18px 14px 4px;
  }

  .hero-image::before {
    width: clamp(138px, 32vw, 210px);
    border-width: 5px;
  }

  .form-panel {
    padding: 20px 16px 16px;
    justify-content: flex-start;
  }

  .logo-wrapper {
    margin-bottom: 8px;
  }

  .logo-img {
    width: clamp(112px, 32vw, 170px);
  }

  .form-heading {
    font-size: clamp(19px, 4.8vw, 27px);
    line-height: 1.12;
    margin-bottom: 12px;
    max-width: 100%;
  }

  .registration-form {
    gap: 10px;
  }

  .form-step {
    gap: 10px;
  }

  .field-group {
    gap: 4px;
  }

  .field-label {
    font-size: 12.5px;
    text-align: left;
    line-height: 1.15;
  }

  .field-input {
    height: 42px;
    padding: 0 14px;
    font-size: 14px;
  }

  .consent-label {
    gap: 9px;
  }

  .consent-custom-checkbox {
    width: 19px;
    height: 19px;
    margin-top: 1px;
  }

  .consent-text {
    font-size: 12.5px;
    line-height: 1.3;
  }

  .submit-btn,
  .btn-secondary {
    height: 44px;
    min-height: 44px;
    font-size: 14px;
    letter-spacing: 0.02em;
    padding: 0 12px;
  }

  .btn-back {
    font-size: 11px;
    padding: 0;
  }

  .form-feedback {
    min-height: 14px;
    font-size: 11px;
    margin-top: -1px;
  }

  .exists-panel {
    gap: 9px;
    padding-top: 0;
  }

  .exists-title {
    font-size: clamp(17px, 4.2vw, 23px);
  }

  .exists-subtitle {
    font-size: 12.5px;
  }

  .exists-actions {
    gap: 9px;
  }

  .disclaimer {
    margin-top: 3px;
    gap: 5px;
  }

  .disclaimer p {
    font-size: 9.8px;
    line-height: 1.35;
  }
}

/* ─────────────────────────────────────
   MOBILE PEQUENO
───────────────────────────────────── */
@media (max-width: 480px) {
  .hero-image {
    padding: 12px 12px 2px;
  }

  .hero-image::before {
    width: clamp(112px, 30vw, 165px);
    border-width: 4px;
  }

  .form-panel {
    padding: 16px 14px 12px;
  }

  .logo-wrapper {
    margin-bottom: 7px;
  }

  .logo-img {
    width: clamp(100px, 30vw, 145px);
  }

  .form-heading {
    font-size: 17px;
    margin-bottom: 9px;
    line-height: 1.1;
  }

  .registration-form {
    gap: 8px;
  }

  .form-step {
    gap: 8px;
  }

  .field-group {
    gap: 3px;
  }

  .field-label {
    font-size: 12px;
  }

  .field-input {
    height: 40px;
    padding: 0 12px;
    font-size: 13px;
  }

  .consent-text {
    font-size: 11.8px;
  }

  .submit-btn,
  .btn-secondary {
    height: 42px;
    min-height: 42px;
    font-size: 13px;
  }

  .btn-back {
    font-size: 10.5px;
  }

  .form-feedback {
    font-size: 10.5px;
    min-height: 13px;
  }

  .exists-subtitle {
    font-size: 12px;
  }

  .disclaimer p {
    font-size: 9.3px;
    line-height: 1.32;
  }
}

/* ─────────────────────────────────────
   EXTRA SMALL MOBILE
───────────────────────────────────── */
@media (max-width: 360px) {
  .hero-image::before {
    width: clamp(98px, 28vw, 138px);
  }

  .form-panel {
    padding-left: 12px;
    padding-right: 12px;
  }

  .logo-img {
    width: clamp(92px, 30vw, 126px);
  }

  .form-heading {
    font-size: 16px;
  }

  .field-input {
    height: 38px;
    padding: 0 11px;
    font-size: 12.5px;
  }

  .submit-btn,
  .btn-secondary {
    height: 40px;
    min-height: 40px;
    font-size: 12.5px;
  }

  .consent-text {
    font-size: 11.2px;
  }

  .disclaimer p {
    font-size: 9px;
  }
}

/* ─────────────────────────────────────
   MOBILE LANDSCAPE
───────────────────────────────────── */
@media (max-height: 500px) and (orientation: landscape) {
  .page-wrapper {
    flex-direction: row;
  }

  .hero-image {
    flex: 0 0 38%;
    min-height: 100vh;
    padding: 12px;
  }

  .hero-image::before {
    width: clamp(105px, 17vw, 165px);
    border-width: 4px;
  }

  .form-panel {
    min-height: 100vh;
    justify-content: flex-start;
    padding: 16px 14px 12px;
  }

  .logo-wrapper {
    margin-bottom: 6px;
  }

  .logo-img {
    width: clamp(86px, 16vw, 124px);
  }

  .form-heading {
    font-size: 17px;
    margin-bottom: 8px;
  }

  .registration-form {
    gap: 7px;
  }

  .form-step {
    gap: 7px;
  }

  .field-group {
    gap: 3px;
  }

  .field-input,
  .submit-btn,
  .btn-secondary {
    height: 38px;
    min-height: 38px;
  }

  .field-label,
  .consent-text,
  .exists-subtitle,
  .form-feedback,
  .btn-back {
    font-size: 10.5px;
  }

  .exists-title {
    font-size: 15px;
  }

  .disclaimer {
    gap: 4px;
    margin-top: 2px;
  }

  .disclaimer p {
    font-size: 8.6px;
    line-height: 1.26;
  }
}

/* ─────────────────────────────────────
   VERY TALL SCREENS
───────────────────────────────────── */
@media (min-height: 950px) and (min-width: 992px) {
  .form-panel {
    padding-top: 68px;
    padding-bottom: 68px;
  }

  .registration-form {
    gap: 18px;
  }

  .form-step {
    gap: 18px;
  }

  .disclaimer {
    margin-top: 8px;
  }
}

/* ─────────────────────────────────────
   STEP TWO — COMPACTAÇÃO CIRÚRGICA MOBILE
───────────────────────────────────── */
@media (max-width: 768px) {
  .form-panel:has(#step-two:not(.is-hidden)) {
    padding-top: 16px;
    padding-bottom: 14px;
  }

  .form-panel:has(#step-two:not(.is-hidden)) .logo-wrapper {
    margin-bottom: 6px;
  }

  .form-panel:has(#step-two:not(.is-hidden)) .logo-img {
    width: clamp(102px, 28vw, 150px);
  }

  .form-panel:has(#step-two:not(.is-hidden)) .form-heading {
    font-size: clamp(17px, 4.2vw, 23px);
    line-height: 1.08;
    margin-bottom: 8px;
  }

  .page-wrapper:has(#step-two:not(.is-hidden)) .hero-image {
    padding-top: 12px;
    padding-bottom: 2px;
  }

  .page-wrapper:has(#step-two:not(.is-hidden)) .hero-image::before {
    width: clamp(105px, 26vw, 160px);
    border-width: 4px;
  }

  .registration-form:has(#step-two:not(.is-hidden)) {
    gap: 7px;
  }

  #step-two {
    gap: 7px;
  }

  #step-two .field-group {
    gap: 3px;
  }

  #step-two .field-label {
    font-size: 11.5px;
    line-height: 1.15;
  }

  #step-two .field-input {
    height: 38px;
    padding: 0 12px;
    font-size: 13px;
  }

  .registration-form:has(#step-two:not(.is-hidden)) .form-feedback {
    min-height: 12px;
    font-size: 10.5px;
    margin-top: 0;
  }

  .registration-form:has(#step-two:not(.is-hidden)) .btn-back {
    font-size: 10.5px;
    padding: 0;
  }

  .registration-form:has(#step-two:not(.is-hidden)) .submit-btn {
    height: 40px;
    min-height: 40px;
    font-size: 12.5px;
    letter-spacing: 0.01em;
  }

  .registration-form:has(#step-two:not(.is-hidden)) + .disclaimer {
    display: none !important;
  }

  #step-two .autocomplete-list {
    max-height: 160px;
  }
}

/* ─────────────────────────────────────
   STEP TWO — MOBILE PEQUENO
───────────────────────────────────── */
@media (max-width: 480px) {
  .form-panel:has(#step-two:not(.is-hidden)) {
    padding-top: 12px;
    padding-left: 12px;
    padding-right: 12px;
    padding-bottom: 12px;
  }

  .form-panel:has(#step-two:not(.is-hidden)) .logo-wrapper {
    margin-bottom: 5px;
  }

  .form-panel:has(#step-two:not(.is-hidden)) .logo-img {
    width: clamp(92px, 26vw, 128px);
  }

  .form-panel:has(#step-two:not(.is-hidden)) .form-heading {
    font-size: 15px;
    line-height: 1.06;
    margin-bottom: 6px;
  }

  .page-wrapper:has(#step-two:not(.is-hidden)) .hero-image {
    padding-top: 8px;
    padding-bottom: 0;
  }

  .page-wrapper:has(#step-two:not(.is-hidden)) .hero-image::before {
    width: clamp(92px, 24vw, 132px);
  }

  .registration-form:has(#step-two:not(.is-hidden)) {
    gap: 6px;
  }

  #step-two {
    gap: 6px;
  }

  #step-two .field-group {
    gap: 2px;
  }

  #step-two .field-label {
    font-size: 11px;
    line-height: 1.12;
  }

  #step-two .field-input {
    height: 36px;
    padding: 0 11px;
    font-size: 12.5px;
  }

  .registration-form:has(#step-two:not(.is-hidden)) .submit-btn {
    height: 38px;
    min-height: 38px;
    font-size: 12px;
  }

  .registration-form:has(#step-two:not(.is-hidden)) .btn-back {
    font-size: 10px;
  }

  .registration-form:has(#step-two:not(.is-hidden)) .form-feedback {
    font-size: 10px;
    min-height: 11px;
  }
}

/* ─────────────────────────────────────
   STEP TWO — ALTURA BAIXA
───────────────────────────────────── */
@media (max-width: 768px) and (max-height: 760px) {
  .form-panel:has(#step-two:not(.is-hidden)) .logo-wrapper {
    margin-bottom: 4px;
  }

  .form-panel:has(#step-two:not(.is-hidden)) .logo-img {
    width: clamp(88px, 24vw, 118px);
  }

  .form-panel:has(#step-two:not(.is-hidden)) .form-heading {
    font-size: 14px;
    margin-bottom: 5px;
    line-height: 1.04;
  }

  .page-wrapper:has(#step-two:not(.is-hidden)) .hero-image::before {
    width: clamp(82px, 21vw, 112px);
  }

  #step-two .field-input {
    height: 34px;
    font-size: 12px;
  }

  .registration-form:has(#step-two:not(.is-hidden)) .submit-btn {
    height: 36px;
    min-height: 36px;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .form-panel:has(#step-two:not(.is-hidden)) .form-heading {
    font-size: 14px;
    margin-bottom: 4px;
    line-height: 1.02;
  }
}

/* ─────────────────────────────────────
   STEP TWO — DESKTOP MAIS ELEGANTE
───────────────────────────────────── */
@media (min-width: 992px) {
  .form-panel:has(#step-two:not(.is-hidden)) {
    padding-top: 30px;
    padding-bottom: 20px;
  }

  .form-panel:has(#step-two:not(.is-hidden)) .logo-wrapper {
    margin-bottom: 8px;
  }

  .form-panel:has(#step-two:not(.is-hidden)) .logo-img {
    width: clamp(135px, 14vw, 210px);
  }

  .form-panel:has(#step-two:not(.is-hidden)) .form-heading {
    font-size: clamp(20px, 1.8vw, 28px);
    line-height: 1.08;
    margin-bottom: 8px;
  }

  .registration-form:has(#step-two:not(.is-hidden)) {
    gap: 8px;
    max-width: 620px;
  }

  #step-two {
    gap: 8px;
  }

  #step-two .field-group {
    gap: 3px;
  }

  #step-two .field-label {
    font-size: 13px;
    line-height: 1.12;
  }

  #step-two .field-input {
    height: 44px;
    padding: 0 14px;
    font-size: 14px;
  }

  .registration-form:has(#step-two:not(.is-hidden)) .submit-btn {
    height: 44px;
    min-height: 44px;
    font-size: 13px;
  }

  .registration-form:has(#step-two:not(.is-hidden)) .btn-back {
    font-size: 11px;
  }

  .registration-form:has(#step-two:not(.is-hidden)) .form-feedback {
    min-height: 12px;
    font-size: 10px;
  }
}