/* =========================================================
   BANANA FRIENDS · AUTH NATIVO PRODUCCIÓN
   Login, registro y recuperación sin iframe
========================================================= */

html.bf-auth-gate-open,
body.bf-auth-gate-open {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

body.bf-auth-gate-open {
  width: 100% !important;
}

.bf-auth-gate,
.bf-auth-gate *,
.bf-auth-gate *::before,
.bf-auth-gate *::after {
  box-sizing: border-box;
}

.bf-auth-gate[hidden],
.bf-auth-gate [hidden] {
  display: none !important;
}

.bf-auth-gate {
  --bf-auth-accent: #ff004f;
  --bf-auth-accent-hover: #e90049;
  --bf-auth-accent-soft: #fff0f5;
  --bf-auth-ink: #171719;
  --bf-auth-muted: #6f6f76;
  --bf-auth-line: rgba(25, 25, 28, 0.12);
  --bf-auth-control-bg: #f6f6f8;
  --bf-auth-viewport-height: 100dvh;
  --bf-auth-viewport-width: 100vw;
  --bf-auth-viewport-top: 0px;
  --bf-auth-viewport-left: 0px;
  --bf-auth-drag-opacity: 1;
  position: fixed !important;
  top: var(--bf-auth-viewport-top) !important;
  right: auto !important;
  bottom: auto !important;
  left: var(--bf-auth-viewport-left) !important;
  width: var(--bf-auth-viewport-width) !important;
  height: var(--bf-auth-viewport-height) !important;
  z-index: 100000 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 22px !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 220ms ease, visibility 220ms ease;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

.bf-auth-gate.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.bf-auth-gate-backdrop {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: rgba(18, 18, 21, calc(0.42 * var(--bf-auth-drag-opacity))) !important;
  backdrop-filter: blur(16px) saturate(125%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(125%) !important;
  cursor: default;
}

.bf-auth-gate-card {
  position: relative !important;
  z-index: 2 !important;
  display: flex !important;
  flex-direction: column !important;
  width: min(480px, calc(100vw - 44px)) !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: calc(var(--bf-auth-viewport-height) - 44px) !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 1px solid #ffffff !important;
  border-radius: 28px !important;
  background: #ffffff !important;
  box-shadow: 0 34px 100px rgba(18, 18, 22, 0.24), 0 4px 18px rgba(18, 18, 22, 0.08) !important;
  transform: translateY(14px) scale(0.985) !important;
  opacity: 0;
  transition: transform 260ms cubic-bezier(.22, .8, .26, 1), opacity 200ms ease, width 220ms ease !important;
  outline: none !important;
}

.bf-auth-gate.is-register-view .bf-auth-gate-card {
  width: min(900px, calc(100vw - 44px)) !important;
}

.bf-auth-gate.is-open .bf-auth-gate-card {
  transform: translateY(0) scale(1) !important;
  opacity: 1;
}

.bf-auth-gate-card.is-dragging {
  transition: none !important;
}

.bf-auth-gate-handle {
  display: none;
}

.bf-auth-gate-header {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 92px !important;
  padding: 22px 64px 16px !important;
  border: 0 !important;
  background: transparent !important;
  flex: 0 0 auto !important;
  touch-action: pan-x;
}

.bf-auth-gate-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  min-width: 0;
  text-align: left;
}

.bf-auth-gate-logo {
  display: block;
  width: 36px !important;
  height: 36px !important;
  flex: 0 0 36px;
  object-fit: contain;
  user-select: none;
}

.bf-auth-gate-heading > div {
  min-width: 0;
}

.bf-auth-gate-heading h2 {
  margin: 0 !important;
  color: var(--bf-auth-ink) !important;
  font-size: clamp(1.36rem, 2vw, 1.65rem) !important;
  font-weight: 800 !important;
  letter-spacing: -0.045em !important;
  line-height: 1.08 !important;
}

.bf-auth-gate-heading p {
  margin: 5px 0 0 !important;
  color: var(--bf-auth-muted) !important;
  font-size: 0.82rem !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
}

.bf-auth-gate-close {
  position: absolute !important;
  top: 20px !important;
  right: 20px !important;
  display: grid !important;
  place-items: center !important;
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: #f1f1f3 !important;
  color: #2a2a2e !important;
  box-shadow: none !important;
  cursor: pointer !important;
  transition: transform 150ms ease, background-color 150ms ease !important;
}

.bf-auth-gate-close:hover {
  background: #e8e8eb !important;
  transform: scale(1.04) !important;
}

.bf-auth-gate-close:active {
  transform: scale(0.94) !important;
}

.bf-auth-gate-close svg {
  width: 18px !important;
  height: 18px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2.25 !important;
  stroke-linecap: round !important;
}

.bf-auth-gate-content {
  display: block !important;
  width: 100% !important;
  min-height: 0 !important;
  padding: 0 26px 24px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(30, 30, 35, 0.2) transparent;
}

.bf-auth-gate-content::-webkit-scrollbar {
  width: 6px;
}

.bf-auth-gate-content::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(30, 30, 35, 0.18);
}

.bf-native-auth-panel {
  width: 100%;
  margin: 0 auto;
  animation: bf-auth-panel-in 180ms ease both;
}

.bf-auth-gate.is-login-view .bf-native-auth-panel,
.bf-auth-gate.is-reset-view .bf-native-auth-panel {
  max-width: 420px;
}

@keyframes bf-auth-panel-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.bf-native-auth-form,
.bf-auth-gate .registro-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bf-auth-gate .bf-auth-field {
  display: flex !important;
  flex-direction: column !important;
  gap: 7px !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--bf-auth-ink) !important;
}

.bf-auth-gate .bf-auth-field-label {
  display: block !important;
  margin: 0 0 0 2px !important;
  color: #343438 !important;
  font-size: 0.79rem !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
}

.bf-auth-gate .bf-auth-field small,
.bf-auth-gate .bf-auth-field-hint {
  display: block;
  min-height: 16px;
  margin: -1px 2px 0 !important;
  color: #818188 !important;
  font-size: 0.7rem !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
}

.bf-auth-gate .bf-auth-control {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  min-height: 50px !important;
  overflow: hidden !important;
  border: 1px solid var(--bf-auth-line) !important;
  border-radius: 15px !important;
  background: var(--bf-auth-control-bg) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease !important;
}

.bf-auth-gate .bf-auth-control:focus-within {
  border-color: rgba(255, 0, 79, 0.58) !important;
  background: #fff !important;
  box-shadow: 0 0 0 4px rgba(255, 0, 79, 0.1) !important;
}

.bf-auth-gate .bf-auth-control input,
.bf-auth-gate .bf-auth-control select,
.bf-auth-gate .bf-auth-control textarea {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 48px !important;
  margin: 0 !important;
  padding: 0 15px !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  color: var(--bf-auth-ink) !important;
  box-shadow: none !important;
  font: inherit !important;
  font-size: 0.94rem !important;
  font-weight: 550 !important;
  line-height: 1.2 !important;
  appearance: none;
  -webkit-appearance: none;
}

.bf-auth-gate .bf-auth-control textarea {
  min-height: 104px !important;
  padding-top: 13px !important;
  padding-bottom: 13px !important;
  resize: vertical !important;
}

.bf-auth-gate .bf-auth-control input::placeholder,
.bf-auth-gate .bf-auth-control textarea::placeholder {
  color: #9a9aa0 !important;
  opacity: 1 !important;
}

.bf-auth-gate .bf-auth-control--phone .bf-auth-phone-prefix {
  display: grid !important;
  place-items: center !important;
  align-self: stretch !important;
  min-width: 54px !important;
  padding-left: 4px !important;
  border-right: 1px solid var(--bf-auth-line) !important;
  color: #45454a !important;
  font-size: 0.9rem !important;
  font-weight: 750 !important;
}

.bf-auth-gate .bf-auth-control--phone input {
  padding-left: 13px !important;
}

.bf-auth-gate .bf-auth-control--password input {
  padding-right: 84px !important;
}

.bf-auth-gate .bf-auth-password-toggle {
  position: absolute !important;
  top: 50% !important;
  right: 8px !important;
  width: auto !important;
  min-width: 0 !important;
  height: 34px !important;
  min-height: 34px !important;
  margin: 0 !important;
  padding: 0 9px !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: transparent !important;
  color: var(--bf-auth-accent) !important;
  box-shadow: none !important;
  transform: translateY(-50%) !important;
  font-size: 0.75rem !important;
  font-weight: 750 !important;
  cursor: pointer !important;
}

.bf-auth-gate .bf-auth-control--select::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid #707078;
  border-bottom: 2px solid #707078;
  transform: translateY(-68%) rotate(45deg);
  pointer-events: none;
}

.bf-auth-gate .bf-auth-control--select select {
  padding-right: 42px !important;
}

.bf-auth-gate .bf-auth-control--date input {
  color-scheme: light;
}

.bf-auth-form-meta {
  display: flex;
  justify-content: flex-end;
  margin-top: -3px;
}

.bf-auth-text-button,
.bf-auth-panel-switch button,
.bf-auth-gate .registro-resend-btn {
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 3px 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--bf-auth-accent) !important;
  box-shadow: none !important;
  font: inherit !important;
  font-size: 0.78rem !important;
  font-weight: 750 !important;
  line-height: 1.25 !important;
  cursor: pointer !important;
  text-decoration: none !important;
}

.bf-auth-primary-button,
.bf-auth-secondary-button,
.bf-auth-gate .registro-btn,
.bf-auth-gate .glass-modal-btn.primary {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 9px !important;
  width: 100% !important;
  min-height: 50px !important;
  margin: 0 !important;
  padding: 0 20px !important;
  border: 1px solid var(--bf-auth-accent) !important;
  border-radius: 999px !important;
  background: var(--bf-auth-accent) !important;
  background-image: none !important;
  color: #fff !important;
  box-shadow: 0 12px 28px rgba(255, 0, 79, 0.2) !important;
  font: inherit !important;
  font-size: 0.92rem !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  transition: transform 150ms ease, background-color 150ms ease, box-shadow 150ms ease, opacity 150ms ease !important;
}

.bf-auth-primary-button:hover,
.bf-auth-gate .registro-btn:not(.secondary):hover,
.bf-auth-gate .glass-modal-btn.primary:hover {
  background: var(--bf-auth-accent-hover) !important;
  border-color: var(--bf-auth-accent-hover) !important;
  box-shadow: 0 15px 32px rgba(255, 0, 79, 0.25) !important;
  transform: translateY(-1px) !important;
}

.bf-auth-primary-button:active,
.bf-auth-secondary-button:active,
.bf-auth-gate .registro-btn:active {
  transform: scale(0.985) !important;
}

.bf-auth-primary-button:disabled,
.bf-auth-gate .registro-btn:disabled {
  opacity: 0.58 !important;
  cursor: wait !important;
  transform: none !important;
}

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

.bf-auth-secondary-button,
.bf-auth-gate .registro-btn.secondary {
  border-color: var(--bf-auth-line) !important;
  background: #fff !important;
  color: #343438 !important;
  box-shadow: none !important;
}

.bf-auth-panel-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 17px;
  color: #74747b;
  font-size: 0.79rem;
  font-weight: 550;
  text-align: center;
}

.bf-auth-panel-switch--top {
  margin: 0 0 18px;
}

.bf-auth-panel-switch button {
  font-size: inherit !important;
}

.bf-auth-gate .form-message {
  display: block;
  margin: 0 !important;
  padding: 11px 13px !important;
  border: 1px solid rgba(32, 32, 36, 0.08) !important;
  border-radius: 13px !important;
  background: #f5f5f7 !important;
  color: #45454a !important;
  font-size: 0.77rem !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  text-align: center !important;
}

.bf-auth-gate .form-message.error {
  border-color: rgba(208, 34, 75, 0.18) !important;
  background: #fff0f4 !important;
  color: #a6133a !important;
}

.bf-auth-gate .form-message.success {
  border-color: rgba(21, 128, 61, 0.16) !important;
  background: #effaf3 !important;
  color: #166534 !important;
}

/* Registro */
.bf-auth-gate .registro,
.bf-auth-gate .registro-card,
.bf-auth-gate #registroForm {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.bf-auth-gate .registro-progress {
  position: relative;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 8px !important;
  width: 100% !important;
  margin: 0 0 22px !important;
  padding: 0 !important;
}

.bf-auth-gate .registro-progress span {
  position: relative;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  min-width: 0 !important;
  min-height: 54px !important;
  margin: 0 !important;
  padding: 6px !important;
  border: 1px solid var(--bf-auth-line) !important;
  border-radius: 14px !important;
  background: #f7f7f9 !important;
  color: #8a8a91 !important;
  box-shadow: none !important;
}

.bf-auth-gate .registro-progress span b {
  display: grid !important;
  place-items: center !important;
  width: 24px !important;
  height: 24px !important;
  border-radius: 50% !important;
  background: #e7e7ea !important;
  color: #6f6f76 !important;
  font-size: 0.73rem !important;
  font-weight: 800 !important;
}

.bf-auth-gate .registro-progress span small {
  margin: 0 !important;
  color: inherit !important;
  font-size: 0.67rem !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}

.bf-auth-gate .registro-progress span.active {
  border-color: rgba(255, 0, 79, 0.22) !important;
  background: var(--bf-auth-accent-soft) !important;
  color: var(--bf-auth-accent) !important;
}

.bf-auth-gate .registro-progress span.active b,
.bf-auth-gate .registro-progress span.is-complete b {
  background: var(--bf-auth-accent) !important;
  color: #fff !important;
}

.bf-auth-gate .registro-progress span.is-complete {
  color: #4d4d52 !important;
}

.bf-auth-gate .registro-step {
  display: none !important;
  width: 100% !important;
}

.bf-auth-gate .registro-step.active {
  display: block !important;
  animation: bf-auth-panel-in 180ms ease both;
}

.bf-auth-gate .registro-title {
  margin: 0 !important;
  color: var(--bf-auth-ink) !important;
  font-size: 1.13rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.025em !important;
  line-height: 1.2 !important;
  text-align: center !important;
}

.bf-auth-gate .registro-sub {
  max-width: 590px;
  margin: 5px auto 18px !important;
  color: var(--bf-auth-muted) !important;
  font-size: 0.78rem !important;
  font-weight: 500 !important;
  line-height: 1.45 !important;
  text-align: center !important;
}

.bf-auth-gate .bf-register-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  align-items: start !important;
  gap: 14px !important;
  margin: 0 !important;
}

.bf-auth-gate .bf-register-demographics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
  grid-column: 1 / -1;
}

.bf-auth-gate .bf-auth-field--birthdate,
.bf-auth-gate .bf-auth-field--gender {
  align-self: start;
}

.bf-auth-gate .bf-auth-date-help.is-valid,
.bf-auth-gate .bf-auth-field.is-valid .bf-auth-date-help {
  color: #15803d !important;
}

.bf-auth-gate .bf-auth-field.is-invalid .bf-auth-control {
  border-color: rgba(208, 34, 75, 0.52) !important;
  box-shadow: 0 0 0 4px rgba(208, 34, 75, 0.08) !important;
}

.bf-auth-gate .bf-auth-field.is-invalid .bf-auth-date-help {
  color: #b42348 !important;
}

.bf-auth-gate .bf-auth-privacy-note {
  margin: 14px 0 0 !important;
  color: #85858c !important;
  font-size: 0.69rem !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
  text-align: center !important;
}

.bf-auth-gate .registro-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  margin: 18px 0 0 !important;
}

.bf-auth-gate .registro-actions > span:empty {
  display: none !important;
}

.bf-auth-gate .registro-actions .registro-btn {
  width: auto !important;
  min-width: 142px !important;
}

.bf-auth-gate .registro-actions .registro-btn.secondary {
  min-width: 112px !important;
}

.bf-auth-gate .bf-auth-step-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 0, 79, 0.12);
  border-radius: 15px;
  background: var(--bf-auth-accent-soft);
  color: #54545a;
}

.bf-auth-gate .bf-auth-step-note > span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 50%;
  background: var(--bf-auth-accent);
  color: #fff;
  font-size: 0.73rem;
  font-weight: 900;
}

.bf-auth-gate .bf-auth-step-note p {
  margin: 1px 0 0;
  font-size: 0.75rem;
  line-height: 1.45;
}

.bf-auth-gate .registro-resend {
  margin-top: 16px !important;
  text-align: center !important;
}

.bf-auth-gate .registro-resend-btn:disabled {
  color: #96969c !important;
  cursor: default !important;
}

.bf-auth-gate .registro-resend-hint,
.bf-auth-gate .registro-hint,
.bf-auth-gate .rp-hint {
  margin: 7px auto 0 !important;
  color: #85858c !important;
  font-size: 0.7rem !important;
  line-height: 1.4 !important;
  text-align: center !important;
}

.bf-auth-gate .registro-avatar {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 13px !important;
  max-width: 520px !important;
  margin: 0 auto !important;
}

.bf-auth-gate .registro-avatar > img {
  width: 104px !important;
  height: 104px !important;
  border: 4px solid #fff !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  box-shadow: 0 12px 30px rgba(20, 20, 24, 0.15) !important;
}

.bf-auth-gate #avatarInput {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
}

.bf-auth-gate .bf-auth-field--bio {
  width: 100% !important;
}

/* Recuperación */
.bf-auth-gate .sheet-steps {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin: 0 0 18px;
}

.bf-auth-gate .sheet-steps span {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: #dedee2;
  transition: width 180ms ease, background-color 180ms ease;
}

.bf-auth-gate .sheet-steps span.active {
  width: 24px;
  background: var(--bf-auth-accent);
}

.bf-auth-gate .rp-step {
  display: none;
}

.bf-auth-gate .rp-step.active {
  display: block;
}

/* Modal de aviso del registro */
.bf-auth-gate .glass-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  background: rgba(18, 18, 21, 0.34);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.bf-auth-gate .glass-modal-overlay.open {
  display: block;
}

.bf-auth-gate .glass-modal {
  position: fixed;
  z-index: 21;
  top: 50%;
  left: 50%;
  display: none;
  width: min(360px, calc(100vw - 38px));
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 28px 80px rgba(20, 20, 24, 0.22);
  transform: translate(-50%, -50%);
  text-align: center;
}

.bf-auth-gate .glass-modal.open {
  display: block;
}

.bf-auth-gate .glass-modal h3 {
  margin: 0 0 7px;
  color: var(--bf-auth-ink);
  font-size: 1.05rem;
  font-weight: 800;
}

.bf-auth-gate .glass-modal p {
  margin: 0 0 16px;
  color: var(--bf-auth-muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

/* Móvil: hoja nativa iOS desde abajo y altura de contenido */
@media (max-width: 760px) {
  .bf-auth-gate {
    align-items: flex-end !important;
    justify-content: stretch !important;
    padding: 0 !important;
  }

  .bf-auth-gate-backdrop {
    background: rgba(18, 18, 21, calc(0.38 * var(--bf-auth-drag-opacity))) !important;
    backdrop-filter: blur(12px) saturate(120%) !important;
    -webkit-backdrop-filter: blur(12px) saturate(120%) !important;
  }

  .bf-auth-gate-card,
  .bf-auth-gate.is-login-view .bf-auth-gate-card,
  .bf-auth-gate.is-register-view .bf-auth-gate-card,
  .bf-auth-gate.is-reset-view .bf-auth-gate-card {
    width: 100% !important;
    max-width: none !important;
    max-height: calc(var(--bf-auth-viewport-height) - 8px) !important;
    margin: 0 !important;
    border-width: 1px 0 0 !important;
    border-radius: 28px 28px 0 0 !important;
    box-shadow: 0 -16px 52px rgba(18, 18, 22, 0.2) !important;
    transform: translateY(calc(100% + 18px)) !important;
    opacity: 1;
    padding-bottom: env(safe-area-inset-bottom) !important;
    transition: transform 320ms cubic-bezier(.22, .8, .22, 1) !important;
  }

  .bf-auth-gate.is-open .bf-auth-gate-card {
    transform: translateY(var(--bf-auth-drag-y, 0px)) !important;
  }

  .bf-auth-gate-handle {
    display: block;
    width: 40px;
    height: 5px;
    flex: 0 0 auto;
    margin: 9px auto 0;
    border-radius: 99px;
    background: #d4d4d8;
    touch-action: none;
  }

  .bf-auth-gate-header {
    min-height: 71px !important;
    padding: 12px 58px 10px 20px !important;
    justify-content: flex-start !important;
  }

  .bf-auth-gate-heading {
    justify-content: flex-start;
    gap: 9px;
  }

  .bf-auth-gate-logo {
    width: 29px !important;
    height: 29px !important;
    flex-basis: 29px;
  }

  .bf-auth-gate-heading h2 {
    font-size: 1.28rem !important;
    white-space: nowrap;
  }

  .bf-auth-gate-heading p {
    max-width: 245px;
    margin-top: 3px !important;
    overflow: hidden;
    font-size: 0.72rem !important;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .bf-auth-gate-close {
    top: 17px !important;
    right: 16px !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
  }

  .bf-auth-gate-content {
    padding: 3px 18px 18px !important;
  }

  .bf-auth-gate.is-login-view .bf-auth-gate-content,
  .bf-auth-gate.is-reset-view .bf-auth-gate-content {
    overflow-y: visible !important;
  }

  .bf-native-auth-form,
  .bf-auth-gate .registro-stack {
    gap: 12px;
  }

  .bf-auth-gate .bf-auth-control {
    min-height: 49px !important;
    border-radius: 14px !important;
  }

  .bf-auth-gate .bf-auth-control input,
  .bf-auth-gate .bf-auth-control select {
    min-height: 47px !important;
    font-size: 16px !important;
  }

  .bf-auth-primary-button,
  .bf-auth-secondary-button,
  .bf-auth-gate .registro-btn {
    min-height: 49px !important;
  }

  .bf-auth-panel-switch {
    margin-top: 14px;
    padding-bottom: 2px;
  }

  .bf-auth-gate .registro-progress {
    gap: 6px !important;
    margin-bottom: 18px !important;
  }

  .bf-auth-gate .registro-progress span {
    min-height: 46px !important;
    padding: 5px 2px !important;
    border-radius: 12px !important;
  }

  .bf-auth-gate .registro-progress span b {
    width: 21px !important;
    height: 21px !important;
    font-size: 0.66rem !important;
  }

  .bf-auth-gate .registro-progress span small {
    font-size: 0.59rem !important;
  }

  .bf-auth-gate .bf-register-grid,
  .bf-auth-gate .bf-register-demographics {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  .bf-auth-gate .registro-title {
    font-size: 1.06rem !important;
  }

  .bf-auth-gate .registro-sub {
    margin-bottom: 15px !important;
  }

  .bf-auth-gate .registro-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    margin-top: 16px !important;
  }

  .bf-auth-gate .registro-actions .registro-btn {
    width: 100% !important;
    min-width: 0 !important;
  }

  .bf-auth-gate .registro-actions .registro-btn:only-child,
  .bf-auth-gate .registro-actions > span + .registro-btn:last-child {
    grid-column: 1 / -1;
  }

  .bf-auth-gate .registro-avatar > img {
    width: 92px !important;
    height: 92px !important;
  }
}

@media (max-width: 390px) {
  .bf-auth-gate-header {
    padding-left: 16px !important;
  }

  .bf-auth-gate-heading p {
    max-width: 210px;
  }

  .bf-auth-gate-content {
    padding-right: 15px !important;
    padding-left: 15px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bf-auth-gate,
  .bf-auth-gate *,
  .bf-auth-gate *::before,
  .bf-auth-gate *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Página directa de acceso */
html:has(body.bf-auth-standalone),
body.bf-auth-standalone {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: #f5f5f7;
}

body.bf-auth-standalone {
  overflow: hidden;
}

.bf-auth-standalone-background {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 0, 79, 0.08), transparent 34%),
    radial-gradient(circle at 82% 78%, rgba(255, 173, 38, 0.1), transparent 36%),
    linear-gradient(180deg, #fbfbfc 0%, #f3f3f5 100%);
}

.bf-auth-standalone-brand {
  position: absolute;
  top: 24px;
  left: 28px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #18181b;
  text-decoration: none;
  font: 800 1.05rem/1 Inter, -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  letter-spacing: -0.035em;
}

.bf-auth-standalone-brand img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.bf-auth-standalone-glow {
  position: absolute;
  left: 50%;
  bottom: -260px;
  width: min(760px, 90vw);
  height: 480px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  filter: blur(50px);
  transform: translateX(-50%);
}

@media (max-width: 760px) {
  .bf-auth-standalone-brand {
    top: max(16px, env(safe-area-inset-top));
    left: 18px;
  }

  .bf-auth-standalone-brand img {
    width: 27px;
    height: 27px;
  }
}

/* =========================================================
   AJUSTE REAL iPHONE · MODAL COMPACTO Y CONTROLES LIMPIOS
   Mantiene la lógica; corrige la altura impuesta por premium-ui.
========================================================= */

/* El componente nativo siempre manda sobre los antiguos tamaños fijos. */
body.bf-web-page .bf-auth-gate .bf-auth-gate-card,
body.bf-auth-standalone .bf-auth-gate .bf-auth-gate-card {
  width: min(480px, calc(100vw - 44px)) !important;
  height: auto !important;
  min-height: 0 !important;
  max-width: 480px !important;
  max-height: calc(var(--bf-auth-viewport-height) - 44px) !important;
  flex: 0 0 auto !important;
}

body.bf-web-page .bf-auth-gate.is-register-view .bf-auth-gate-card,
body.bf-auth-standalone .bf-auth-gate.is-register-view .bf-auth-gate-card {
  width: min(900px, calc(100vw - 44px)) !important;
  max-width: 900px !important;
}

.bf-auth-gate .bf-auth-gate-header {
  justify-content: flex-start !important;
  border-color: #ffffff !important;
  background: #ffffff !important;
}

.bf-auth-gate .bf-auth-gate-heading {
  width: 100% !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
}

.bf-auth-gate .bf-auth-gate-logo {
  width: 27px !important;
  height: 27px !important;
  flex: 0 0 27px !important;
  margin-top: 0 !important;
}

/* Mostrar queda centrado exactamente dentro del campo. */
.bf-auth-gate .bf-auth-password-toggle {
  top: 0 !important;
  right: 8px !important;
  bottom: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 9px !important;
  transform: none !important;
  border: 0 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  line-height: 1 !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

/* Enlaces de texto: sin pastillas, fondos, subrayados ni capas globales. */
.bf-auth-gate :is(.bf-auth-text-button, .bf-auth-panel-switch button, .registro-resend-btn) {
  border: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  filter: none !important;
  text-decoration: none !important;
  text-shadow: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

.bf-auth-gate :is(.bf-auth-text-button, .bf-auth-panel-switch button, .registro-resend-btn)::before,
.bf-auth-gate :is(.bf-auth-text-button, .bf-auth-panel-switch button, .registro-resend-btn)::after,
.bf-auth-gate .bf-liquid-sheen,
.bf-auth-gate .bf-liquid-ripple {
  display: none !important;
  content: none !important;
}

@media (max-width: 760px) {
  body.bf-web-page .bf-auth-gate .bf-auth-gate-card,
  body.bf-auth-standalone .bf-auth-gate .bf-auth-gate-card,
  body.bf-web-page .bf-auth-gate.is-login-view .bf-auth-gate-card,
  body.bf-web-page .bf-auth-gate.is-register-view .bf-auth-gate-card,
  body.bf-web-page .bf-auth-gate.is-reset-view .bf-auth-gate-card {
    align-self: flex-end !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: calc(var(--bf-auth-viewport-height) - 14px) !important;
    flex: 0 0 auto !important;
    border-width: 1px 0 0 !important;
    border-radius: 28px 28px 0 0 !important;
  }

  .bf-auth-gate .bf-auth-gate-header {
    min-height: 66px !important;
    padding: 10px 56px 9px 20px !important;
    justify-content: flex-start !important;
    border-top-color: #ffffff !important;
    background: #ffffff !important;
  }

  .bf-auth-gate .bf-auth-gate-heading {
    width: 100% !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    text-align: left !important;
  }

  .bf-auth-gate .bf-auth-gate-logo {
    width: 25px !important;
    height: 25px !important;
    flex-basis: 25px !important;
    margin-top: 0 !important;
  }

  .bf-auth-gate .bf-auth-gate-heading h2 {
    font-size: 1.18rem !important;
    line-height: 1.08 !important;
    white-space: nowrap !important;
  }

  .bf-auth-gate .bf-auth-gate-heading p {
    max-width: 260px !important;
    margin-top: 3px !important;
    overflow: visible !important;
    font-size: 0.7rem !important;
    line-height: 1.25 !important;
    text-overflow: clip !important;
    white-space: normal !important;
  }

  .bf-auth-gate .bf-auth-gate-close {
    top: 17px !important;
    right: 15px !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
  }

  .bf-auth-gate .bf-auth-gate-content {
    flex: 0 1 auto !important;
    min-height: 0 !important;
    padding: 2px 18px calc(18px + env(safe-area-inset-bottom)) !important;
  }

  .bf-auth-gate.is-login-view .bf-auth-gate-content,
  .bf-auth-gate.is-reset-view .bf-auth-gate-content {
    overflow-y: visible !important;
  }

  .bf-auth-gate .bf-auth-panel-switch {
    padding-bottom: 0 !important;
  }
}

/* iPhone: al abrir el teclado la hoja ocupa el viewport visual completo.
   Evita que Safari desplace la página y deje ver el contenido de fondo. */
@media (max-width: 760px) {
  .bf-auth-gate.is-keyboard-open {
    align-items: stretch !important;
    background: #ffffff !important;
  }

  .bf-auth-gate.is-keyboard-open .bf-auth-gate-backdrop {
    background: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body.bf-web-page .bf-auth-gate.is-keyboard-open .bf-auth-gate-card,
  body.bf-auth-standalone .bf-auth-gate.is-keyboard-open .bf-auth-gate-card,
  .bf-auth-gate.is-keyboard-open .bf-auth-gate-card {
    align-self: stretch !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    max-height: 100% !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    box-shadow: none !important;
    padding-bottom: 0 !important;
    transform: none !important;
  }

  .bf-auth-gate.is-keyboard-open .bf-auth-gate-handle {
    display: none !important;
  }

  .bf-auth-gate.is-keyboard-open .bf-auth-gate-header {
    position: relative !important;
    z-index: 3 !important;
    flex: 0 0 auto !important;
    padding-top: max(10px, env(safe-area-inset-top)) !important;
    border: 0 !important;
    background: #ffffff !important;
  }

  .bf-auth-gate.is-keyboard-open .bf-auth-gate-content {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 18px !important;
    background: #ffffff !important;
  }

  .bf-auth-gate.is-keyboard-open .bf-auth-gate-close {
    top: max(13px, env(safe-area-inset-top)) !important;
  }
}

@media (max-width: 390px) {
  .bf-auth-gate .bf-auth-gate-header {
    padding-right: 52px !important;
    padding-left: 16px !important;
  }

  .bf-auth-gate .bf-auth-gate-heading p {
    max-width: 238px !important;
  }

  .bf-auth-gate .bf-auth-gate-content {
    padding-right: 15px !important;
    padding-left: 15px !important;
  }
}


/* =========================================================
   AUTH PRODUCCIÓN · CABECERA UNIFICADA + RECUPERACIÓN SES
   Login, registro y recuperación comparten exactamente el
   mismo lenguaje visual y los mismos estados de interacción.
========================================================= */

.bf-auth-gate .bf-auth-gate-header,
.bf-auth-gate.is-login-view .bf-auth-gate-header,
.bf-auth-gate.is-register-view .bf-auth-gate-header,
.bf-auth-gate.is-reset-view .bf-auth-gate-header {
  min-height: 94px !important;
  padding: 20px 66px 17px 22px !important;
  border: 0 !important;
  background: #ffffff !important;
}

.bf-auth-gate .bf-auth-gate-heading {
  display: flex !important;
  width: 100% !important;
  min-width: 0 !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  text-align: left !important;
}

.bf-auth-gate .bf-auth-gate-logo-shell {
  display: grid !important;
  place-items: center !important;
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  flex: 0 0 42px !important;
  border: 1px solid rgba(255, 0, 79, 0.10) !important;
  border-radius: 14px !important;
  background: linear-gradient(145deg, #fff8fa 0%, #fff0f5 100%) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

.bf-auth-gate .bf-auth-gate-logo-shell .bf-auth-gate-logo {
  display: block !important;
  width: 27px !important;
  height: 27px !important;
  min-width: 0 !important;
  flex: none !important;
  margin: 0 !important;
  object-fit: contain !important;
}

.bf-auth-gate .bf-auth-gate-copy {
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

.bf-auth-gate .bf-auth-gate-copy h2 {
  margin: 0 !important;
  color: var(--bf-auth-ink) !important;
  font-size: 1.42rem !important;
  font-weight: 820 !important;
  letter-spacing: -0.045em !important;
  line-height: 1.05 !important;
}

.bf-auth-gate .bf-auth-gate-copy p {
  max-width: 560px !important;
  margin: 5px 0 0 !important;
  color: var(--bf-auth-muted) !important;
  font-size: 0.79rem !important;
  font-weight: 520 !important;
  line-height: 1.35 !important;
  white-space: normal !important;
}

.bf-auth-gate .rp-destination {
  margin: 0 !important;
  padding: 11px 13px !important;
  border: 1px solid rgba(255, 0, 79, 0.12) !important;
  border-radius: 13px !important;
  background: var(--bf-auth-accent-soft) !important;
  color: #9d1640 !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  text-align: center !important;
}

.bf-auth-gate .rp-inline-actions {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
  width: 100% !important;
}

.bf-auth-gate .rp-inline-actions .bf-auth-secondary-button {
  min-width: 0 !important;
  padding-inline: 12px !important;
}

.bf-auth-gate #rpResendBtn:disabled {
  color: #8d8d93 !important;
  opacity: 0.72 !important;
  cursor: default !important;
}

.bf-auth-gate #rpResendCountdown:empty {
  display: none !important;
}

.bf-auth-gate .rp-step.active {
  animation: bf-auth-panel-in 180ms ease both;
}

@media (max-width: 760px) {
  .bf-auth-gate .bf-auth-gate-header,
  .bf-auth-gate.is-login-view .bf-auth-gate-header,
  .bf-auth-gate.is-register-view .bf-auth-gate-header,
  .bf-auth-gate.is-reset-view .bf-auth-gate-header {
    min-height: 76px !important;
    padding: 11px 56px 10px 17px !important;
  }

  .bf-auth-gate .bf-auth-gate-heading {
    align-items: center !important;
    gap: 10px !important;
  }

  .bf-auth-gate .bf-auth-gate-logo-shell {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    flex-basis: 38px !important;
    border-radius: 13px !important;
  }

  .bf-auth-gate .bf-auth-gate-logo-shell .bf-auth-gate-logo {
    width: 24px !important;
    height: 24px !important;
  }

  .bf-auth-gate .bf-auth-gate-copy h2 {
    font-size: 1.22rem !important;
    line-height: 1.06 !important;
    white-space: nowrap !important;
  }

  .bf-auth-gate .bf-auth-gate-copy p {
    max-width: 255px !important;
    margin-top: 3px !important;
    overflow: visible !important;
    font-size: 0.69rem !important;
    line-height: 1.3 !important;
    text-overflow: clip !important;
    white-space: normal !important;
  }

  .bf-auth-gate .rp-inline-actions {
    gap: 8px !important;
  }

  .bf-auth-gate .rp-inline-actions .bf-auth-secondary-button {
    min-height: 47px !important;
    font-size: 0.76rem !important;
  }
}

@media (max-width: 365px) {
  .bf-auth-gate .bf-auth-gate-copy h2 {
    font-size: 1.12rem !important;
  }

  .bf-auth-gate .bf-auth-gate-copy p {
    max-width: 220px !important;
    font-size: 0.66rem !important;
  }
}

/* =========================================================
   iOS · TECLADO SÓLIDO PARA LOGIN, REGISTRO Y RECUPERACIÓN
   El fondo blanco cubre el layout viewport completo y la tarjeta
   sigue únicamente el visualViewport situado encima del teclado.
========================================================= */
html.bf-auth-keyboard-open,
body.bf-auth-keyboard-open {
  overflow: hidden !important;
  overscroll-behavior: none !important;
  background: #ffffff !important;
}

@media (max-width: 760px) {
  .bf-auth-gate.is-keyboard-open {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    min-height: 100vh !important;
    padding: 0 !important;
    overflow: hidden !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    background: #ffffff !important;
    touch-action: none !important;
    contain: strict !important;
  }

  @supports (height: 100lvh) {
    .bf-auth-gate.is-keyboard-open {
      height: 100lvh !important;
      min-height: 100lvh !important;
    }
  }

  /* Escudo independiente de la tarjeta. Aunque Safari desplace el
     visual viewport durante la animación, nunca queda visible la web. */
  .bf-auth-gate.is-keyboard-open::before {
    content: "" !important;
    position: fixed !important;
    z-index: 0 !important;
    inset: -4px !important;
    display: block !important;
    width: calc(100vw + 8px) !important;
    height: calc(100vh + 8px) !important;
    background: #ffffff !important;
    pointer-events: none !important;
  }

  @supports (height: 100lvh) {
    .bf-auth-gate.is-keyboard-open::before {
      height: calc(100lvh + 8px) !important;
    }
  }

  .bf-auth-gate.is-keyboard-open .bf-auth-gate-backdrop {
    position: fixed !important;
    z-index: 1 !important;
    inset: -4px !important;
    width: calc(100vw + 8px) !important;
    height: calc(100vh + 8px) !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    pointer-events: none !important;
  }

  @supports (height: 100lvh) {
    .bf-auth-gate.is-keyboard-open .bf-auth-gate-backdrop {
      height: calc(100lvh + 8px) !important;
    }
  }

  body.bf-web-page .bf-auth-gate.is-keyboard-open .bf-auth-gate-card,
  body.bf-auth-standalone .bf-auth-gate.is-keyboard-open .bf-auth-gate-card,
  .bf-auth-gate.is-keyboard-open .bf-auth-gate-card {
    position: fixed !important;
    z-index: 2 !important;
    top: var(--bf-auth-viewport-top) !important;
    right: auto !important;
    bottom: auto !important;
    left: var(--bf-auth-viewport-left) !important;
    align-self: auto !important;
    width: var(--bf-auth-viewport-width) !important;
    min-width: var(--bf-auth-viewport-width) !important;
    max-width: var(--bf-auth-viewport-width) !important;
    height: var(--bf-auth-viewport-height) !important;
    min-height: var(--bf-auth-viewport-height) !important;
    max-height: var(--bf-auth-viewport-height) !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    box-shadow: none !important;
    transform: none !important;
    transition: none !important;
    opacity: 1 !important;
    contain: layout paint !important;
    touch-action: none !important;
  }

  .bf-auth-gate.is-keyboard-open .bf-auth-gate-header {
    position: relative !important;
    z-index: 3 !important;
    width: 100% !important;
    flex: 0 0 auto !important;
    border: 0 !important;
    background: #ffffff !important;
    touch-action: none !important;
  }

  .bf-auth-gate.is-keyboard-open .bf-auth-gate-content {
    position: relative !important;
    z-index: 2 !important;
    width: 100% !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    background: #ffffff !important;
    touch-action: pan-y !important;
  }

  .bf-auth-gate.is-keyboard-open :is(input, textarea, select, button) {
    touch-action: manipulation !important;
  }
}
