/* ============================================================
   LOGIN v4 — Allucho · Reestructura
   Una tarjeta contenedora con CARRUSEL AUTOMÁTICO de beneficios
   (4 vistas desktop / 1 móvil) · botones planos · sin scroll
   ============================================================ */

.login-wrap { position: relative; height: 100dvh; overflow: hidden; }

/* ---------- HERO: imagen completa ---------- */
.hero {
  position: fixed; inset: 0; z-index: 0;
  background:
    linear-gradient(105deg,
      rgba(4,18,28,0.32) 0%,
      rgba(4,18,28,0.10) 45%,
      rgba(4,18,28,0.30) 100%),
    var(--hero-image, linear-gradient(135deg, #0C2D48, #164E63));
  background-size: cover; background-position: center;
}

.login-content {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.35fr 1fr;
  gap: 36px; align-items: center;
  height: 100dvh;
  padding: 26px 44px;
  max-width: 1440px; margin: 0 auto;
  overflow: hidden;
}

/* ---------- Columna izquierda ---------- */
.hero-left {
  color: #fff; display: flex; flex-direction: column;
  justify-content: center; align-items: center; text-align: center;
  gap: 16px; min-width: 0;
}

/* Logotipo grande centrado (dinámico desde MASTER) */
.hero-logo { display: block; }
.hero-logo img {
  display: block; margin: 0 auto;
  width: clamp(190px, 21vw, 290px); height: auto;
}

.hero-country {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: #fff;
  background: color-mix(in srgb, #0a1f2b 38%, transparent);
  border-radius: 99px; padding: 8px 16px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.hero-country svg { width: 13px; height: 13px; }

.hero-headline {
  font-size: clamp(26px, 3.2vw, 42px);
  font-weight: 800; line-height: 1.1; letter-spacing: -.02em;
  margin: 0; max-width: 640px;
  color: #ffffff !important;
  text-shadow: 0 1px 12px rgba(0,0,0,0.3);
}

/* Palabra rotativa (mismo tamaño del titular, degradado premium animado) */
.hero-rotator {
  display: block;
  font-size: clamp(26px, 3.2vw, 42px);
  font-weight: 800; line-height: 1.1; letter-spacing: -.02em;
  min-height: 1.15em;
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
  background: none;
  animation: none;
  transition: opacity .42s ease, transform .42s ease;
  margin-top: -10px;   /* pegado al titular */
}
@keyframes rotShine { to { background-position: 220% 0; } }
.hero-rotator.out { opacity: 0; transform: translateY(12px); }
.hero-rotator.in  { opacity: 1; transform: translateY(0); }

/* ============================================================
   TARJETA DE BENEFICIOS (única) + carrusel automático
   ============================================================ */
.benefits-card {
  width: 100%; max-width: 760px;
  background: color-mix(in srgb, #0a1f2b 42%, transparent);
  border-radius: 22px;
  padding: 18px;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
}
.benefits-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.benefits-head h2 { font-size: 13px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: #fff; }
.benefits-dots { display: flex; gap: 5px; }
.benefits-dots .dot {
  width: 6px; height: 6px; border-radius: 99px;
  background: color-mix(in srgb, #ffffff 30%, transparent);
  transition: width .25s, background .25s;
}
.benefits-dots .dot.on { width: 18px; background: #fff; }

.benefits-viewport { overflow: hidden; }
.benefits-track {
  display: flex; gap: 12px;
  transition: transform .55s cubic-bezier(.22,.8,.3,1);
  will-change: transform;
}
.benefit {
  position: relative;
  flex: 0 0 calc((100% - 36px) / 4);   /* 4 por vista desktop */
  height: 138px;
  border-radius: 16px;
  overflow: hidden;
  background-size: cover; background-position: center;
}
.benefit::after {  /* legibilidad del badge sobre cualquier imagen */
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, color-mix(in srgb, #06222e 38%, transparent), transparent 55%);
}
.benefit .title-badge {
  position: absolute; top: 10px; left: 10px; right: 10px; z-index: 1;
  display: inline-flex; align-self: flex-start; width: fit-content; max-width: calc(100% - 20px);
  font-size: 12px; font-weight: 800; color: #fff; line-height: 1.25;
  background: color-mix(in srgb, #0a1f2b 58%, transparent);
  border-radius: 99px; padding: 6px 12px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}

/* ============================================================
   TARJETA GLASS DEL FORMULARIO
   ============================================================ */
.glass-card {
  background: #0d1825;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 24px;
  padding: 22px;
  backdrop-filter: blur(26px) saturate(1.5);
  -webkit-backdrop-filter: blur(26px) saturate(1.5);
  width: 100%; max-width: 352px;
  justify-self: center;
  max-height: calc(100dvh - 52px);
  overflow-y: auto;
}
[data-theme="dark"] .glass-card {
  background: #08111e;
  border-color: rgba(255,255,255,0.09);
}

.glass-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 10px; text-align: center; }
.glass-brand .logo-ring {
  width: 72px; height: 48px; border-radius: 8px;
  display: grid; place-items: center;
  background: transparent;
}
.glass-brand .logo-ring img { width: auto; max-width: 72px; height: 48px; object-fit: contain; filter: brightness(0) invert(1); }
.glass-brand .logo-ring svg { width: 26px; height: 26px; color: var(--accent); }
.glass-brand .subtitle { margin: 0; font-size: 12.5px; color: rgba(255,255,255,0.50); }
.glass-brand .form-context {
  font-size: 13px; font-weight: 400; color: rgba(255,255,255,0.58);
  max-width: 260px; line-height: 1.5; text-align: center;
  margin-bottom: 4px;
}

/* Título + insignia GRATIS en la misma línea */
.title-row { display: inline-flex; align-items: center; gap: 9px; }
.title-row h1 { font-size: 18px; font-weight: 800; letter-spacing: .01em; color: #fff; }
.title-row .badge { transform: translateY(-1px); }

/* ---------- Inputs con insignia (compactos) ---------- */
/* Escapar del tamaño global de .input-wrap (72px, para Tareas) --
   el login (y su modal de registro/recuperar clave, que usa
   .login-modal) siempre deben verse compactos, sin importar qué
   tan grandes se pongan los inputs del resto del app. */
.login-wrap .input-wrap,
.login-modal .input-wrap {
  position: relative;
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: 12px;
  height: 52px !important;
  padding: 0 !important;
  overflow: hidden;
}
.input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb,var(--accent) 22%,transparent);
}
/* Ícono: flota sobre el input, nunca tapa el texto */
.input-wrap .ins {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; z-index: 2;
  display: grid; place-items: center;
  background: transparent;
  color: rgba(255,255,255,0.55);
  pointer-events: none;
}
.input-wrap:focus-within .ins { color: var(--accent); }
.input-wrap .ins svg { width: 15px; height: 15px; }
/* Input: fondo igual a la glass-card — Chrome autofill no cambia
   el color percibido porque el fondo declarado es el mismo oscuro.
   color-scheme:dark hace que el texto de autofill sea blanco. */
.glass-card .input-wrap .input,
.login-modal .input-wrap .input {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  padding: 0 44px 0 44px !important;
  background: #0d1825 !important;
  color: #ffffff !important;
  font-family: var(--font) !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  border: none; outline: none;
  box-sizing: border-box;
  color-scheme: dark;
}
.login-modal .input-wrap .input::placeholder { color: rgba(255,255,255,0.38) !important; }
.login-modal .input-wrap .input:-webkit-autofill,
.login-modal .input-wrap .input:-webkit-autofill:focus {
  -webkit-text-fill-color: #ffffff !important;
}
/* Eye btn */
.eye-btn {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 8px; z-index: 3;
  display: grid; place-items: center; cursor: pointer;
  background: transparent; border: none;
  color: rgba(255,255,255,0.40);
}
.eye-btn:hover { color: var(--accent); }
.eye-btn svg { width: 15px; height: 15px; }

/* ---------- Recordarme + olvidé ---------- */
.form-row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 14px; }
.remember { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.remember input { display: none; }
.remember .box {
  width: 20px; height: 20px; border-radius: 7px;
  border: 1.5px solid rgba(255,255,255,0.25); background: rgba(255,255,255,0.08);
  display: grid; place-items: center; color: transparent;
  transition: background .12s, border-color .12s;
}
.remember .box svg { width: 11px; height: 11px; }
.remember input:checked + .box { background: var(--accent); border-color: var(--accent); color: #fff; }
.remember span.lbl { font-size: 12.5px; font-weight: 500; color: rgba(255,255,255,0.55); }

.text-action {
  background: none; border: none; cursor: pointer; padding: 4px 2px;
  font-family: var(--font); font-size: 13px; font-weight: 800;
  color: rgba(255,255,255,0.55); text-decoration: none;
  display: inline-flex; align-items: center; gap: 7px;
  transition: color .15s;
}
.text-action:hover { color: var(--accent); }
.text-action.muted { color: rgba(255,255,255,0.42); font-weight: 500; font-size: 12.5px; }
.text-action.muted:hover { color: var(--text); }

/* ---------- CTA plano moderno ---------- */
.btn-cta {
  width: 100%; justify-content: center; gap: 10px;
  padding: 16px; font-size: 15px; font-weight: 700; letter-spacing: .01em;
  border-radius: 14px;
  background: var(--accent) !important;
  color: #fff !important;
  border-color: transparent !important; box-shadow: none !important;
}
.btn-cta:hover { opacity: .88; }
[data-theme="dark"] .btn-cta { color: #060f1a !important; }
.btn-cta svg { width: 16px; height: 16px; }

.swap-line {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 7px;
  text-align: center; font-size: 12.5px; font-weight: 400; color: rgba(255,255,255,0.40); margin: 14px 0 0;
}
.swap-line .text-action { font-size: 12.5px; }

/* ---------- Idioma ---------- */
.lang-switch {
  position: fixed; top: 14px; right: 16px; z-index: 5;
  display: flex; gap: 4px;
  background: color-mix(in srgb, #0a1f2b 40%, transparent);
  border-radius: 99px; padding: 4px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.lang-switch button {
  border: none; background: none; cursor: pointer;
  font-family: var(--font); font-size: 12px; font-weight: 800;
  color: color-mix(in srgb, #ffffff 80%, transparent);
  padding: 6px 13px; border-radius: 99px;
}
.lang-switch button.active { background: #fff; color: var(--accent); }

/* ============================================================
   MENÚ APP INFERIOR (móvil) — insignias, plano
   ============================================================ */
.app-menu {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  background: color-mix(in srgb, #0a1f2b 78%, transparent);
  border-top: 1px solid color-mix(in srgb, #ffffff 14%, transparent);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  padding: 9px 8px calc(9px + env(safe-area-inset-bottom));
}
.app-menu .menu-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-family: var(--font); font-size: 11px; font-weight: 700; letter-spacing: .03em;
  color: color-mix(in srgb, #ffffff 78%, transparent);
  background: none; border: none; cursor: pointer;
  padding: 3px 0; transition: transform .08s;
}
.app-menu .menu-btn:active { transform: scale(.93); }
.app-menu .tab-ic {
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 14px;
  background: color-mix(in srgb, #ffffff 9%, transparent);
  border: 1px solid color-mix(in srgb, #ffffff 16%, transparent);
  transition: transform .12s;
}
.app-menu .tab-ic svg { width: 20px; height: 20px; }
.app-menu .menu-btn:active .tab-ic { transform: scale(.9); }
.app-menu .menu-register { color: #fff; }
.app-menu .menu-register .tab-ic {
  background: var(--accent);
  border-color: color-mix(in srgb, #ffffff 22%, transparent);
}

/* ---------- Shell post-login ---------- */
.shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.shell-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 22px;
  background: var(--surface1); border-bottom: 1px solid var(--border);
}
.shell-header .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; }
.shell-header .brand img { height: 34px; border-radius: 8px; }
.shell-body { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; }
.shell-body .card { max-width: 440px; text-align: center; }

/* ---------- PWA banner ---------- */
.pwa-banner {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%);
  z-index: 110; width: min(430px, calc(100vw - 28px));
  background: color-mix(in srgb, var(--surface1) 94%, transparent);
  border-radius: 18px; padding: 14px;
  display: flex; align-items: center; gap: 11px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.pwa-banner .txt { flex: 1; }
.pwa-banner .txt b { display: block; font-size: 13.5px; margin-bottom: 2px; }
.pwa-banner .txt span { font-size: 12px; color: var(--text-2); font-weight: 600; }
.pwa-banner .btn { padding: 10px 15px; font-size: 13px; border-radius: 12px; }

/* ============================================================
   MÓVIL — 1 beneficio por vista, modal flotante, sin scroll
   ============================================================ */
@media (max-width: 880px) {
  .login-content {
    grid-template-columns: 1fr;
    padding: 18px 14px calc(100px + env(safe-area-inset-bottom));
    align-items: center; gap: 16px;
  }
  .hero-left { justify-content: center; gap: 14px; }
  .hero-logo img { width: clamp(170px, 52vw, 230px); }
  .hero-headline { font-size: clamp(26px, 7.6vw, 33px); }
  .hero-rotator  { font-size: clamp(26px, 7.6vw, 33px); }

  .benefit { flex: 0 0 100%; height: 150px; }   /* 1 por vista */

  .glass-card { display: none; }
  .app-menu { display: flex; }

  .modal { max-width: none; border-radius: 22px; }
  .modal-backdrop {
    align-items: flex-end;
    padding: 0 14px calc(14px + env(safe-area-inset-bottom));
  }
}

/* ── Login modal móvil: fondo oscuro = misma apariencia que glass-card desktop ── */
.login-modal {
  background: #0d1825 !important;
}
.login-modal .field label { color: rgba(255,255,255,0.60) !important; }
.login-modal .form-row,
.login-modal .remember .lbl,
.login-modal .text-action,
.login-modal .swap-line { color: rgba(255,255,255,0.65) !important; }
