/* ============================================================
   v2 contact bubble + modal (components/v2/contact.html.twig, js/v2/contact.js).
   No maquette: the legacy contact (bubble + #modal-section) in the v2 look.
   The modal content comes from templates/contact/ (shared with the legacy pages,
   untouched): base_v2 loads none of the legacy CSS, so the minimum is restyled
   here, scoped under #bf-contact-modal. UIkit (tabs, switcher, grid, inputs,
   checkbox) and the libraries' own CSS (intl-tel-input, FormValidation, select2,
   loaded with the form) do the rest.
   ============================================================ */

/* ---- Bubble ---- */

/* The legacy bubble (components/contact.html.twig + common.css #wa__toggle), ported as is:
   a 76px yellow disc (opacity .9) holding the general-contact icon, which wobbles, over a
   pulsing yellow fill (104px) and a pulsing yellow ring (154px), all centred on the disc.
   Same sizes, offsets and timings as legacy, measured on a legacy page; keyframes renamed
   bf-contact-* so they never clash with common.css. The button is the disc: the only click
   target. The ring and the fill overflow it, pointer-events: none, so they never block the
   page underneath. Fixed, so showing it shifts nothing. Under the header (1000) and the
   mobile menu (1001); UIkit's modal (1010) covers it. Hidden (and out of the tab order)
   until js/v2/contact.js sees half a viewport of scroll, as the legacy bubble. */
.bf-contact-bubble {
  position: fixed;
  right: 24px;
  bottom: calc(34px + env(safe-area-inset-bottom, 0px));
  z-index: calc(var(--bf-z-header) - 20);
  width: 76px;
  height: 76px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--bf-dur) var(--bf-ease), transform var(--bf-dur) var(--bf-ease),
              visibility 0s linear var(--bf-dur);
}

.bf-contact-bubble.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity var(--bf-dur) var(--bf-ease), transform var(--bf-dur) var(--bf-ease);
}

.bf-contact-bubble__ring,
.bf-contact-bubble__fill,
.bf-contact-bubble__disc {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

/* legacy .circlephone: 150px + 2px border */
.bf-contact-bubble__ring {
  top: -39px;
  left: -39px;
  width: 154px;
  height: 154px;
  border: 2px solid var(--bf-c-yellow);
  box-sizing: border-box;
  opacity: .5;
  animation: bf-contact-ring 2.4s infinite ease-in-out;
}

/* legacy .circle-fill: 100px + 2px transparent border */
.bf-contact-bubble__fill {
  top: -14px;
  left: -14px;
  width: 104px;
  height: 104px;
  background: var(--bf-c-yellow);
  opacity: .2;
  animation: bf-contact-fill 2.3s infinite ease-in-out;
}

/* legacy .img-circle: the yellow disc, .9 at rest and 1 on hover */
.bf-contact-bubble__disc {
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bf-c-yellow);
  opacity: .9;
  transition: opacity var(--bf-dur) var(--bf-ease);
}

/* legacy .img-circleblock: the 60px icon at its natural size */
.bf-contact-bubble__icon {
  display: block;
  width: 60px;
  height: 60px;
  animation: bf-contact-toss 1.5s infinite;
}

/* Hover / focus: the legacy hover (the disc goes fully opaque). The previous v2 black/yellow
   swap would put the dark icon on a black disc. Focus also gets the v2 gold outline. */
.bf-contact-bubble:focus-visible {
  outline: 2px solid var(--bf-c-gold);
  outline-offset: 3px;
}

.bf-contact-bubble:focus-visible .bf-contact-bubble__disc {
  opacity: 1;
}

@media (hover: hover) {
  .bf-contact-bubble:hover .bf-contact-bubble__disc {
    opacity: 1;
  }
}

@keyframes bf-contact-ring {
  0% { transform: rotate(0deg) scale(.5) skew(1deg); opacity: .1; }
  30% { transform: rotate(0deg) scale(.7) skew(1deg); opacity: .5; }
  100% { transform: rotate(0deg) scale(1) skew(1deg); opacity: .1; }
}

@keyframes bf-contact-fill {
  0% { transform: rotate(0deg) scale(.7) skew(1deg); opacity: .2; }
  50% { transform: rotate(0deg) scale(1) skew(1deg); opacity: .2; }
  100% { transform: rotate(0deg) scale(.7) skew(1deg); opacity: .2; }
}

@keyframes bf-contact-toss {
  0% { transform: rotate(-8deg); }
  50% { transform: rotate(8deg); }
  100% { transform: rotate(-8deg); }
}

/* Legacy breakpoint (1200px, UIkit @l): the bubble moves 25px left and 30px up. */
@media (min-width: 1200px) {
  .bf-contact-bubble {
    right: 49px;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }
}

/* Reduced motion: no reveal slide, no pulse, no wobble; the ring and the fill stay at rest. */
@media (prefers-reduced-motion: reduce) {
  .bf-contact-bubble,
  .bf-contact-bubble.is-visible {
    transform: none;
    transition: none;
  }

  .bf-contact-bubble__ring,
  .bf-contact-bubble__fill,
  .bf-contact-bubble__icon {
    animation: none;
  }
}

/* ---- Modal ---- */

/* UIkit caps the dialog with max-width: calc(100% - .01px) !important: the width is the knob. */
#bf-contact-modal .bf-contact-modal__dialog {
  width: 560px;
  border-radius: var(--bf-radius-btn);
  font-family: var(--bf-font-body);
  color: var(--bf-c-black);
}

#bf-contact-modal .bf-contact-modal__body {
  padding: 32px 20px 24px;
}

#bf-contact-modal .bf-contact-modal__close {
  color: var(--bf-c-black);
}

#bf-contact-modal .bf-contact-modal__close:focus-visible {
  outline: 2px solid var(--bf-c-gold);
  outline-offset: 2px;
}

/* The content's .uk-container would add its gutters inside the modal. */
#bf-contact-modal .contact.uk-container {
  padding: 0;
}

#bf-contact-modal .contact h2 {
  margin: 0 0 8px;
  padding-right: 32px; /* clear of the close button */
  font: 400 32px/1 var(--bf-font-display);
  text-transform: uppercase;
  color: var(--bf-c-black);
}

#bf-contact-modal .contact p {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--bf-c-ink-idle);
}

/* Tabs "Soy nuevo / Soy fitboxer" (uk-tab). The content's uk-margin-remove (!important) drops
   UIkit's -20px tab offset: the items lose their 20px gutter instead, so the first tab lines up
   with the title, and the base line starts at the edge. */
#bf-contact-modal .uk-tab::before {
  left: 0;
}

#bf-contact-modal .uk-tab > * {
  padding-left: 0;
}

#bf-contact-modal .uk-tab > * + * {
  margin-left: 24px;
}

#bf-contact-modal .uk-tab > * > a {
  padding: 10px 0;
  border-bottom-width: 2px;
  font: 400 16px/1 var(--bf-font-display);
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--bf-c-ink-idle);
}

#bf-contact-modal .uk-tab > .uk-active > a {
  border-color: var(--bf-c-gold);
  color: var(--bf-c-black);
}

#bf-contact-modal .contact-options.uk-padding,
#bf-contact-modal .bg-ffffff.uk-padding {
  padding: 20px 0 0;
}

#bf-contact-modal .contact-options {
  font-size: 14px;
  line-height: 1.45;
  color: var(--bf-c-ink-idle);
}

/* Phone / WhatsApp rows (div[data-href], opened by the content's initModal) */
#bf-contact-modal .contact-choice {
  padding: 12px 8px;
  border: 1px solid var(--bf-c-line-light);
  border-radius: var(--bf-radius-btn);
  color: var(--bf-c-black);
  cursor: pointer;
  transition: background-color var(--bf-dur) var(--bf-ease);
}

#bf-contact-modal .contact-choice .uk-text-uppercase {
  font: 400 16px/1.1 var(--bf-font-display);
  letter-spacing: .03em;
}

#bf-contact-modal .contact-choice .telephone-number {
  font-size: 14px;
  color: var(--bf-c-ink-idle);
}

@media (hover: hover) {
  #bf-contact-modal .contact-choice:hover {
    background: var(--bf-c-sand);
  }
}

/* "Te llamamos" form */
#bf-contact-modal .call-me {
  margin-top: 8px;
}

#bf-contact-modal .form-header {
  padding: 12px 0 8px;
  font: 400 18px/1 var(--bf-font-display);
  letter-spacing: .03em;
  color: var(--bf-c-black);
}

#bf-contact-modal .call-me .uk-padding-small {
  padding-left: 0;
  padding-right: 0;
}

#bf-contact-modal .form-field {
  margin-top: 12px;
}

#bf-contact-modal .form-field > label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--bf-c-ink-idle);
}

#bf-contact-modal .uk-input {
  height: 48px;
  border: 1px solid var(--bf-c-grey-200);
  border-radius: var(--bf-radius-field);
  font-family: var(--bf-font-body);
  font-size: 16px; /* no zoom on focus in iOS Safari */
  color: var(--bf-c-black);
}

#bf-contact-modal .uk-input:focus {
  border-color: var(--bf-c-black);
}

#bf-contact-modal .uk-input.uk-form-danger {
  border-color: #c00;
}

#bf-contact-modal .iti {
  display: block;
  width: 100%;
}

#bf-contact-modal .checkbox-field label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--bf-c-ink-idle);
  cursor: pointer;
}

/* The legacy custom checkbox needs the legacy CSS: the native uk-checkbox stays. */
#bf-contact-modal .checkmark {
  display: none;
}

#bf-contact-modal .uk-checkbox {
  flex: none;
  margin-top: 1px;
}

#bf-contact-modal .uk-checkbox:checked {
  background-color: var(--bf-c-black);
}

#bf-contact-modal #view-terms {
  color: var(--bf-c-black);
  text-decoration: underline;
}

#bf-contact-modal #legal-terms {
  padding: 12px;
  border: 1px solid var(--bf-c-line-light);
  font-size: 13px;
}

/* FormValidation messages */
#bf-contact-modal .fv-plugins-message-container {
  margin-top: 4px;
  font-size: 13px;
  color: #c00;
}

/* Submit: the v2 primary CTA */
#bf-contact-modal #submit-call {
  height: 52px;
  border: 0;
  border-radius: var(--bf-radius-btn);
  background: var(--bf-c-yellow);
  font: 400 18px/52px var(--bf-font-display);
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--bf-c-black);
  transition: background-color var(--bf-dur) var(--bf-ease), color var(--bf-dur) var(--bf-ease);
}

#bf-contact-modal #submit-call:focus-visible {
  outline: 2px solid var(--bf-c-gold);
  outline-offset: 2px;
}

@media (hover: hover) {
  #bf-contact-modal #submit-call:hover {
    background: var(--bf-c-black);
    color: var(--bf-c-yellow);
  }
}

/* Fitboxer tab: the numbered steps */
#bf-contact-modal .number-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bf-c-black);
  font: 400 16px/1 var(--bf-font-display);
  color: var(--bf-c-yellow);
}

#bf-contact-modal .step {
  min-height: 40px;
}

/* ---- Desktop (UIkit @m) ---- */

@media (min-width: 960px) {
  #bf-contact-modal .bf-contact-modal__body {
    padding: 40px 40px 32px;
  }

  #bf-contact-modal .contact h2 {
    font-size: 38px;
  }
}
