.main-section {
  width: 100%;
  min-height: 100vh;
  position: relative;
}

.form-container {
  position: relative;
  z-index: 2;
}

.form-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
}

@media (min-width: 768px) {
  .form-wrapper {
    grid-template-columns: minmax(0, auto) 1fr;
    gap: 24px;
  }
}

@media (min-width: 1200px) {
  .form-wrapper {
    grid-template-columns: minmax(0, auto) 1fr;
    gap: 30px;
  }
}

@media (min-width: 1920px) {
  .form-wrapper {
    grid-template-columns: minmax(0, auto) 1fr;
    gap: 40px;
  }
}

.form-header {
  width: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}

.benefits-desktop,
.benefits-mobile {
  display: block;
  width: 100%;
}

.benefits-mobile {
  height: var(--mobile-hero-height);
  object-fit: cover;
  object-position: center;
}

.benefits-desktop {
  display: none;
}

@media screen and (max-width: 320px) {
  .benefits-mobile {
    height: clamp(180px, 34svh, 220px);
  }
}

@media screen and (min-width: 321px) and (max-width: 390px) {
  .benefits-mobile {
    height: clamp(220px, 40svh, 280px);
  }
}

@media screen and (min-width: 391px) and (max-width: 430px) {
  .benefits-mobile {
    height: clamp(240px, 42svh, 310px);
  }
}

@media screen and (min-width: 431px) and (max-width: 767px) {
  .benefits-mobile {
    height: clamp(260px, 46svh, 330px);
  }
}

@media screen and (min-width: 768px) {
  .benefits-desktop {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: calc(100dvh - 140px);
    object-fit: contain;
    object-position: top left;
  }

  .benefits-mobile {
    display: none;
  }
}

.form-body {
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
  width: 100%;
}

@media (min-width: 768px) {
  .form-body {
    max-width: 360px;
    width: 100%;
  }
}

@media (min-width: 1200px) {
  .form-body {
    max-width: 420px;
  }
}

@media (min-width: 1920px) {
  .form-body {
    max-width: 480px;
  }
}

.form-grid {
  display: grid;
  gap: 16px;
}

.form-group {
  position: relative;
  width: 100%;
}

.form-group input:not([type="checkbox"]),
.form-group select {
  width: 100%;
  font-size: 20px;
  height: 50px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--primary);
  color: var(--primary-deep);
  background-color: white;
  font-family: var(--font-primary);
  text-transform: capitalize;
  transition: box-shadow 0.15s ease;
  font-weight: 400;
  -webkit-text-fill-color: var(--primary-deep);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  line-height: 1.2;
}

.form-group input:not([type="checkbox"])::placeholder {
  color: var(--primary);
  opacity: 0.75;
  text-transform: capitalize;
  font-family: var(--font-primary);
  font-weight: 400;
  -webkit-text-fill-color: var(--primary);
}

.form-group select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300adf2' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
  padding-right: 42px;
  color: var(--primary-deep);
  -webkit-text-fill-color: var(--primary-deep);
  font-weight: 400;
}

.form-group select:invalid {
  color: var(--primary);
  -webkit-text-fill-color: var(--primary);
}

.form-group select option {
  color: var(--primary-deep);
  background-color: white;
  font-weight: 400;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(0, 173, 242, 0.3);
  text-transform: capitalize;
  font-weight: 400;
  color: var(--primary-deep);
  -webkit-text-fill-color: var(--primary-deep);
}

.form-group select:focus {
  color: var(--primary-deep);
}

.help_cedula {
  margin: 4px 2px 0;
  font-size: 12px;
  color: var(--primary-light);
  line-height: 1.3;
  text-transform: none;
  font-weight: 400;
  font-family: var(--font-primary);
}

.form-group--phone {
  position: relative;
}

.form-group--phone .iti {
  display: block;
  width: 100%;
}

.form-group--phone .iti__tel-input,
.form-group--phone .form-control {
  width: 100%;
  font-size: 16px;
  height: 50px;
  padding: 0 16px 0 56px;
  border-radius: 8px;
  border: 1px solid var(--primary);
  color: var(--primary-deep);
  background-color: white;
  font-family: var(--font-primary);
  text-transform: capitalize;
  font-weight: 400;
  transition: box-shadow 0.15s ease;
  -webkit-text-fill-color: var(--primary-deep);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  line-height: 1.2;
}

.form-group--phone .iti__tel-input::placeholder,
.form-group--phone .form-control::placeholder {
  color: var(--primary);
  opacity: 0.75;
  -webkit-text-fill-color: var(--primary);
}

.form-group--phone .iti__tel-input:focus,
.form-group--phone .form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(0, 173, 242, 0.3);
  font-weight: 400;
  color: var(--primary-deep);
  -webkit-text-fill-color: var(--primary-deep);
}

.form-group--phone .iti__flag-container {
  background: transparent;
  border: none;
  padding: 0;
}

.form-group--phone .iti__selected-flag {
  background-color: transparent;
  padding: 0 6px 0 12px;
  height: 100%;
  display: flex;
  align-items: center;
}

.form-group--phone .iti__selected-flag:hover {
  background-color: rgba(0, 173, 242, 0.05);
}

.form-group--phone .iti__flag {
  box-shadow: none;
  background-color: transparent;
}

.form-group--phone .iti__arrow {
  border-top-color: var(--primary);
}

.form-footer-layout {
  display: grid;
  gap: 18px;
  margin-top: 4px;
}

.form-footer-layout > .form-group {
  margin-inline: auto;
}

.form-group__checkbox {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px 12px;
  margin-top: 0;
  align-items: start;
}

.form-group__checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
  margin: 4px 0 0;
  border: 2px solid var(--primary-deep);
  border-radius: 2px;
  background-color: transparent;
  display: inline-grid;
  place-content: center;
}

.form-group__checkbox input[type="checkbox"]::before {
  content: "";
  width: 8px;
  height: 4px;
  border: 2px solid #ffffff;
  border-top: 0;
  border-right: 0;
  transform: rotate(-45deg) scale(0);
  transition: transform 0.1s ease-in-out;
}

.form-group__checkbox input[type="checkbox"]:checked {
  background-color: var(--primary-deep);
}

.form-group__checkbox input[type="checkbox"]:checked::before {
  transform: rotate(-45deg) scale(1);
}

.form-group__checkbox .checkbox-content {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.form-group__checkbox label {
  color: var(--primary-deep);
  font-size: 15px;
  line-height: 1.35;
  cursor: pointer;
  font-family: var(--font-primary);
  font-weight: 400;
  margin: 0;
  overflow-wrap: anywhere;
}

.form-group__checkbox--estudiante label {
  font-family: var(--font-bold);
  font-weight: 700;
  color: var(--primary-deep);
  font-size: 17px;
  line-height: 1.25;
}

.form-group__checkbox--secondary label {
  color: var(--primary-deep);
  font-size: 17px;
  font-family: var(--font-primary);
  font-weight: 400;
  line-height: 1.25;
}

.checkbox-help-text {
  font-size: 14px;
  color: var(--primary-light);
  margin: 0;
  line-height: 1.4;
  font-weight: 400;
  text-transform: none;
  font-family: var(--font-primary);
  overflow-wrap: anywhere;
}

.form-group__recaptcha {
  display: flex;
  justify-content: center;
  margin-top: 6px;
  transform: scale(0.9);
  transform-origin: 0 0;
}

.form-group__submit {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.button-submit {
  width: min(100%, 340px);
  height: 56px;
  font-size: 22px;
  background: linear-gradient(90deg, #0051C1 4.13%, #00F9FF 158.99%);
  border: none;
  color: white;
  border-radius: 28px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 24px rgba(0, 96, 197, 0.18);
}

.button-submit span {
  font-family: var(--font-bold);
  font-weight: 700;
  text-transform: uppercase;
}

.button-submit:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.button-submit:active {
  transform: translateY(0);
}

.button-submit:disabled {
  filter: grayscale(0.4);
  cursor: not-allowed;
  transform: none;
}

.button-submit.is-loading {
  filter: grayscale(0.4);
  cursor: not-allowed;
}

.text-danger {
  color: #c92a2a;
  font-size: 12px;
  margin-top: 4px;
  font-family: var(--font-primary);
}

.field-validation-error,
.help_cedula + .text-danger {
  display: block;
  color: #c92a2a;
  font-size: 12px;
  margin-top: 4px;
}

.form-group {
  animation: fadeInUp 0.4s ease-out backwards;
}

.form-group:nth-child(1) { animation-delay: 0.05s; }
.form-group:nth-child(2) { animation-delay: 0.1s; }
.form-group:nth-child(3) { animation-delay: 0.15s; }
.form-group:nth-child(4) { animation-delay: 0.2s; }
.form-group:nth-child(5) { animation-delay: 0.25s; }
.form-group:nth-child(6) { animation-delay: 0.3s; }
.form-group:nth-child(7) { animation-delay: 0.35s; }
.form-group:nth-child(8) { animation-delay: 0.4s; }
.form-group:nth-child(9) { animation-delay: 0.45s; }
.form-group:nth-child(10) { animation-delay: 0.5s; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 767px) {
  body {
    padding: 0 10px 20px;
  }

  .form-header {
    width: calc(100% + 20px);
    margin-inline: -10px;
    border-radius: 0;
  }

  .form-body {
    padding: 0;
    max-width: 360px;
    width: 100%;
    margin: 0 auto;
  }

  .form-grid {
    gap: 12px;
  }

  .form-footer-layout {
    gap: 14px;
  }

  .form-footer-layout > .form-group {
    width: 100%;
  }

  .form-group input,
  .form-group select {
    height: 46px;
    
  }

  .form-group--phone .iti__tel-input,
  .form-group--phone .form-control {
    height: 46px;
    
    padding-left: 50px;
  }

  .form-group__checkbox label {
    font-size: 14px;
  }

  .form-group__checkbox--estudiante label {
    font-size: 14px;
  }

  .form-group__checkbox--secondary label {
    font-size: 14px;
  }

  .button-submit {
    width: 100%;
    height: 50px;
    font-size: 18px;
    border-radius: 16px;
  }
}

@media (min-width: 1024px) {
  .form-grid {
    gap: 18px;
  }
}
