/* tendon_pagos.css - el aviso de pago de tendon dentro de las apps de los clientes (version 1.0).
   IDENTICO en todas las apps (se copia con herramientas/pieza_apps/copiar_a_apps.py): no se edita dentro de una app.
   Cargarlo ANTES de la hoja de la app. Los colores salen de :root. Los --pago-* son los de tendon (portal). Cada app puede apuntar los --tp-*
   a sus propias variables (en su hoja, que va despues) para que el aviso siga su modo claro / oscuro. */
:root {
  --pago-amarillo: #ffd60a; --pago-amarillo-tinta: #2e2400; --pago-rojo: #d70015; --pago-rojo-tinta: #ffffff;
  --tp-fondo: #ffffff; --tp-texto: #1d1d1f; --tp-suave: #6e6e73; --tp-borde: rgba(60, 60, 67, 0.22); --tp-clave: #0a64d8; --tp-ok: #1f7a37;
  --tp-curva: cubic-bezier(0.22, 1, 0.36, 1);
  --fibra-tensa: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 34 10' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='M1 2.6C12 2.4 23 2.4 33 2.6'/%3E%3Cpath d='M1 5C12 5 23 5 33 5'/%3E%3Cpath d='M1 7.4C12 7.6 23 7.6 33 7.4'/%3E%3C/svg%3E");
  --fibra-floja: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 34 10' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='M1 5C9 0.8 24 9.2 33 5'/%3E%3Cpath d='M1 5C9 2.8 24 7.2 33 5'/%3E%3Cpath d='M1 5C9 5.6 24 4.4 33 5'/%3E%3C/svg%3E");
  --fibra-rota: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 34 10' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='M1 3.4C6 3.4 10 3 13 1.4'/%3E%3Cpath d='M1 5C6 5 10 5 14 5.6'/%3E%3Cpath d='M1 6.6C6 6.6 10 7.4 12 9'/%3E%3Cpath d='M21 1.6C24 3.4 28 3.8 33 3.8'/%3E%3Cpath d='M20 5.4C24 5 28 5 33 5'/%3E%3Cpath d='M22 8.6C25 6.6 28 6.2 33 6.2'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root { --pago-rojo: #e0152a; --tp-fondo: #1c1c1e; --tp-texto: #f5f5f7; --tp-suave: #a1a1a8; --tp-borde: rgba(235, 235, 245, 0.22); --tp-clave: #4da3ff; --tp-ok: #30d158; }
}
:root[data-tema="oscuro"], :root[data-theme="dark"], :root.oscuro, :root.dark, body[data-tema="oscuro"], body.oscuro, body.dark {
  --pago-rojo: #e0152a; --tp-fondo: #1c1c1e; --tp-texto: #f5f5f7; --tp-suave: #a1a1a8; --tp-borde: rgba(235, 235, 245, 0.22); --tp-clave: #4da3ff; --tp-ok: #30d158;
}
:root[data-tema="claro"], :root[data-theme="light"], :root.claro, :root.light { --pago-rojo: #d70015; }

/* ---- el aviso */
.tp-aviso { box-sizing: border-box; display: flex; align-items: center; gap: 10px 22px; flex-wrap: wrap; margin: 0 0 14px; border-radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif; line-height: 1.3; text-align: left; letter-spacing: normal; }
.tp-aviso[hidden] { display: none; }
.tp-aviso * { box-sizing: border-box; }
.tp-aviso .tp-texto { flex: 1 1 260px; min-width: 0; }
.tp-aviso p { margin: 0; }
.tp-aviso .tp-titulo { display: flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.tp-aviso .tp-titulo::before { content: ""; flex: none; width: 42px; height: 14px; background: currentColor;
  -webkit-mask: var(--fibra-tensa) center / contain no-repeat; mask: var(--fibra-tensa) center / contain no-repeat; }
.tp-aviso .tp-detalle { margin-top: 6px; font-weight: 500; }
.tp-aviso .tp-lema { margin-top: 10px; font-size: 1.02rem; font-weight: 700; }
.tp-aviso .tp-cobro { margin-top: 8px; font-size: 0.92rem; font-weight: 600; }
.tp-aviso .tp-nota { margin-top: 6px; font-size: 0.8rem; opacity: 0.75; }
.tp-aviso .tp-pagar { flex: none; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 24px; border-radius: 999px;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; border: 1px solid transparent; white-space: nowrap; }
/* al corriente: discreto, una linea con su fibra tensa */
.tp-aviso.tp-al_corriente { padding: 8px 14px; background: transparent; color: var(--tp-suave); border: 1px solid var(--tp-borde); gap: 6px 14px; }
.tp-aviso.tp-al_corriente .tp-titulo { font-size: 0.9rem; color: var(--tp-ok); letter-spacing: -0.01em; }
.tp-aviso.tp-al_corriente .tp-titulo::before { width: 30px; height: 10px; }
.tp-aviso.tp-al_corriente .tp-cobro { flex-basis: 100%; margin: 2px 0 0; font-size: 0.86rem; color: var(--tp-texto); }
.tp-aviso.tp-al_corriente .tp-detalle { margin: 0; font-size: 0.84rem; font-weight: 500; }
.tp-aviso.tp-al_corriente .tp-texto { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; }
.tp-aviso.tp-al_corriente .tp-pagar { min-height: 32px; padding: 0 14px; font-size: 0.82rem; background: transparent; color: var(--tp-clave); border-color: var(--tp-borde); }
/* se acerca: amarillo */
.tp-aviso.tp-por_vencer { padding: 18px 22px; background: var(--pago-amarillo); color: var(--pago-amarillo-tinta); animation: tp-entra 0.3s var(--tp-curva) both; }
.tp-aviso.tp-por_vencer .tp-titulo { font-size: 1.2rem; }
.tp-aviso.tp-por_vencer .tp-titulo::before { -webkit-mask-image: var(--fibra-floja); mask-image: var(--fibra-floja); animation: tp-tensa 2.4s ease-in-out infinite; transform-origin: left center; }
.tp-aviso.tp-por_vencer .tp-detalle { font-size: 0.94rem; opacity: 0.86; }
.tp-aviso.tp-por_vencer .tp-pagar { background: var(--pago-amarillo-tinta); color: var(--pago-amarillo); }
/* pendiente y vencido: rojo, llamativo */
.tp-aviso.tp-pendiente, .tp-aviso.tp-vencido { padding: 22px 26px; background: var(--pago-rojo); color: var(--pago-rojo-tinta); animation: tp-entra 0.3s var(--tp-curva) both; }
.tp-aviso.tp-pendiente .tp-titulo, .tp-aviso.tp-vencido .tp-titulo { font-size: clamp(1.5rem, 4.4vw, 2.2rem); }
.tp-aviso.tp-pendiente .tp-titulo::before { -webkit-mask-image: var(--fibra-floja); mask-image: var(--fibra-floja); width: 52px; height: 17px; animation: tp-tensa 1.8s ease-in-out infinite; transform-origin: left center; }
.tp-aviso.tp-vencido .tp-titulo::before { -webkit-mask-image: var(--fibra-rota); mask-image: var(--fibra-rota); width: 52px; height: 17px; animation: tp-vibra 2.2s ease-in-out infinite; }
.tp-aviso.tp-pendiente .tp-detalle, .tp-aviso.tp-vencido .tp-detalle { font-size: 1rem; opacity: 0.94; }
.tp-aviso.tp-pendiente .tp-pagar, .tp-aviso.tp-vencido .tp-pagar { min-height: 50px; padding: 0 28px; font-size: 1.06rem; background: var(--pago-rojo-tinta); color: var(--pago-rojo); }
.tp-aviso .tp-pagar:hover { opacity: 0.9; }
.tp-aviso .tp-pagar:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }
@keyframes tp-entra { from { opacity: 0; transform: translateY(8px); } }
@keyframes tp-tensa { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(0.82); } }
@keyframes tp-vibra { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-1.5px); } 40% { transform: translateX(1.5px); } 60% { transform: translateX(-1px); } 80% { transform: translateX(1px); } }
@media (max-width: 560px) {
  .tp-aviso.tp-por_vencer { padding: 16px 18px; }
  .tp-aviso.tp-pendiente, .tp-aviso.tp-vencido { padding: 20px 18px; }
  .tp-aviso:not(.tp-al_corriente) .tp-pagar { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .tp-aviso, .tp-aviso .tp-titulo::before { animation: none !important; }
}
@media print { .tp-aviso { display: none; } }

/* ---- «Hecho por tendon»: pequeno y discreto (mayusculas chicas, gris, logo de ~11 px, opacidad ~0.55) */
.tp-hecho { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 14px 0 0; font-size: 9.5px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--tp-suave); opacity: 0.55; line-height: 1; font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif; }
.tp-hecho a { display: inline-flex; align-items: center; color: inherit; text-decoration: none; }
.tp-hecho a:hover, .tp-hecho a:focus-visible { opacity: 1; text-decoration: underline; }
.tp-hecho img { height: 11px; width: auto; display: block; }
.tp-hecho .tp-palabra { font-size: 12px; font-weight: 800; letter-spacing: -0.02em; text-transform: lowercase; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }
