/* Modal de registro de The Babylon Club (se incluye desde partials/tbc-button).
   Cada página puede cambiar la paleta sobrescribiendo estas variables desde su clase de body. */
.tbc-modal {
  --tbc-modal-bg: #00bcd4;
  --tbc-modal-text: #ffffff;
  --tbc-logo-color: #deb043;
  --tbc-logo-bg: var(--tbc-modal-text);
  --tbc-modal-button: var(--tbc-logo-color);
  --tbc-button-text: #1c1c1c;
  --tbc-check-mark: var(--tbc-modal-button);
  --tbc-checkbox-bg: var(--tbc-modal-text);
  --tbc-modal-error: #7a0b1c;
  --tbc-list-bg: #ffffff;
  --tbc-list-text: #1c1c1c;
  --tbc-list-active: #e0f7fa;
  --tbc-list-muted: #777777;
  /* Un único tamaño para todo el texto de la modal salvo el de la casilla.
     16px como mínimo evita el zoom automático de iOS al enfocar los campos. */
  --tbc-font-size: 16px;

  position: fixed;
  inset: 0;
  z-index: 1080;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: var(--tbc-font-size);
  color: var(--tbc-modal-text);
  text-transform: uppercase;
}

.tbc-modal[hidden] {
  display: none;
}

.tbc-modal__backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.35);
  animation: tbc-fade-in 0.2s ease;
}

.tbc-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 872px;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  padding: 28px 48px 56px;
  border-radius: 28px;
  background-color: var(--tbc-modal-bg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  text-align: center;
  animation: tbc-pop-in 0.25s ease;
}

body.tbc-modal-open {
  overflow: hidden;
}

.tbc-modal__close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.tbc-modal__close::before,
.tbc-modal__close::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 2px;
  background-color: var(--tbc-modal-text);
}

.tbc-modal__close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.tbc-modal__close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.tbc-modal__close:hover,
.tbc-modal__close:focus-visible {
  opacity: 0.7;
}

/* Mismo recurso que el botón del header: las letras del SVG son huecos */
.tbc-modal__logo {
  position: relative;
  width: 124px;
  height: 124px;
  margin: 0 auto 24px;
}

.tbc-modal__logo::before,
.tbc-modal__logo::after {
  content: '';
  position: absolute;
}

.tbc-modal__logo::before {
  inset: 12%;
  border-radius: 50%;
  background-color: var(--tbc-logo-bg);
}

.tbc-modal__logo::after {
  inset: 0;
  background-color: var(--tbc-logo-color);
  -webkit-mask: url('../images/home/tbc_black.svg') center / contain no-repeat;
          mask: url('../images/home/tbc_black.svg') center / contain no-repeat;
}

.tbc-modal__title {
  margin: 0 0 40px;
  font-size: var(--tbc-font-size);
  font-weight: bold;
  line-height: 1.25;
}

.tbc-form {
  max-width: 466px;
  margin: 0 auto;
  text-align: left;
}

.tbc-field {
  position: relative;
  margin-bottom: 18px;
}

.tbc-input {
  display: block;
  width: 100%;
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid var(--tbc-modal-text);
  border-radius: 0;
  background: transparent;
  color: var(--tbc-modal-text);
  font-family: inherit;
  font-size: var(--tbc-font-size);
  text-transform: uppercase;
}

.tbc-input::placeholder {
  color: var(--tbc-modal-text);
  opacity: 1;
}

.tbc-input:focus {
  border-bottom-width: 2px;
  padding-bottom: 3px;
}

.tbc-field.has-error .tbc-input {
  border-bottom-color: var(--tbc-modal-error);
}

.tbc-error {
  margin: 4px 0 0;
  min-height: 0;
  color: var(--tbc-modal-error);
  font-size: var(--tbc-font-size) !important;
  font-weight: bold;
  line-height: 1.2;
}

.tbc-error:empty {
  display: none;
}

.tbc-error--form {
  text-align: center;
}

/* Selector de país con buscador */
.tbc-combobox__control {
  position: relative;
}

.tbc-combobox__input {
  padding-right: 20px;
  cursor: pointer;
}

.tbc-combobox__input:focus {
  cursor: text;
}

.tbc-combobox__arrow {
  position: absolute;
  top: 6px;
  right: 4px;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--tbc-modal-text);
  pointer-events: none;
  transition: transform 0.2s ease;
}

.tbc-combobox.is-open .tbc-combobox__arrow {
  transform: rotate(180deg);
}

.tbc-combobox__list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 2;
  /* Cabe en el espacio que queda bajo el campo sin que la modal lo recorte */
  max-height: 160px;
  margin: 4px 0 0;
  padding: 4px 0;
  overflow-y: auto;
  list-style: none;
  border-radius: 8px;
  background-color: var(--tbc-list-bg);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.tbc-combobox__option,
.tbc-combobox__empty {
  padding: 7px 12px;
  color: var(--tbc-list-text);
  font-size: var(--tbc-font-size);
  line-height: 1.2;
  text-transform: uppercase;
}

.tbc-combobox__option {
  cursor: pointer;
}

/* Anula los estilos genéricos de li:hover de app.css y onlylove.css */
.tbc-combobox__option:hover {
  color: var(--tbc-list-text) !important;
  font-size: var(--tbc-font-size);
  font-weight: normal;
}

.tbc-combobox__option.is-active {
  background-color: var(--tbc-list-active);
}

.tbc-combobox__option[aria-selected='true'] {
  font-weight: bold;
}

.tbc-combobox__empty {
  color: var(--tbc-list-muted);
  font-style: italic;
}

/* Casilla obligatoria: es más ancha que el formulario para que el texto quepa en dos líneas */
.tbc-consent {
  --tbc-consent-width: min(700px, calc(100vw - 144px));
  width: var(--tbc-consent-width);
  margin-top: 28px;
  margin-left: calc((100% - var(--tbc-consent-width)) / 2);
}

.tbc-consent__label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.tbc-consent__check {
  -webkit-appearance: none;
          appearance: none;
  position: relative;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin: 2px 0 0;
  border: 1px solid var(--tbc-modal-text);
  background-color: var(--tbc-checkbox-bg);
  cursor: pointer;
}

.tbc-consent__check:checked::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 4px;
  width: 4px;
  height: 8px;
  border: solid var(--tbc-check-mark);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.tbc-consent__check:focus-visible {
  outline: 2px solid var(--tbc-check-mark) !important;
  outline-offset: 2px;
}

.tbc-field.has-error .tbc-consent__check {
  border-color: var(--tbc-modal-error);
  box-shadow: 0 0 0 1px var(--tbc-modal-error);
}

.tbc-consent__text {
  display: flex;
  flex-direction: column;
  font-size: 10px !important;
  line-height: 1.35;
  text-transform: uppercase;
}

.tbc-submit {
  display: block;
  margin: 36px auto 0;
  padding: 10px 18px;
  border: 0;
  border-radius: 20px;
  background-color: var(--tbc-modal-button);
  color: var(--tbc-button-text);
  font-family: inherit;
  font-size: var(--tbc-font-size);
  text-transform: uppercase;
  cursor: pointer;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

.tbc-submit:hover,
.tbc-submit:focus-visible {
  filter: brightness(1.15);
}

.tbc-submit:disabled {
  opacity: 0.6;
  cursor: wait;
}

.tbc-modal__step[hidden] {
  display: none;
}

.tbc-success {
  padding-top: 32px;
}

.tbc-success__title {
  margin-bottom: 16px;
}

.tbc-success__title:focus {
  outline: none;
}

.tbc-modal__logo--large {
  width: 270px;
  height: 270px;
  margin-bottom: 32px;
}

.tbc-success__button {
  margin-top: 0;
  padding: 10px 44px;
}

@keyframes tbc-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes tbc-pop-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 576px) {
  .tbc-modal {
    padding: 12px;
  }

  .tbc-modal__dialog {
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    padding: 24px 24px 40px;
    border-radius: 22px;
  }

  .tbc-modal__logo {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
  }

  .tbc-modal__title {
    margin-bottom: 30px;
  }

  .tbc-form {
    max-width: none;
  }

  /* En móvil no hay margen para ensancharla: ocupa el ancho del formulario */
  .tbc-consent {
    width: auto;
    margin-left: 0;
  }

  .tbc-success {
    padding-top: 24px;
  }

  .tbc-modal__logo--large {
    width: 200px;
    height: 200px;
    margin-bottom: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tbc-modal__backdrop,
  .tbc-modal__dialog {
    animation: none;
  }
}
