/* ==========================================================================
   WIFICOR LOGIN V11.5
   Hoja autónoma, aislada y escalable.
   - Fondo dinámico real mediante etiquetas IMG.
   - Zoom progresivo continuo y perceptible, sin retroceso.
   - Formulario libre, sin tarjeta ni panel lateral.
   - Móvil desplazable con fondo estable y sin líneas duplicadas al refrescar.
   - Sin Bootstrap, AdminLTE, jQuery ni reglas añadidas como parches.
   ========================================================================== */

:root {
  --wfl-accent: #1687ff;
  --wfl-accent-soft: rgba(22, 135, 255, 0.22);
  --wfl-ink: #0f172a;
  --wfl-muted: #708198;
  --wfl-line: rgba(148, 163, 184, 0.42);
  --wfl-control-bg: rgba(255, 255, 255, 0.94);
  --wfl-control-h: 43px;
  --wfl-form-w: 342px;
  --wfl-radius: 7px;
  --wfl-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --wfl-bg-position: center center;
  --wfl-bg-origin: 50% 50%;
}

html {
  width: 100%;
  min-height: 100%;
  background: #06101e;
  color-scheme: light;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body.wfl-body {
  width: 100%;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--wfl-ink);
  background: #06101e;
  font-family: var(--wfl-font);
  font-size: 14px;
  line-height: 1.45;
  overscroll-behavior-y: auto;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

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

.wfl-body *,
.wfl-body *::before,
.wfl-body *::after {
  box-sizing: border-box;
}

.wfl-body button,
.wfl-body input,
.wfl-body select {
  font: inherit;
}

.wfl-body button,
.wfl-body summary,
.wfl-body a {
  -webkit-tap-highlight-color: transparent;
}

.wfl-body [hidden] {
  display: none !important;
}

/* Escena principal -------------------------------------------------------- */
.wfl-shell,
.wfl-shell--immersive {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  isolation: isolate;
}

.wfl-hero,
.wfl-hero--fullscreen {
  position: fixed;
  inset: 0;
  z-index: 0;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  color: #fff;
  background: #071321;
  pointer-events: none;
}

.wfl-hero-media,
.wfl-hero-shade,
.wfl-hero-grid {
  position: absolute;
  inset: 0;
}

/* Fondo real y estable ----------------------------------------------------
 * La imagen base permanece visible en todo momento. En escritorio se
 * superponen dos copias animadas con desfase de medio ciclo. Ambas avanzan
 * siempre hacia una escala mayor y se cruzan con opacidad; nunca retroceden.
 * El navegador descarga una sola URL y reutiliza el recurso desde caché.
 */
.wfl-hero-media {
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 72% 26%, rgba(38, 110, 173, 0.34), transparent 39%),
    linear-gradient(135deg, #15273c, #07111f);
  contain: paint;
  transform: translateZ(0);
}

.wfl-hero-image {
  position: absolute;
  display: block;
  max-width: none;
  object-fit: cover;
  object-position: var(--wfl-bg-position);
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.wfl-hero-image--base {
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.wfl-hero-image--motion {
  inset: -7%;
  width: 114%;
  height: 114%;
  z-index: 1;
  opacity: 0;
  transform-origin: var(--wfl-bg-origin);
  will-change: transform, opacity;
}

/* Escritorio: zoom continuo visible. Un ciclo activo dura media animación. */
@media (min-width: 901px) {
  .wfl-hero-image--motion {
    display: block !important;
    animation: wfl-forward-zoom 22s linear infinite;
  }

  .wfl-hero-image--motion-b {
    animation-delay: -11s;
  }
}

@keyframes wfl-forward-zoom {
  0% {
    opacity: 0;
    transform: translate3d(-0.9%, -0.45%, 0) scale(1.00);
  }
  6% {
    opacity: 1;
    transform: translate3d(-0.65%, -0.32%, 0) scale(1.025);
  }
  50% {
    opacity: 1;
    transform: translate3d(1.15%, 0.62%, 0) scale(1.245);
  }
  56% {
    opacity: 0;
    transform: translate3d(1.42%, 0.76%, 0) scale(1.275);
  }
  100% {
    opacity: 0;
    transform: translate3d(1.42%, 0.76%, 0) scale(1.275);
  }
}

.wfl-hero-shade {
  z-index: 1;
  background:
    radial-gradient(circle at 25% 20%, rgba(255, 255, 255, 0.075), transparent 31%),
    radial-gradient(circle at 82% 46%, rgba(2, 9, 21, 0.14), rgba(2, 9, 21, 0.44) 52%, transparent 76%),
    linear-gradient(90deg, rgba(2, 8, 20, 0.70) 0%, rgba(4, 13, 28, 0.49) 48%, rgba(2, 9, 21, 0.58) 100%),
    linear-gradient(180deg, rgba(2, 6, 23, 0.06), rgba(2, 6, 23, 0.46));
}

.wfl-hero-grid {
  z-index: 2;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: linear-gradient(to bottom right, rgba(0, 0, 0, 0.72), transparent 80%);
  -webkit-mask-image: linear-gradient(to bottom right, rgba(0, 0, 0, 0.72), transparent 80%);
}

/* Presentación izquierda ------------------------------------------------- */
.wfl-hero-content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(700px, calc(100vw - 500px));
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(44px, 5vw, 82px);
}

.wfl-brandline {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: clamp(50px, 8vh, 88px);
}

.wfl-brandmark,
.wfl-mobile-logo {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.wfl-brandmark {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  border-radius: 14px;
  box-shadow: 0 15px 36px rgba(0, 0, 0, 0.23);
}

.wfl-brandmark img,
.wfl-mobile-logo img {
  display: block;
  width: 86%;
  height: 86%;
  object-fit: contain;
}

.wfl-brand-name {
  min-width: 0;
  color: #fff;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.45px;
}

.wfl-brand-name small {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wfl-hero-mark {
  width: 58px;
  height: 3px;
  margin-bottom: 22px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,.98), rgba(255,255,255,.2));
  box-shadow: 0 0 22px rgba(255,255,255,.15);
}

.wfl-hero-title {
  max-width: 620px;
  margin: 0;
  color: #fff;
  font-size: clamp(43px, 5vw, 72px);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.055em;
  text-wrap: balance;
  text-shadow: 0 9px 30px rgba(0, 0, 0, 0.24);
}

.wfl-hero-copy {
  max-width: 585px;
  margin: 21px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 15px;
  line-height: 1.72;
}

/* Formulario flotante ----------------------------------------------------- */
.wfl-login-panel,
.wfl-login-panel--overlay {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding:
    max(34px, env(safe-area-inset-top, 0px))
    clamp(48px, 5vw, 92px)
    max(92px, calc(42px + env(safe-area-inset-bottom, 0px)));
  pointer-events: none;
}

.wfl-form-shell,
.wfl-form-shell--floating {
  position: relative;
  width: min(100%, var(--wfl-form-w));
  margin: auto 0;
  padding: 0;
  color: #fff;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  pointer-events: auto;
}

.wfl-mobile-brand {
  display: none;
}

.wfl-form-head {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  margin: 0 72px 17px 0;
}

.wfl-user-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  color: #fff;
  background: #1267e9;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 11px;
  box-shadow: 0 11px 24px rgba(0, 75, 201, 0.34);
}

.wfl-form-title {
  margin: 0;
  color: #fff;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.58px;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.28);
}

.wfl-form-subtitle {
  margin: 4px 0 0;
  color: rgba(226, 235, 246, 0.8);
  font-size: 11px;
  font-weight: 550;
}

/* País ------------------------------------------------------------------- */
.wfl-country-corner {
  position: absolute;
  top: 1px;
  right: 0;
  z-index: 8;
}

.wfl-country-picker {
  position: relative;
}

.wfl-country-picker > summary {
  list-style: none;
}

.wfl-country-picker > summary::-webkit-details-marker {
  display: none;
}

.wfl-country-badge {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 55px;
  height: 31px;
  padding: 4px 7px;
  gap: 5px;
  color: #eaf4ff;
  cursor: pointer;
  background: rgba(5, 17, 33, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color 0.16s ease, transform 0.16s ease, background-color 0.16s ease;
}

.wfl-country-badge:hover,
.wfl-country-badge:focus-visible {
  background: rgba(7, 24, 47, 0.86);
  border-color: rgba(94, 179, 255, 0.68);
  outline: none;
  transform: translateY(-1px);
}

.wfl-country-badge.is-locked {
  cursor: default;
}

.wfl-country-badge-flag {
  display: block;
  width: 28px;
  height: 19px;
  flex: 0 0 28px;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.wfl-country-badge-globe,
.wfl-country-badge-chevron,
.wfl-country-badge-lock {
  flex: 0 0 auto;
}

.wfl-country-badge-chevron,
.wfl-country-badge-lock {
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  color: #dcecff;
  background: rgba(22, 135, 255, 0.72);
  border-radius: 50%;
}

.wfl-country-picker[open] .wfl-country-badge-chevron {
  transform: rotate(180deg);
}

.wfl-country-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 236px;
  padding: 10px;
  background: rgba(249, 251, 254, 0.98);
  border: 1px solid rgba(203, 213, 225, 0.94);
  border-radius: 10px;
  box-shadow: 0 20px 46px rgba(2, 8, 23, 0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: wfl-country-open 0.16s ease-out;
}

@keyframes wfl-country-open {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.wfl-country-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
  padding: 0 1px 8px;
  border-bottom: 1px solid #e2e8f0;
}

.wfl-country-menu-head strong {
  color: #172033;
  font-size: 10.5px;
}

.wfl-country-menu-head span {
  max-width: 105px;
  overflow: hidden;
  color: #718096;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wfl-country-menu-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.wfl-country-option {
  appearance: none;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 48px;
  padding: 5px 3px;
  gap: 3px;
  color: #58677b;
  cursor: pointer;
  background: #fff;
  border: 1px solid #dce4ee;
  border-radius: 7px;
  font-size: 8px;
  font-weight: 800;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.wfl-country-option img {
  display: block;
  width: 27px;
  height: 18px;
  object-fit: cover;
  border-radius: 3px;
}

.wfl-country-option:hover,
.wfl-country-option:focus-visible,
.wfl-country-option.is-active {
  border-color: var(--wfl-accent);
  box-shadow: 0 0 0 2px rgba(22, 135, 255, 0.12);
  outline: none;
  transform: translateY(-1px);
}

/* Campos ----------------------------------------------------------------- */
.wfl-field {
  margin: 0 0 10px;
}

.wfl-label {
  display: block;
  margin: 0 0 5px;
  color: rgba(255, 255, 255, 0.95);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  line-height: 1.2;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.wfl-control-wrap {
  position: relative;
}

.wfl-control-icon {
  position: absolute;
  top: 50%;
  left: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  color: #8294aa;
  pointer-events: none;
  transform: translateY(-50%);
}

.wfl-control {
  appearance: none;
  display: block;
  width: 100%;
  height: var(--wfl-control-h);
  min-height: var(--wfl-control-h);
  margin: 0;
  padding: 0 38px;
  color: #172033;
  background-color: var(--wfl-control-bg);
  border: 1px solid rgba(222, 230, 239, 0.92);
  border-radius: var(--wfl-radius);
  box-shadow: 0 5px 16px rgba(2, 8, 23, 0.13);
  font-size: 12.5px;
  font-weight: 500;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.wfl-control::placeholder {
  color: #91a0b3;
  opacity: 1;
}

.wfl-control:hover {
  background-color: #fff;
  border-color: rgba(198, 211, 225, 0.98);
}

.wfl-control:focus {
  background-color: #fff;
  border-color: var(--wfl-accent);
  box-shadow: 0 0 0 3px var(--wfl-accent-soft), 0 7px 18px rgba(2, 8, 23, 0.16);
}

select.wfl-control {
  padding-right: 35px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23677a91' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
}

.wfl-password-toggle {
  appearance: none;
  position: absolute;
  top: 50%;
  right: 5px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  padding: 0;
  color: #8294aa;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 6px;
  transform: translateY(-50%);
}

.wfl-password-toggle:hover,
.wfl-password-toggle:focus-visible {
  color: var(--wfl-accent);
  background: rgba(22, 135, 255, 0.08);
  outline: none;
}

.wfl-eye-off {
  display: none;
}

.wfl-password-toggle[aria-pressed="true"] .wfl-eye-on {
  display: none;
}

.wfl-password-toggle[aria-pressed="true"] .wfl-eye-off {
  display: block;
}

.wfl-hint {
  margin: 5px 0 0;
  color: rgba(218, 229, 241, 0.72);
  font-size: 9.5px;
}

.wfl-extras {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  margin: 2px 0 12px;
}

.wfl-remember {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
  color: rgba(236, 243, 251, 0.9);
  cursor: pointer;
  font-size: 10.5px;
  font-weight: 650;
}

.wfl-remember input {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--wfl-accent);
}

.wfl-recover {
  color: #55adff;
  font-size: 10.5px;
  font-weight: 800;
  text-decoration: none;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

.wfl-recover:hover,
.wfl-recover:focus-visible {
  color: #89c8ff;
  text-decoration: underline;
  outline: none;
}

/* Botón sólido: sin degradado ni reflejo deslizante. */
.wfl-submit,
.wfl-submit--premium {
  appearance: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 43px;
  min-height: 43px;
  margin: 0;
  padding: 0 16px;
  gap: 10px;
  color: #fff;
  cursor: pointer;
  background: var(--wfl-accent);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 7px;
  box-shadow: 0 10px 24px rgba(22, 135, 255, 0.34);
  font-size: 12.5px;
  font-weight: 750;
  letter-spacing: -0.08px;
  overflow: hidden;
  transition: transform 0.14s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.wfl-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 29px rgba(22, 135, 255, 0.4);
}

.wfl-submit:active {
  transform: translateY(0) scale(0.993);
}

.wfl-submit:focus-visible {
  outline: 3px solid rgba(113, 190, 255, 0.3);
  outline-offset: 3px;
}

.wfl-submit:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none;
}

.wfl-submit-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.wfl-submit-loader {
  display: none;
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.34);
  border-top-color: #fff;
  border-radius: 50%;
  animation: wfl-spin 0.72s linear infinite;
}

.wfl-submit.is-loading .wfl-submit-icon,
.wfl-submit.is-loading .wfl-submit-text {
  display: none;
}

.wfl-submit.is-loading .wfl-submit-loader {
  display: block;
}

@keyframes wfl-spin {
  to { transform: rotate(360deg); }
}

.wfl-secure-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  color: rgba(218, 230, 243, 0.76);
  font-size: 9.5px;
  font-weight: 600;
}

.wfl-form-footer {
  margin-top: 12px;
  color: rgba(210, 222, 236, 0.58);
  font-size: 8.5px;
  line-height: 1.45;
  text-align: center;
}

.wfl-legal {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.wfl-legal a {
  color: rgba(229, 238, 248, 0.72);
  font-size: 8.8px;
  font-weight: 650;
  text-decoration: none;
}

.wfl-legal a:hover,
.wfl-legal a:focus-visible {
  color: #fff;
  text-decoration: underline;
  outline: none;
}

.wfl-legal-separator {
  color: rgba(255, 255, 255, 0.28);
  font-size: 8px;
}

/* Ayuda ------------------------------------------------------------------ */
.wfl-help {
  position: fixed;
  right: max(14px, env(safe-area-inset-right, 0px));
  bottom: max(14px, env(safe-area-inset-bottom, 0px));
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wfl-help-copy {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
  line-height: 1.15;
}

.wfl-help-copy strong,
.wfl-help-copy span {
  display: block;
}

.wfl-help-copy strong {
  color: #172033;
  font-size: 9.5px;
}

.wfl-help-copy span {
  margin-top: 2px;
  color: #748196;
  font-size: 8.5px;
}

.wfl-whatsapp {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  color: #fff;
  background: #25d366;
  border-radius: 50%;
  box-shadow: 0 13px 28px rgba(37, 211, 102, 0.3);
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.wfl-whatsapp:hover,
.wfl-whatsapp:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 33px rgba(37, 211, 102, 0.38);
  outline: none;
}

/* Modales ---------------------------------------------------------------- */
.wfl-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(2, 8, 23, 0.64);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.wfl-modal.is-open {
  display: flex;
  animation: wfl-fade 0.17s ease-out;
}

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

.wfl-modal-card {
  position: relative;
  width: min(100%, 370px);
  overflow: hidden;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 13px;
  box-shadow: 0 28px 75px rgba(2, 8, 23, 0.36);
  animation: wfl-modal-rise 0.2s ease-out;
}

@keyframes wfl-modal-rise {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.wfl-modal-close {
  appearance: none;
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  color: #68788d;
  cursor: pointer;
  background: #f3f6fa;
  border: 1px solid #e1e8f0;
  border-radius: 7px;
}

.wfl-modal-close:hover,
.wfl-modal-close:focus-visible {
  color: #172033;
  background: #eaf0f7;
  outline: none;
}

.wfl-modal-body {
  padding: 30px 27px 20px;
  text-align: center;
}

.wfl-error-chip {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  margin-bottom: 13px;
  padding: 0 8px;
  gap: 5px;
  color: #b42318;
  background: #fef3f2;
  border: 1px solid #fee4e2;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.wfl-modal-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  color: #d92d20;
  background: #fef3f2;
  border: 1px solid #fee4e2;
  border-radius: 50%;
}

.wfl-modal-title {
  margin: 0;
  color: #172033;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.45px;
}

.wfl-modal-text {
  margin: 8px 0 0;
  color: #66758a;
  font-size: 12px;
  line-height: 1.55;
}

.wfl-modal-actions {
  padding: 0 27px 25px;
}

.wfl-modal-button {
  appearance: none;
  width: 100%;
  height: 40px;
  color: #fff;
  cursor: pointer;
  background: var(--wfl-accent);
  border: 0;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
}

.wfl-modal--processing .wfl-modal-card {
  width: min(100%, 330px);
}

.wfl-modal--processing .wfl-modal-icon {
  color: var(--wfl-accent);
  background: rgba(22, 135, 255, 0.08);
  border-color: rgba(22, 135, 255, 0.16);
}

.wfl-spinner {
  width: 27px;
  height: 27px;
  border: 3px solid rgba(22, 135, 255, 0.2);
  border-top-color: var(--wfl-accent);
  border-radius: 50%;
  animation: wfl-spin 0.72s linear infinite;
}

/* PWA -------------------------------------------------------------------- */
.wfl-pwa {
  position: fixed;
  left: max(14px, env(safe-area-inset-left, 0px));
  bottom: max(14px, env(safe-area-inset-bottom, 0px));
  z-index: 40;
  display: none;
  width: min(355px, calc(100vw - 28px));
  padding: 10px;
  color: #fff;
  background: rgba(7, 18, 36, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  box-shadow: 0 18px 44px rgba(2, 8, 23, 0.32);
  backdrop-filter: blur(11px);
  -webkit-backdrop-filter: blur(11px);
}

.wfl-pwa.is-visible {
  display: block;
  animation: wfl-pwa-up 0.22s ease-out;
}

@keyframes wfl-pwa-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.wfl-pwa-close {
  appearance: none;
  position: absolute;
  top: 4px;
  right: 5px;
  width: 22px;
  height: 22px;
  padding: 0;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  background: transparent;
  border: 0;
  font-size: 17px;
  line-height: 1;
}

.wfl-pwa-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-right: 12px;
}

.wfl-pwa-logo {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  overflow: hidden;
  background: #fff;
  border-radius: 8px;
}

.wfl-pwa-logo img {
  display: block;
  width: 88%;
  height: 88%;
  object-fit: contain;
}

.wfl-pwa-info {
  min-width: 0;
  flex: 1 1 auto;
}

.wfl-pwa-name {
  overflow: hidden;
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wfl-pwa-description {
  margin-top: 2px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.68);
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wfl-pwa-install {
  appearance: none;
  min-width: 62px;
  height: 31px;
  padding: 0 10px;
  color: #fff;
  cursor: pointer;
  background: var(--wfl-accent);
  border: 0;
  border-radius: 7px;
  font-size: 9.5px;
  font-weight: 800;
}

.wfl-pwa-message {
  display: none;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 9px;
}

.wfl-pwa-message:not(:empty) {
  display: block;
}

.wfl-pwa-ios {
  display: none;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.wfl-pwa-ios.is-visible {
  display: grid;
  gap: 6px;
}

.wfl-pwa-step {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 9px;
}

.wfl-pwa-number {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: #fff;
  background: rgba(22, 135, 255, 0.82);
  border-radius: 50%;
  font-size: 8px;
  font-weight: 800;
}

/* Tablet ----------------------------------------------------------------- */
@media (max-width: 1100px) and (min-width: 901px) {
  .wfl-hero-content {
    width: min(590px, calc(100vw - 430px));
    padding: 42px;
  }

  .wfl-hero-title {
    font-size: clamp(38px, 5vw, 56px);
  }

  .wfl-login-panel,
  .wfl-login-panel--overlay {
    padding-right: 38px;
    padding-left: 38px;
  }
}

/* Móvil: fondo estable, desplazamiento natural y refresco vertical. -------- */
@media (max-width: 900px) {
  :root {
    --wfl-form-w: 356px;
    --wfl-control-h: 42px;
    --wfl-bg-position: 58% center;
    --wfl-bg-origin: 58% 50%;
  }

  html {
    min-height: 100%;
    overflow-x: hidden;
    background: #06101e;
  }

  body.wfl-body {
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: auto;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    background: #06101e;
  }

  .wfl-shell,
  .wfl-shell--immersive {
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible;
  }

  .wfl-hero,
  .wfl-hero--fullscreen {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
  }

  /* En móvil queda una sola imagen física. Evita duplicaciones y costuras
     durante el gesto de recarga del navegador. */
  .wfl-hero-image--motion {
    display: none !important;
    animation: none !important;
  }

  .wfl-hero-image--base {
    object-position: var(--wfl-bg-position);
  }

  .wfl-hero-shade {
    background:
      radial-gradient(circle at 55% 17%, rgba(255,255,255,0.065), transparent 31%),
      linear-gradient(180deg, rgba(2, 8, 20, 0.54) 0%, rgba(2, 8, 20, 0.7) 53%, rgba(2, 8, 20, 0.84) 100%);
  }

  .wfl-hero-grid {
    opacity: 0.09;
    background-size: 54px 54px;
  }

  .wfl-hero-content {
    display: none;
  }

  .wfl-login-panel,
  .wfl-login-panel--overlay {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    min-height: 100dvh;
    padding:
      max(24px, env(safe-area-inset-top, 0px))
      18px
      calc(104px + env(safe-area-inset-bottom, 0px));
  }

  .wfl-form-shell,
  .wfl-form-shell--floating {
    width: min(100%, var(--wfl-form-w));
    margin-block: auto;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .wfl-mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 70px 16px 0;
    padding-bottom: 0;
    border: 0;
  }

  .wfl-mobile-logo {
    width: 39px;
    height: 39px;
    flex: 0 0 39px;
    border-radius: 10px;
    box-shadow: 0 9px 22px rgba(0, 0, 0, 0.22);
  }

  .wfl-mobile-name {
    min-width: 0;
    overflow: hidden;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .wfl-mobile-name small {
    display: block;
    margin-top: 3px;
    color: rgba(226, 235, 246, 0.7);
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }

  .wfl-form-head {
    margin-right: 0;
    margin-bottom: 14px;
  }

  .wfl-country-corner {
    top: 1px;
  }

  .wfl-country-menu {
    width: min(236px, calc(100vw - 36px));
  }

  .wfl-help {
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .wfl-help-copy {
    display: none;
  }

  .wfl-whatsapp {
    width: 43px;
    height: 43px;
    flex-basis: 43px;
  }

  .wfl-pwa {
    left: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    width: calc(100vw - 64px);
    max-width: 355px;
  }
}

@media (max-width: 520px) {
  :root {
    --wfl-form-w: 100%;
    --wfl-control-h: 41px;
  }

  .wfl-login-panel,
  .wfl-login-panel--overlay {
    padding-right: 14px;
    padding-left: 14px;
  }

  .wfl-form-shell,
  .wfl-form-shell--floating {
    width: 100%;
    max-width: 370px;
  }

  .wfl-mobile-brand {
    margin-right: 66px;
  }

  .wfl-form-title {
    font-size: 20px;
  }

  .wfl-extras {
    align-items: center;
  }

  .wfl-remember,
  .wfl-recover {
    font-size: 10px;
  }
}

@media (max-width: 370px) {
  .wfl-login-panel,
  .wfl-login-panel--overlay {
    padding-right: 11px;
    padding-left: 11px;
  }

  .wfl-mobile-name {
    max-width: 170px;
  }

  .wfl-form-title {
    font-size: 19px;
  }

  .wfl-extras {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .wfl-recover {
    align-self: flex-end;
  }
}

/* Pantallas de escritorio bajas: conserva scroll natural sin fijar el form. */
@media (max-height: 760px) and (min-width: 901px) {
  .wfl-login-panel,
  .wfl-login-panel--overlay {
    align-items: flex-start;
    padding-top: 24px;
    padding-bottom: 78px;
  }

  .wfl-form-shell,
  .wfl-form-shell--floating {
    margin-block: auto;
  }

  .wfl-brandline {
    margin-bottom: 38px;
  }

  .wfl-hero-copy {
    margin-top: 15px;
  }
}

/* Accesibilidad: la imagen base sigue visible aunque no haya animación. */
@media (prefers-reduced-motion: reduce) {
  .wfl-submit-loader,
  .wfl-spinner,
  .wfl-modal.is-open,
  .wfl-modal-card,
  .wfl-pwa.is-visible {
    animation: none !important;
  }


  .wfl-submit,
  .wfl-whatsapp,
  .wfl-country-badge,
  .wfl-country-option {
    transition: none !important;
  }
}

@media (display-mode: standalone) {
  body.wfl-body {
    min-height: 100dvh;
  }

  .wfl-login-panel,
  .wfl-login-panel--overlay {
    padding-top: max(24px, env(safe-area-inset-top, 0px));
    padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  }
}
