/* ==========================================================================
   REGISTRATION – STEP 1 (form fields, modal, WA button, CTA)
   ========================================================================== */

/* ---- Fields (custom form) ---- */
.becas-register .field { display: block; margin-bottom: 16px; }
.becas-register .field__label { display: block; margin-bottom: 8px; font-size: .95rem; color: var(--text-default); }
.becas-register input[type="text"],
.becas-register input[type="email"],
.becas-register input[type="password"],
.becas-register select {
  width: 100%; height: 42px; font-size: 0.8rem;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--input-bg); padding: 0 14px; color: var(--text-strong);
}
@media (min-width: 1024px) {
  .becas-register input[type="text"],
  .becas-register input[type="email"],
  .becas-register input[type="password"],
  .becas-register select { font-size: 0.9rem; }
}
.becas-register select {
  padding-right: 36px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  appearance: none;
}
.becas-register input::placeholder { color: #8A8A8A; }
.becas-register input:focus,
.becas-register select:focus {
  outline: none; border-color: var(--brand-blue-500); box-shadow: var(--shadow-focus);
}
.becas-register .field.has-error input,
.becas-register .field.has-error select { border-color: #DC2626; }
.becas-register .field__error { margin: 6px 0 0 0; color: #B91C1C; font-size: .875rem; }

/* ---- Split row (selector + documento) ---- */
.becas-register .row--split {
  display: grid; grid-template-columns: 40% 1fr; gap: 16px; align-items: center;
}
.becas-register .row--split .field { min-width: 0; }
@media (max-width: 375px) { .becas-register .row--split { grid-template-columns: 1fr; } }
@media (max-width: 640px) and (min-width: 376px) {
  .becas-register .row--split { grid-template-columns: 3fr 2fr; }
}
@media (min-width: 401px) and (max-width: 480px) {
  .becas-register .row--split { grid-template-columns: 13fr 12fr; }
  .becas-register select {
    -webkit-appearance: menulist; appearance: auto;
    background-image: none; padding-right: 14px; position: static !important; z-index: auto !important;
  }
}
@media (max-width: 375px) {
  .becas-register select {
    -webkit-appearance: menulist; appearance: auto;
    background-image: none; padding-right: 14px; position: static !important; z-index: auto !important;
  }
}

/* ---- Password field with eye ---- */
.becas-register .field__password {
  position: relative; display: grid; grid-template-columns: 1fr 42px; align-items: stretch;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--input-bg); overflow: hidden;
}
.becas-register .field__password:focus-within {
  border-color: var(--brand-blue-500); box-shadow: var(--shadow-focus);
}
.becas-register .field__password input {
  height: 42px; border: 0; background: transparent; padding: 0 12px; border-radius: 0; box-shadow: none;
}
.becas-register .field__password input:focus { outline: none; box-shadow: none; }
.becas-register .btn-eye,
.becas-register .becas-eye {
  height: 42px; width: 42px; border: 0; background: transparent;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.becas-register .btn-eye i,
.becas-register .becas-eye i { color: #98A2B3; font-size: 16px; line-height: 1; }
.becas-register .btn-eye:focus,
.becas-register .becas-eye:focus { outline: none; }
.becas-register .field.has-error .field__password { border-color: #DC2626; }

/* ---- Legal & CTA ---- */
.becas-register .legal { font-size: .95rem; color: var(--text-default); margin: 8px 0 16px 0; }
.becas-register .legal a { text-decoration: underline; }
.becas-register .legal--mobile { display: none; }
@media (max-width: 640px) {
  .becas-register .legal--desktop { display: none; }
  .becas-register .legal--mobile { display: flex; align-items: center; gap: 10px; }
}
.becas-register form.register-form #terms:not(:checked) ~ .btn--cta { opacity: .5; pointer-events: none; }
.becas-register .btn--cta {
  height: 48px; padding: 0 28px; border-radius: var(--radius-pill);
  background: linear-gradient(180deg, #C85545 0%, #C04439 100%);
  color: #fff; font-weight: 700; border: 0;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 8px 24px rgba(193,69,58,.35); margin: 16px auto 0 auto;
}
.becas-register .btn--cta:hover { filter: brightness(1.03); }
.becas-register .btn--cta[aria-busy="true"] { opacity: .7; pointer-events: none; }
@media (max-width: 640px) { .becas-register .btn--cta { height: 42px; } }

/* ---- WhatsApp help (Step 1 only) ---- */
#page-auth-becasauth-register-step1 .becas-help {
  position: fixed; right: 100px; bottom: 100px; z-index: 3001;
  display: inline-flex; align-items: center; gap: 10px;
  height: 48px; font-weight: 700; border-radius: 999px;
  background: linear-gradient(to bottom, #4aa947 0%, #357a32 100%);
  border: 1px solid #357a32; padding: 0 0 0 16px; overflow: hidden;
  color: #fff !important;
}
#page-auth-becasauth-register-step1 .becas-help .wa-label {
  line-height: 1;
  color: #fff !important;
}
#page-auth-becasauth-register-step1 .becas-help .wa-icon {
  width: 46px; height: 46px; margin-left: 0; margin-right: -1px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #357a32; border: 1px solid #357a32;
}
#page-auth-becasauth-register-step1 .becas-help .wa-icon .fa,
#page-auth-becasauth-register-step1 .becas-help .wa-icon .fab,
#page-auth-becasauth-register-step1 .becas-help .wa-icon .fa-brands {
  color: #fff;
  font-size: 26pt;
}
@media (max-width: 576px) {
  #page-auth-becasauth-register-step1 .becas-help {
    left: 50%; right: auto; transform: translateX(-50%); bottom: 24px;
  }
}

/* ---- Error modal (Step 1 only) ---- */
.becas-register .becas-modal {
  position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 2000;
}
.becas-register .becas-modal.is-open { display: flex; }
.becas-register .becas-modal__backdrop {
  position: absolute; inset: 0; background: rgba(16, 24, 40, .6); backdrop-filter: saturate(120%) blur(1px);
}
.becas-register .becas-modal__dialog {
  position: relative; background: linear-gradient(180deg, #C85545 0%, #C04439 100%); color: #fff;
  width: min(720px, calc(100% - 48px)); border-radius: 24px; padding: 65px 28px;
  text-align: center; box-shadow: 0 24px 64px rgba(16, 24, 40, .45);
}
@media (max-width: 576px) {
  .becas-register .becas-modal__dialog { width: min(420px, calc(100% - 32px)); border-radius: 16px; padding: 60px 20px; }
}
.becas-register .becas-modal__icon {
  width: 70px; height: 70px; border-radius: 50%; border: 4px solid rgba(255,255,255,.9);
  display: inline-flex; align-items: center; justify-content: center; font-size: 40px; font-weight: 700; line-height: 1;
  margin: 6px auto 16px;
}
.becas-register .becas-modal__title { font-size: clamp(22px, 2.2vw, 28px); font-weight: 400; margin: 8px 0 16px 0; }
.becas-register .becas-modal__text { font-size: 16px; line-height: 1.4; margin: 0 6% 32px 6%; color: #fff; opacity: .95; }
@media (min-width: 992px) {
  .becas-register .becas-modal__text { margin-left: 24%; margin-right: 24%; }
}
.becas-register .becas-modal__actions {
  display: flex; flex-direction: column; gap: 12px; align-items: stretch; justify-content: center;
  max-width: 420px; margin: 0 auto;
}
.becas-register .becas-modal__btn {
  height: 44px; border-radius: 999px; padding: 0 22px; font-weight: 700; border: 0;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none; width: 100%;
}
.becas-register .becas-modal__btn--primary { background: #fff; color: #B33E34; }
.becas-register .becas-modal__btn--secondary { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.85); font-weight: 400; }

/* ---- WhatsApp visibility with modal (Step 1 only) ---- */
html.modal-open #page-auth-becasauth-register-step1 .becas-help { display: inline-flex !important; }
html:not(.modal-open) #page-auth-becasauth-register-step1 .becas-help { display: none !important; }
