* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --azul: #1a73e8;
  --azul-oscuro: #155ec2;
  --azul-suave: #e8f0fe;
  --amarillo: #f9ab00;
  --texto: #1f2328;
  --texto-suave: #57606a;
  --fondo: #f6f8fa;
  --blanco: #ffffff;
  --borde: #e4e7eb;
  --verde: #188038;
  --rojo: #d93025;
  --radio: 14px;
  --sombra: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .07);
  --sombra-alta: 0 8px 24px rgba(16, 24, 40, .12);
}

html { -webkit-text-size-adjust: 100%; }

/* Nada puede desbordar horizontalmente (ajuste correcto en teléfonos) */
html, body { max-width: 100%; overflow-x: hidden; }
img, svg, canvas, video { max-width: 100%; }

body {
  font-family: -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(180deg, #eef4fc 0%, var(--fondo) 340px);
  color: var(--texto);
  line-height: 1.55;
  min-height: 100vh;
  font-size: 15.5px;
}

h1, h2, h3 { letter-spacing: -0.015em; color: var(--texto); }

.contenedor { max-width: 980px; margin: 0 auto; padding: 0 20px; }

/* ---------- encabezado ---------- */

header.barra {
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--borde);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 40;
}
header.barra .contenedor {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.logo {
  font-size: 1.18rem; font-weight: 800; color: var(--texto); text-decoration: none;
  display: inline-flex; align-items: center; gap: 9px; letter-spacing: -0.02em;
}
.logo-p {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, #1a73e8, #5c9bff);
  color: #fff; font-weight: 800; font-size: 1rem;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(26, 115, 232, .35);
}

.usuario {
  display: flex; align-items: center; gap: 12px;
  font-size: .88rem; color: var(--texto-suave); flex-wrap: wrap;
}

.marca-nav { display: flex; align-items: center; gap: 22px; }
.pestanas { display: flex; gap: 4px; }
.pestanas a {
  text-decoration: none; color: var(--texto-suave); font-weight: 600; font-size: .93rem;
  padding: 8px 15px; border-radius: 999px; transition: background .15s, color .15s;
}
.pestanas a:hover { background: var(--fondo); color: var(--texto); }
.pestanas a.activa { color: var(--azul); background: var(--azul-suave); }

/* ---------- botones ---------- */

.boton {
  display: inline-block;
  background: var(--azul);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 22px;
  font-size: .97rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, box-shadow .15s, transform .1s;
  box-shadow: 0 1px 2px rgba(26, 115, 232, .3);
}
.boton:hover { background: var(--azul-oscuro); box-shadow: 0 3px 8px rgba(26, 115, 232, .35); }
.boton:active { transform: scale(.98); }
.boton:focus-visible { outline: 3px solid var(--azul-suave); outline-offset: 1px; }
.boton:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.boton.secundario {
  background: var(--blanco); color: var(--azul);
  border: 1px solid var(--borde); box-shadow: var(--sombra);
}
.boton.secundario:hover { background: var(--fondo); border-color: #d0d7de; }
.boton.chico { padding: 8px 14px; font-size: .86rem; border-radius: 9px; }

/* ---------- landing ---------- */

.hero { text-align: center; padding: 84px 20px 52px; }
.hero h1 { font-size: 2.55rem; line-height: 1.15; margin-bottom: 18px; font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--azul); }
.hero p.sub {
  font-size: 1.16rem; color: var(--texto-suave);
  max-width: 640px; margin: 0 auto 34px;
}
.estrellas-grandes { font-size: 2rem; letter-spacing: 7px; margin-bottom: 20px; }

.tarjetas {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px; padding: 28px 0 72px;
}
.tarjeta {
  background: var(--blanco); border: 1px solid var(--borde); border-radius: var(--radio);
  padding: 28px 24px; text-align: left; box-shadow: var(--sombra);
  transition: box-shadow .2s, transform .2s;
}
.tarjeta:hover { box-shadow: var(--sombra-alta); transform: translateY(-2px); }
.tarjeta h3 { font-size: 1.06rem; margin-bottom: 8px; }
.tarjeta p { font-size: .92rem; color: var(--texto-suave); }
.tarjeta .icono {
  font-size: 1.5rem; margin-bottom: 14px;
  width: 48px; height: 48px; border-radius: 12px; background: var(--azul-suave);
  display: flex; align-items: center; justify-content: center;
}

/* ---------- panel ---------- */

.panel { padding: 30px 0 72px; }
.seccion {
  background: var(--blanco); border: 1px solid var(--borde); border-radius: var(--radio);
  padding: 28px; margin-bottom: 22px; box-shadow: var(--sombra);
  position: relative; overflow: hidden;
}
.seccion::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--azul), #7ab5ff 55%, transparent 90%);
}
.seccion h2 { font-size: 1.18rem; margin-bottom: 14px; }
.seccion p.ayuda { font-size: .92rem; color: var(--texto-suave); margin-bottom: 14px; }

/* Tarjeta de información destacada (instrucciones dentro de formularios) */
.tarjeta-info {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--azul-suave); border: 1px solid #c9ddfb; border-radius: 12px;
  padding: 14px 16px; margin: 20px 0 4px; font-size: .9rem; color: #1e3a5f;
  line-height: 1.6;
}
.tarjeta-info .icono-info { font-size: 1.35rem; line-height: 1.2; }
.tarjeta-info code {
  background: #fff; padding: 1px 7px; border-radius: 6px; font-size: .82rem;
}
.tarjeta-info a { color: var(--azul); font-weight: 700; }

label { display: block; font-size: .88rem; font-weight: 600; margin: 16px 0 6px; }
input[type="text"], input[type="url"], input[type="password"], input[type="number"], input[type="file"], select {
  width: 100%; padding: 11px 14px; border: 1px solid var(--borde); border-radius: 10px;
  font-size: .97rem; font-family: inherit; background: var(--blanco); color: var(--texto);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus {
  outline: none; border-color: var(--azul);
  box-shadow: 0 0 0 3px var(--azul-suave);
}
.nota { font-size: .82rem; color: var(--texto-suave); margin-top: 5px; }
.error { color: var(--rojo); font-size: .9rem; margin-top: 10px; min-height: 1.2em; }
.exito { color: var(--verde); font-size: .9rem; margin-top: 10px; }

.fila-qr { display: flex; gap: 30px; flex-wrap: wrap; align-items: flex-start; }
.caja-qr {
  background: var(--blanco); border: 1px solid var(--borde); border-radius: var(--radio);
  padding: 16px; display: inline-block; box-shadow: var(--sombra);
}
.caja-qr canvas { display: block; border-radius: 4px; }
.acciones-qr { display: flex; flex-direction: column; gap: 10px; min-width: 230px; flex: 1; max-width: 340px; }

.enlace-corto {
  font-family: Consolas, 'SF Mono', monospace; font-size: .88rem; background: var(--fondo);
  border: 1px solid var(--borde); border-radius: 10px; padding: 11px 13px;
  word-break: break-all; margin-bottom: 4px; color: var(--texto-suave);
}

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.stat {
  background: linear-gradient(180deg, #fbfdff, var(--blanco));
  border: 1px solid var(--borde); border-radius: var(--radio);
  padding: 22px 14px; text-align: center; box-shadow: var(--sombra);
  transition: box-shadow .2s, transform .2s;
}
.stat:hover { box-shadow: var(--sombra-alta); transform: translateY(-2px); }
.stat .numero { font-size: 2.3rem; font-weight: 800; color: var(--azul); line-height: 1.15; letter-spacing: -0.02em; }
.stat .etiqueta { font-size: .82rem; color: var(--texto-suave); margin-top: 4px; }

table.recientes { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.recientes td { padding: 9px 8px; border-bottom: 1px solid var(--fondo); color: var(--texto-suave); }
table.recientes tr:hover td { background: var(--fondo); }

.controles-lista {
  display: flex; align-items: center; gap: 14px; justify-content: center; margin-top: 14px;
}

/* ---------- modal QR pantalla completa ---------- */

.modal-qr {
  position: fixed; inset: 0; background: var(--blanco); z-index: 50;
  display: none; align-items: center; justify-content: center;
  text-align: center; padding: 24px; overflow: hidden;
}
.modal-qr.visible { display: flex; }
.modal-qr .fondo-qr {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; pointer-events: none;
}
.modal-qr .contenido-qr {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.modal-qr h2 { font-size: 1.65rem; margin-bottom: 6px; }
.modal-qr .estrellas-grandes { margin: 8px 0 20px; }
.modal-qr .caja-qr { border-width: 2px; background: #fff; box-shadow: var(--sombra-alta); }
.texto-velado {
  background: rgba(255, 255, 255, .85); border-radius: 12px; padding: 6px 16px;
  color: var(--texto);
}

/* ---------- foto del negocio ---------- */

.previa-fondo {
  position: relative; width: 100%; max-width: 340px; height: 150px;
  border-radius: 12px; overflow: hidden; border: 1px solid var(--borde);
  background: #fff; margin: 10px 0; box-shadow: var(--sombra);
}
.previa-fondo img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.previa-fondo .previa-velo { position: absolute; inset: 0; background: #fff; }
.previa-fondo .previa-contenido {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; font-size: 1.3rem; font-weight: 700;
}
.previa-fondo .previa-contenido span { font-size: .8rem; font-weight: 400; color: var(--texto-suave); }
input[type="range"] { width: 100%; max-width: 340px; accent-color: var(--azul); }

/* ---------- suscripción y pagos ---------- */

.banner-aviso {
  background: #fff8e6; border: 1px solid #f5d789; color: #7a4d00;
  padding: 13px 18px; border-radius: 12px; margin-bottom: 18px; font-weight: 600;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  flex-wrap: wrap; box-shadow: var(--sombra); font-size: .93rem;
}
.banner-aviso.rojo { background: #fdeceb; border-color: #f3b4ae; color: #a50e0e; }

.chip {
  display: inline-block; padding: 3px 11px; border-radius: 999px;
  font-size: .76rem; font-weight: 700; white-space: nowrap; letter-spacing: .01em;
}
.chip.activo { background: #e2f3e7; color: #167337; }
.chip.porvencer { background: #fff3d6; color: #9a5f00; }
.chip.vencido, .chip.rechazado { background: #fdeceb; color: #c5221f; }
.chip.revision { background: var(--azul-suave); color: #185abc; }

.fila-plan { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; }
.dias-grandes {
  text-align: center; min-width: 140px; padding: 16px 20px;
  background: var(--azul-suave); border-radius: var(--radio);
}
.dias-grandes .numero { font-size: 3rem; font-weight: 800; color: var(--azul); line-height: 1.05; letter-spacing: -0.02em; }
.dias-grandes .etiqueta { font-size: .82rem; color: var(--texto-suave); margin-top: 2px; }
.dias-grandes.rojo { background: #fdeceb; }
.dias-grandes.rojo .numero { color: var(--rojo); }

.barra-dias {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 15px 22px !important;
}
.barra-dias .texto-dias { font-size: 1rem; }
.barra-dias .texto-dias strong { color: var(--azul); font-size: 1.25rem; }
.barra-dias.rojo .texto-dias strong { color: var(--rojo); }

.paywall {
  text-align: center; padding: 40px 20px;
  border: 2px dashed var(--borde); border-radius: var(--radio); background: var(--fondo);
}
.paywall .candado { font-size: 3rem; }
.paywall h3 { margin: 12px 0 6px; font-size: 1.25rem; }
.paywall p { color: var(--texto-suave); margin-bottom: 20px; }

table.pagos { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.pagos th {
  text-align: left; padding: 10px 8px; border-bottom: 2px solid var(--borde);
  font-size: .74rem; color: var(--texto-suave); text-transform: uppercase; letter-spacing: .05em;
}
table.pagos td { padding: 12px 8px; border-bottom: 1px solid var(--fondo); vertical-align: top; }
table.pagos td .sub { font-size: .8rem; color: var(--texto-suave); margin-top: 2px; }

/* ---------- selector de animación ---------- */

.opciones-anim {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
  gap: 12px; margin: 12px 0;
}
.opcion-anim {
  border: 2px solid var(--borde); border-radius: 12px; padding: 14px 8px;
  text-align: center; cursor: pointer; background: var(--blanco);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.opcion-anim:hover { background: var(--fondo); box-shadow: var(--sombra); }
.opcion-anim.elegida { border-color: var(--azul); background: var(--azul-suave); }
.opcion-anim .emoji { font-size: 1.7rem; display: block; margin-bottom: 5px; }
.opcion-anim .nombre-anim { font-size: .84rem; font-weight: 700; display: block; }
.opcion-anim .probar { margin-top: 9px; }
.opcion-anim.deshabilitada { opacity: .45; cursor: not-allowed; }

/* ---------- gráficas ---------- */

.fila-filtros { display: flex; gap: 14px; flex-wrap: wrap; margin: 16px 0 6px; }
.fila-filtros > div { display: flex; flex-direction: column; }
.fila-filtros label { margin: 0 0 4px; font-size: .76rem; color: var(--texto-suave); text-transform: uppercase; letter-spacing: .04em; }
.fila-filtros select { padding: 9px 12px; font-size: .9rem; min-width: 130px; }
select:disabled {
  opacity: .5; background: var(--fondo); color: var(--texto-suave); cursor: not-allowed;
}
.grafica { position: relative; margin-top: 8px; }
.tooltip-grafica {
  position: absolute; display: none; pointer-events: none; z-index: 5;
  background: #1f2328; color: #fff; font-size: .78rem;
  padding: 6px 10px; border-radius: 8px; white-space: nowrap;
  transform: translate(-50%, -100%); box-shadow: var(--sombra-alta);
}
.titulo-grafica { font-size: .98rem; margin-top: 20px; }

/* ---------- visor de comprobantes ---------- */

.lightbox-img {
  max-width: 100%; max-height: 70vh; display: block; margin: 0 auto;
  border-radius: 10px; border: 1px solid var(--borde);
}

/* ---------- modales genéricos ---------- */

.overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 60;
  display: none; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(2px);
}
.overlay.visible { display: flex; }
.caja-modal {
  background: var(--blanco); border-radius: 16px; padding: 28px;
  max-width: 470px; width: 100%; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--sombra-alta);
}
.caja-modal h3 { margin-bottom: 10px; font-size: 1.15rem; }
.caja-modal p.texto { color: var(--texto-suave); font-size: .95rem; margin-bottom: 12px; }
.acciones-modal { display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end; flex-wrap: wrap; }
.vista-previa {
  max-width: 100%; max-height: 220px; border-radius: 10px;
  border: 1px solid var(--borde); margin-top: 10px; display: none;
}

/* ---------- varios ---------- */

.oculto { display: none !important; }
.cargando { text-align: center; padding: 64px 0; color: var(--texto-suave); }

footer { text-align: center; padding: 28px; font-size: .82rem; color: var(--texto-suave); }
footer a { color: var(--azul); font-weight: 700; text-decoration: none; }
footer a:hover { text-decoration: underline; }

.legal { max-width: 860px; }
.legal h1 { font-size: 1.7rem; margin-bottom: 8px; }
.legal .seccion p { color: var(--texto-suave); margin-top: 10px; }
.legal .seccion h2 { margin-bottom: 8px; }

/* ---------- perfil ---------- */

.lista-datos { display: flex; flex-direction: column; }
.dato-perfil {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 12px 4px; border-bottom: 1px solid var(--fondo); flex-wrap: wrap;
}
.dato-perfil:last-child { border-bottom: none; }
.dato-perfil > span { color: var(--texto-suave); font-size: .88rem; }
.dato-perfil > strong { text-align: right; word-break: break-word; }
.dato-perfil a.nota { margin-left: 8px; }

.zona-peligro { border-color: #f3b4ae; }
.zona-peligro::before { background: linear-gradient(90deg, var(--rojo), #f39b94 55%, transparent 90%); }
.boton.peligro { background: var(--rojo); box-shadow: 0 1px 2px rgba(217, 48, 37, .3); }
.boton.peligro:hover { background: #b3261e; box-shadow: 0 3px 8px rgba(217, 48, 37, .35); }

@media (max-width: 560px) {
  body { font-size: 15px; }
  .hero { padding: 56px 16px 40px; }
  .hero h1 { font-size: 1.8rem; }
  /* Sección del QR en columna: QR centrado arriba, enlace y botones abajo
     a lo ancho (evita que la columna quede exprimida junto al QR) */
  .fila-qr { flex-direction: column; align-items: center; gap: 18px; }
  .acciones-qr { min-width: 0; width: 100%; max-width: 320px; }
  .enlace-corto { width: 100%; text-align: center; }
  .seccion { padding: 20px 16px; }
  .contenedor { padding: 0 14px; }
  /* Barra superior liviana en el teléfono: solo la P, pestañas y Salir */
  .logo .logo-texto { display: none; }
  .correo-header { display: none; }
  header.barra .contenedor { gap: 8px; }
  .marca-nav { gap: 10px; }
  .pestanas a { padding: 7px 11px; font-size: .88rem; }
  .fila-filtros select { min-width: 104px; }
}
