/* MUFAH Solutions · showroom de demos · piel de LEALTAD Y PROMOCIONES
   Dos caras en la misma pantalla: la tarjeta digital del cliente (vertical, con la
   marca del negocio ficticio) y el tablero del dueño. El cambiador va arriba,
   siempre visible. Tipografía del sistema y acento del perfil (--acento). */

.le {
  --le-texto: #1A2330; --le-secundario: #6A7380; --le-fondo: #F4F5F7; --le-panel: #FFFFFF; --le-borde: #E3E6EB;
  --le-ok: #2E7D5B; --le-ok-fondo: #E4F1EA; --le-info: #2E6FD8; --le-info-fondo: #E2EBFA; --le-error: #B4443C; --le-error-fondo: #FBEEED;
  --le-oro: #B7791F; --le-oro-fondo: #FBF1DF; --le-radio: 14px;
  flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14.5px; line-height: 1.4; color: var(--le-texto); background: var(--le-fondo); -webkit-font-smoothing: antialiased; position: relative;
}
.le button, .le input, .le select { font-family: inherit; }
.le button { -webkit-tap-highlight-color: transparent; cursor: pointer; }
.le button:focus-visible, .le input:focus-visible, .le select:focus-visible { outline: 3px solid var(--acento, #2E6FD8); outline-offset: 2px; }

.le__sistema { display: none; }

/* ── Cambiador de cara: grande, arriba, imposible de perder ── */
.le__cambiador { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px 10px 8px; background: var(--le-panel); border-bottom: 1px solid var(--le-borde); }
.le__cambiador button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 6px; border-radius: 12px; border: 1.5px solid var(--le-borde); background: var(--le-fondo); color: var(--le-secundario); font-size: 12.5px; font-weight: 600; line-height: 1.15; }
.le__cambiador button svg { width: 22px; height: 22px; }
.le__cambiador button[aria-selected="true"] { background: var(--acento, #2E6FD8); border-color: var(--acento, #2E6FD8); color: var(--acento-texto, #fff); }
.le__cambiador button em { position: absolute; top: -8px; right: 8px; font-style: normal; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--le-error); color: #fff; animation: le-latido 1.2s ease-in-out infinite; }
@keyframes le-latido { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

.le__cuerpo { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 14px 14px 20px; }
.le__sub { margin: 18px 0 8px; font-size: 13px; font-weight: 700; color: var(--le-secundario); text-transform: uppercase; letter-spacing: .04em; display: flex; align-items: center; gap: 8px; }
.le__sub--suave { color: #9AA3AF; }
.le__vacio { padding: 16px 14px; text-align: center; color: var(--le-secundario); font-size: 13.5px; background: var(--le-panel); border: 1px dashed var(--le-borde); border-radius: var(--le-radio); }
.le__badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 5px; background: var(--le-fondo); color: var(--le-secundario); white-space: nowrap; }
.le__badge--acento { background: var(--acento, #2E6FD8); color: var(--acento-texto, #fff); }
.le__badge--oro { background: var(--le-oro-fondo); color: var(--le-oro); }
.le__badge--ok { background: var(--le-ok-fondo); color: var(--le-ok); }
.le__badge--info { background: var(--le-info-fondo); color: var(--le-info); }
.le__badge--error { background: var(--le-error-fondo); color: var(--le-error); }

/* ── Tarjeta del cliente ── */
.le__tarjeta { position: relative; border-radius: 18px; padding: 16px; color: var(--acento-texto, #fff); background: linear-gradient(135deg, var(--acento, #2E6FD8), var(--acento-oscuro, #204E97)); box-shadow: 0 12px 28px rgba(12,35,64,.18); overflow: hidden; }
.le__tarjeta::before { content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.09); pointer-events: none; }
.le__tarjeta-cab { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; position: relative; }
.le__logo { width: 40px; height: 40px; border-radius: 12px; overflow: hidden; background: rgba(255,255,255,.18); flex: none; }
.le__logo svg, .le__logo img { width: 100%; height: 100%; display: block; }
.le__tarjeta-quien { flex: 1; min-width: 0; line-height: 1.15; }
.le__tarjeta-quien small { display: block; font-size: 11px; opacity: .85; text-transform: uppercase; letter-spacing: .05em; }
.le__tarjeta-quien strong { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.le__nivel-badge { flex: none; font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: rgba(255,255,255,.22); }
.le__sellos { display: grid; gap: 8px; position: relative; }
.le__sello { aspect-ratio: 1; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; background: rgba(255,255,255,.16); color: rgba(255,255,255,.75); border: 1.5px dashed rgba(255,255,255,.45); }
.le__sello svg { width: 60%; height: 60%; }
.le__sello--lleno { background: #fff; color: var(--acento, #2E6FD8); border-style: solid; border-color: #fff; animation: le-sello .35s var(--curva-entrada, ease-out) backwards; }
.le__sello--lleno:nth-child(2) { animation-delay: .05s; } .le__sello--lleno:nth-child(3) { animation-delay: .1s; } .le__sello--lleno:nth-child(4) { animation-delay: .15s; } .le__sello--lleno:nth-child(5) { animation-delay: .2s; } .le__sello--lleno:nth-child(6) { animation-delay: .25s; } .le__sello--lleno:nth-child(7) { animation-delay: .3s; } .le__sello--lleno:nth-child(8) { animation-delay: .35s; }
@keyframes le-sello { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.le__sello--siguiente { border-style: solid; border-color: #fff; animation: le-pulso 1.6s ease-in-out infinite; }
@keyframes le-pulso { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,.45); } 50% { box-shadow: 0 0 0 6px rgba(255,255,255,0); } }
.le__contador { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; position: relative; }
.le__contador strong { font-size: 40px; font-weight: 800; line-height: 1; }
.le__contador span { font-size: 15px; font-weight: 600; }
.le__contador small { width: 100%; font-size: 12.5px; opacity: .9; }
.le__barra { position: relative; }
.le__barra-pista { height: 12px; border-radius: 6px; background: rgba(255,255,255,.22); overflow: hidden; }
.le__barra-pista i { display: block; height: 100%; border-radius: 6px; background: #fff; }
.le__barra span { display: block; margin-top: 6px; font-size: 13px; font-weight: 600; }
.le__faltan { margin: 12px 0 0; font-size: 14px; font-weight: 600; position: relative; }
.le__tarjeta-pie { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed rgba(255,255,255,.35); position: relative; }
.le__qr { width: 64px; height: 64px; padding: 5px; border-radius: 8px; background: #fff; flex: none; }
.le__qr svg { width: 100%; height: 100%; fill: #1A2330; display: block; }
.le__codigo { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.le__codigo small { font-size: 11px; opacity: .85; }
.le__codigo strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 17px; letter-spacing: .06em; }
.le__codigo span { font-size: 12px; opacity: .9; }

.le__nivel { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 12px 14px; background: var(--le-panel); border: 1px solid var(--le-borde); border-radius: var(--le-radio); }
.le__nivel small { display: block; font-size: 11.5px; color: var(--le-secundario); }
.le__nivel strong { display: block; font-size: 16px; }
.le__nivel span { display: block; font-size: 12.5px; color: var(--le-secundario); }
.le__nivel-sube { text-align: right; font-size: 13px; font-weight: 600; max-width: 50%; }
.le__nivel-sube small { display: block; font-weight: 400; font-size: 12px; color: var(--le-secundario); }
.le__recordatorio { margin-top: 10px; padding: 10px 14px; border-radius: var(--le-radio); background: var(--le-oro-fondo); color: #6B4A10; }
.le__recordatorio small { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
.le__recordatorio strong { font-size: 14px; }

/* ── Cupones ── */
.le__cupones { display: grid; gap: 10px; }
.le__cupon { position: relative; display: grid; grid-template-columns: 1fr auto; background: var(--le-panel); border: 1px solid var(--le-borde); border-radius: var(--le-radio); overflow: hidden; }
.le__cupon::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--acento, #2E6FD8); }
.le__cupon--recompensa::before { background: var(--le-oro); }
.le__cupon-cuerpo { padding: 12px 12px 12px 16px; min-width: 0; }
.le__cupon-cab { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.le__cupon-cab strong { font-size: 15px; }
.le__cupon-cuerpo p { margin: 4px 0 0; font-size: 13px; color: var(--le-secundario); }
.le__cupon-cuerpo small { display: block; margin-top: 6px; font-size: 11.5px; color: var(--le-secundario); }
.le__cupon-accion { display: flex; align-items: center; padding: 10px 12px 10px 0; border-left: 1.5px dashed var(--le-borde); margin: 10px 0; padding-left: 10px; }
.le__btn { border: 0; border-radius: 10px; padding: 9px 14px; font-size: 13.5px; font-weight: 700; background: var(--acento, #2E6FD8); color: var(--acento-texto, #fff); white-space: nowrap; }
.le__btn:disabled { opacity: .45; cursor: default; }
.le__btn--grande { width: 100%; padding: 13px 16px; font-size: 15px; }
.le__btn--sec { background: var(--le-fondo); color: var(--le-texto); border: 1px solid var(--le-borde); }
.le__cupon--usado { opacity: .6; }
.le__cupon--usado .le__cupon-cab strong { text-decoration: line-through; }
.le__usado { width: 30px; height: 30px; border-radius: 50%; background: var(--le-fondo); color: var(--le-secundario); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.le__canje-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: var(--acento, #2E6FD8); color: var(--acento-texto, #fff); font-size: 16px; animation: le-aparecer .25s ease-out; }
.le__canje-check { width: 46px; height: 46px; border-radius: 50%; background: #fff; color: var(--acento, #2E6FD8); display: flex; align-items: center; justify-content: center; animation: le-check .55s cubic-bezier(.2,.9,.3,1.3); }
.le__canje-check svg { width: 28px; height: 28px; }
@keyframes le-aparecer { from { opacity: 0; } to { opacity: 1; } }
@keyframes le-check { 0% { transform: scale(.2) rotate(-20deg); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
.le__cupon--canjeando { animation: le-sacudir .5s ease-out; }
@keyframes le-sacudir { 0% { transform: scale(1); } 40% { transform: scale(1.03); } 100% { transform: scale(1); } }

/* ── Historial ── */
.le__historial { display: grid; gap: 6px; }
.le__visita { display: grid; grid-template-columns: 58px 1fr auto; gap: 10px; align-items: center; padding: 9px 12px; background: var(--le-panel); border: 1px solid var(--le-borde); border-radius: 10px; font-size: 13.5px; }
.le__visita-fecha { color: var(--le-secundario); font-size: 12.5px; }
.le__visita-texto { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.le__visita-total { text-align: right; font-weight: 600; }
.le__visita-total small { display: block; font-weight: 600; font-size: 11px; color: var(--le-ok); }

/* ── Cara del dueño ── */
.le__pestanas { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.le__pestanas::-webkit-scrollbar { display: none; }
.le__pestanas button { flex: none; padding: 7px 12px; border-radius: 999px; border: 1.5px solid var(--le-borde); background: var(--le-panel); color: var(--le-texto); font-size: 13px; font-weight: 600; }
.le__pestanas button[aria-selected="true"] { background: var(--le-texto); border-color: var(--le-texto); color: #fff; }
.le__fichas { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.le__ficha { background: var(--le-panel); border: 1px solid var(--le-borde); border-radius: var(--le-radio); padding: 10px 12px; min-width: 0; }
.le__ficha small { display: block; font-size: 11.5px; color: var(--le-secundario); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.le__ficha strong { display: block; font-size: 21px; font-weight: 700; letter-spacing: -.01em; line-height: 1.15; margin: 2px 0; }
.le__ficha em { display: block; font-style: normal; font-size: 11.5px; color: var(--le-secundario); }
.le__ficha--destacada { background: var(--acento, #2E6FD8); color: var(--acento-texto, #fff); border-color: transparent; }
.le__ficha--destacada small, .le__ficha--destacada em { color: inherit; opacity: .85; }
.le__mecanica { margin-top: 12px; padding: 12px 14px; background: var(--le-panel); border: 1px solid var(--le-borde); border-radius: var(--le-radio); display: grid; gap: 4px; font-size: 13px; }
.le__mecanica strong { font-size: 14px; }
.le__mecanica span { color: var(--le-secundario); }
.le__niveles { font-size: 12.5px; }
.le__lista { display: grid; gap: 8px; }
.le__fila { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: var(--le-panel); border: 1px solid var(--le-borde); border-radius: 12px; }
.le__fila > div { min-width: 0; }
.le__fila strong { display: block; font-size: 14px; }
.le__fila small { display: block; font-size: 12px; color: var(--le-secundario); }
.le__fila--nueva { border-color: var(--acento, #2E6FD8); box-shadow: 0 0 0 2px var(--acento-claro, #E2EBFA); }
.le__form { background: var(--le-panel); border: 1.5px solid var(--acento, #2E6FD8); border-radius: var(--le-radio); padding: 12px; display: grid; gap: 10px; }
.le__form h4 { margin: 0; font-size: 14px; }
.le__campo { display: block; }
.le__campo span { display: block; font-size: 12px; font-weight: 600; color: var(--le-secundario); margin-bottom: 4px; }
.le__campo input, .le__campo select { width: 100%; padding: 10px 11px; border: 1.5px solid var(--le-borde); border-radius: 9px; font-size: 15px; color: var(--le-texto); background: #fff; }
.le__campo input:focus, .le__campo select:focus { outline: 0; border-color: var(--acento, #2E6FD8); box-shadow: 0 0 0 3px var(--acento-claro, #E2EBFA); }
.le__campo input:disabled { background: var(--le-fondo); color: var(--le-secundario); }
.le__campos-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.le__previa { padding: 10px; border-radius: 12px; background: var(--le-fondo); }
.le__previa small { display: block; font-size: 11.5px; font-weight: 700; color: var(--le-secundario); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.le__ingresos { padding: 12px 14px; background: var(--le-panel); border: 1px solid var(--le-borde); border-radius: var(--le-radio); margin-bottom: 12px; }
.le__ingresos > small { display: block; font-size: 11.5px; font-weight: 700; color: var(--le-secundario); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.le__ingreso { display: grid; grid-template-columns: 1fr; gap: 4px; margin-bottom: 8px; font-size: 13px; }
.le__ingreso span { color: var(--le-secundario); }
.le__ingreso-pista { height: 10px; border-radius: 5px; background: var(--le-fondo); overflow: hidden; }
.le__ingreso-pista i { display: block; height: 100%; border-radius: 5px; background: var(--acento, #2E6FD8); }
.le__ingreso--gris .le__ingreso-pista i { background: #B5BCC6; }
.le__ingreso b { font-size: 15px; }
.le__ingresos p { margin: 6px 0 0; font-size: 12px; color: var(--le-secundario); }
.le__segmento { padding: 12px 14px; background: var(--le-panel); border: 1px solid var(--le-borde); border-radius: var(--le-radio); display: grid; gap: 8px; }
.le__segmento-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.le__segmento-cab strong { display: block; font-size: 15px; }
.le__segmento-cab small { display: block; font-size: 12px; color: var(--le-secundario); }
.le__cifra { font-size: 24px; font-weight: 700; color: var(--acento, #2E6FD8); }
.le__segmento p { margin: 0; font-size: 13px; color: var(--le-secundario); }

/* ── Hoja de envío ── */
.le__hoja { position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column; justify-content: flex-end; }
.le__hoja-fondo { position: absolute; inset: 0; background: rgba(11,20,26,.45); }
.le__hoja-panel { position: relative; background: #fff; border-radius: 16px 16px 0 0; padding: 14px 16px 18px; padding-bottom: calc(18px + env(safe-area-inset-bottom, 0)); max-height: 85%; overflow: auto; display: grid; gap: 10px; animation: le-subir .22s ease-out; }
@keyframes le-subir { from { transform: translateY(24px); } to { transform: none; } }
.le__hoja-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.le__hoja-cab strong { font-size: 15px; }
.le__cerrar { width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--le-fondo); font-size: 20px; line-height: 1; }
.le__hoja-nota { font-size: 12px; color: var(--le-secundario); }
.le__wa { background: #EFEAE2; border-radius: 12px; padding: 12px; }
.le__wa-burbuja { position: relative; background: #fff; border-radius: 8px; border-top-left-radius: 0; padding: 8px 10px 18px; font-size: 13.5px; line-height: 1.4; color: #111B21; box-shadow: 0 1px .5px rgba(11,20,26,.13); }
.le__wa-burbuja span { position: absolute; right: 8px; bottom: 4px; font-size: 11px; color: #53BDEB; }

/* ── Aviso ── */
.le__toast { position: absolute; left: 14px; right: 14px; bottom: 16px; z-index: 20; padding: 12px 14px; border-radius: 12px; background: var(--le-texto); color: #fff; font-size: 13.5px; font-weight: 600; text-align: center; box-shadow: 0 10px 24px rgba(12,35,64,.25); animation: le-subir .25s ease-out; }

@media (prefers-reduced-motion: reduce) { .le * { animation: none !important; transition: none !important; } }

/* ══════════════════════════════════════════════════════════
   DEMO ANCHO (≥ 700 px de pantalla) · la tarjeta del cliente centrada como
   en su teléfono; el tablero del dueño a lo ancho.
   ══════════════════════════════════════════════════════════ */
@container pantalla (min-width: 700px) {
  .le__cambiador { grid-template-columns: repeat(2, minmax(0, 260px)); justify-content: center; gap: 10px; padding: 12px 20px 10px; }
  .le__cambiador button { cursor: pointer; }
  .le__cuerpo--cliente { width: 100%; max-width: 520px; margin: 0 auto; padding: 24px 24px 32px; }
  .le__sello { width: 100%; max-width: 78px; justify-self: center; }
  .le__cuerpo--dueno { padding: 24px 32px 32px; }
  .le__cuerpo--dueno .le__fichas { grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .le__cuerpo--dueno .le__lista { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
  .le__cuerpo--dueno .le__form { max-width: 720px; }
  .le__cuerpo--dueno .le__ingresos, .le__cuerpo--dueno .le__mecanica { max-width: 720px; }
  .le button { cursor: pointer; }
  .le__hoja { justify-content: center; align-items: center; }
  .le__hoja-panel { width: 520px; max-width: 92%; max-height: 84%; border-radius: 16px; padding-bottom: 18px; }
  .le__toast { left: 50%; right: auto; transform: translateX(-50%); min-width: 320px; }
}
