/* Letra de la marca y animaciones del portal.
   Todo es corto y suave (nada destella más de 3 veces por segundo) y se apaga con "reducir movimiento". */

/* ---------- Letra Unbounded (títulos, botones y nombre de la marca; el texto largo sigue en Inter) ---------- */
@font-face { font-family: "Unbounded"; src: url("/fonts/Unbounded-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
h1, h2, h3, .brand span, .sos, .btn, .stat b, .step-head h3, .offer-top b, .attn-box b, .auth-art h2, .wb-main b {
  font-family: "Unbounded", "Inter", system-ui, sans-serif; font-weight: 400; letter-spacing: 0; font-synthesis: none;
}
.btn { font-size: .94em; }
.brand em { font-family: inherit; }
.brand span { font-size: 14px; }
/* Clientes en pantallas medianas: menú más compacto y solo las iniciales, como el Super Admin */
@media (min-width: 1181px) and (max-width: 1480px) { .role-client .nav a { padding: 8px 7px; font-size: 14px; } .role-client #who-name { display: none; } .role-client .me { padding-right: 4px; } }
/* Facturas, hojas de servicio y carnets impresos se quedan con su letra */
.invoice-mode h1, .invoice-mode h2, .invoice-mode h3, .invoice-mode .stat b { font-family: "Inter", system-ui, sans-serif; font-weight: 700; }

/* ---------- 1. Reserva paso a paso: cada paso entra deslizándose y el ✓ aparece ---------- */
#bf .step:not(.hidden) { animation: m-step-in .32s ease-out; }
@keyframes m-step-in { from { opacity: 0; transform: translateX(24px); } }
.wiz li { transition: border-color .25s, box-shadow .25s, color .25s; }
.wiz li.done .wiz-n::after { display: inline-block; animation: m-pop .35s ease-out; }
@keyframes m-pop { 0% { transform: scale(0); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }
.celebrate { position: fixed; left: 50%; top: 42%; width: 96px; height: 96px; margin: -48px 0 0 -48px; z-index: 9500; pointer-events: none; border-radius: 50%; background: var(--surface); box-shadow: 0 12px 40px rgba(0,0,0,.18); animation: m-cel 1.6s ease-in-out forwards; }
.celebrate svg { width: 100%; height: 100%; }
.celebrate circle { fill: none; stroke: var(--ok); stroke-width: 3; stroke-dasharray: 145; stroke-dashoffset: 145; animation: m-draw .5s ease-out .1s forwards; }
.celebrate path { fill: none; stroke: var(--ok); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: m-draw .35s ease-out .55s forwards; }
@keyframes m-draw { to { stroke-dashoffset: 0; } }
@keyframes m-cel { 0% { opacity: 0; transform: scale(.7); } 15% { opacity: 1; transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(.9); } }

/* ---------- 2. Botón SignConnect Now: turquesa con punto que late si hay intérpretes; gris si no ---------- */
.sos { transition: background .3s, color .3s; }
.sos .sos-dot { position: relative; }
.sos.live { background: var(--brand); color: var(--ink); }
.sos.live .sos-dot { background: #fff; }
.sos.live .sos-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #fff; animation: m-ping 1.8s ease-out infinite; }
.sos.live:hover { background: var(--brand-hover); }
.sos.live:hover .sos-dot { background: #fff; }
.sos.idle { background: var(--line); color: var(--muted); }
.sos.idle .sos-dot, .sos.idle:hover .sos-dot { background: #a7a6b3; }
.sos.idle:hover { background: #dddde5; color: var(--text); }
@keyframes m-ping { 0% { transform: scale(1); opacity: .75; } 100% { transform: scale(2.8); opacity: 0; } }
/* En el teléfono: el botón redondo del medio de la barra de abajo */
.sos-live .tabbar a.tab-main { position: relative; }
.sos-live .tabbar a.tab-main::before { content: ""; position: absolute; left: 50%; top: -18px; width: 42px; height: 42px; margin-left: -21px; border-radius: 50%; background: var(--brand); animation: m-ring 2s ease-out infinite; pointer-events: none; }
.sos-live .tabbar a.tab-main svg { position: relative; }
.sos-idle .tabbar a.tab-main svg { background: #b9b8c4; box-shadow: none; }
@keyframes m-ring { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(1.7); opacity: 0; } }
:root[data-theme="dark"] .sos.live { color: #101016; }
:root[data-theme="dark"] .sos.idle:hover { background: #3a3946; }
:root[data-theme="contrast"] .sos.live { color: #fff; }

/* ---------- 3. Espera de la llamada: manos que saludan ---------- */
.wb-hands { display: inline-flex; gap: 4px; font-size: 24px; flex: none; }
.wb-hands i { font-style: normal; display: inline-block; animation: m-wave 1.4s ease-in-out infinite; }
.wb-hands i:nth-child(2) { animation-delay: .2s; }
.wb-hands i:nth-child(3) { animation-delay: .4s; }
@keyframes m-wave { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-6px) rotate(-10deg); } }

/* ---------- 4. Aviso de llamada para intérpretes: el borde brilla suave mientras suena (el teléfono ya vibra) ---------- */
.offer { animation: offer-in .2s ease-out, m-offer-glow 1.6s ease-in-out .2s infinite; }
@keyframes m-offer-glow {
  0%, 100% { box-shadow: 0 0 0 100vmax rgba(28, 27, 38, .55), 0 0 0 0 rgba(51, 204, 204, .5), 0 20px 50px rgba(0,0,0,.3); }
  50% { box-shadow: 0 0 0 100vmax rgba(28, 27, 38, .55), 0 0 0 12px rgba(51, 204, 204, .35), 0 20px 50px rgba(0,0,0,.3); }
}
.offer-left { animation: m-beat 1s ease-in-out infinite; }
@keyframes m-beat { 50% { transform: scale(1.12); } }
/* Aviso a pantalla completa: cambio de color suave en vez de un parpadeo seco */
.attn { animation: m-attn 1.1s ease-in-out 5 alternate; }
@keyframes m-attn { from { background: rgba(19, 138, 140, .94); } to { background: rgba(51, 204, 204, .72); } }
.attn-box { animation: m-pop .4s ease-out; }

/* ---------- 5. Barras de contrato y números: se llenan y cuentan al abrir la sección (los números los cuenta app.js) ---------- */
.entering .bar > i { transform-origin: left center; animation: m-bar 1.1s cubic-bezier(.2, .8, .2, 1) .1s backwards; }
@keyframes m-bar { from { transform: scaleX(0); } }
.bar.low > i { transition: background .4s; }
.entering .pc-bar i, .entering .pc-office i { transform-origin: left center; animation: m-bar 1.1s cubic-bezier(.2, .8, .2, 1) .1s backwards; }
.entering .pc-bar i.res { animation-delay: .5s; }
/* Mi panel: la barra del contrato se pone amarilla cuando queda poco y roja cuando se acaba */
.panel-contract.warn .pc-bar i.used { background: var(--warn); }
.panel-contract.bad .pc-bar i.used { background: var(--danger); }
.entering .panel-chart-wrap svg { animation: m-rise 1.1s cubic-bezier(.2, .8, .2, 1) .15s backwards; }
@keyframes m-rise { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }

/* ---------- 6. Tablas y listas: las primeras filas entran una tras otra ---------- */
.entering #view tbody tr:nth-child(-n+12), .entering #view .bcard:nth-child(-n+12), .entering #view .cards > .card { animation: m-row .35s ease-out backwards; }
.entering #view tbody tr:nth-child(2), .entering #view .bcard:nth-child(2), .entering #view .cards > .card:nth-child(2) { animation-delay: .05s; }
.entering #view tbody tr:nth-child(3), .entering #view .bcard:nth-child(3), .entering #view .cards > .card:nth-child(3) { animation-delay: .1s; }
.entering #view tbody tr:nth-child(4), .entering #view .bcard:nth-child(4), .entering #view .cards > .card:nth-child(4) { animation-delay: .15s; }
.entering #view tbody tr:nth-child(5), .entering #view .bcard:nth-child(5) { animation-delay: .2s; }
.entering #view tbody tr:nth-child(6), .entering #view .bcard:nth-child(6) { animation-delay: .25s; }
.entering #view tbody tr:nth-child(7), .entering #view .bcard:nth-child(7) { animation-delay: .3s; }
.entering #view tbody tr:nth-child(8), .entering #view .bcard:nth-child(8) { animation-delay: .35s; }
.entering #view tbody tr:nth-child(n+9):nth-child(-n+12), .entering #view .bcard:nth-child(n+9):nth-child(-n+12) { animation-delay: .4s; }
@keyframes m-row { from { opacity: 0; transform: translateY(8px); } }

/* ---------- 7. Tarjetas y opciones que se levantan al pasar el ratón o tocar ---------- */
.choice, .sign-btn, .bcard { transition: transform .2s ease, box-shadow .2s ease, border-color .2s, background .2s; }
.choice:hover, .sign-btn:hover, .bcard:hover { transform: translateY(-4px); box-shadow: 0 10px 22px rgba(30, 28, 45, .12); }
.choice:active, .sign-btn:active, .bcard:active { transform: translateY(-1px) scale(.98); }
.btn { transition: transform .15s ease, background .15s, box-shadow .15s; }
.btn:active:not(:disabled) { transform: scale(.97); }

/* ---------- 8. Entrada: el logo se dibuja, saluda y abajo se mueve una ola suave ---------- */
.auth-art .logo-anim { width: 260px; max-width: 72%; height: auto; overflow: visible; position: relative; z-index: 1; }
.logo-anim .hp { fill: #33cccc; stroke: #33cccc; stroke-width: 1.2; stroke-dasharray: 1; stroke-dashoffset: 0; animation: m-trace 1.6s ease-in-out backwards, m-fill .6s ease-out 1.3s backwards; }
.logo-anim .word path { fill: #fff; animation: m-letter .45s ease-out backwards; animation-delay: calc(1.2s + var(--i) * 70ms); }
.logo-anim .hand { transform-origin: 110px 280px; animation: m-hola 1.1s ease-in-out 1.9s; }
@keyframes m-trace { from { stroke-dashoffset: 1; } }
@keyframes m-fill { from { fill: transparent; } }
@keyframes m-letter { from { opacity: 0; transform: translateY(6px); } }
@keyframes m-hola { 25% { transform: rotate(-7deg); } 55% { transform: rotate(5deg); } 80% { transform: rotate(-2deg); } 100% { transform: rotate(0); } }
.auth-art > div { position: relative; z-index: 1; }
.auth-wave { position: absolute; left: 0; bottom: 0; width: 140%; height: 110px; pointer-events: none; opacity: .5; }
.auth-wave path { fill: rgba(51, 204, 204, .18); }
.auth-wave .w1 { animation: m-drift 11s ease-in-out infinite alternate; }
.auth-wave .w2 { fill: rgba(51, 204, 204, .12); animation: m-drift 15s ease-in-out infinite alternate-reverse; }
@keyframes m-drift { to { transform: translateX(-160px); } }
@media (max-width: 760px) {
  .auth-art .logo-anim { width: 170px; max-width: 60%; }
  .auth-wave { height: 60px; }
}

/* ---------- Reducir movimiento: todo quieto ---------- */
@media (prefers-reduced-motion: reduce) {
  #bf .step, .wiz li.done .wiz-n::after, .celebrate, .celebrate *, .sos.live .sos-dot::after, .sos-live .tabbar a.tab-main::before, .wb-hands i, .offer, .offer-left, .attn, .attn-box,
  .entering .bar > i, .entering .pc-bar i, .entering .pc-office i, .entering .panel-chart-wrap svg, .entering #view tbody tr, .entering #view .bcard, .entering #view .cards > .card,
  .logo-anim .hp, .logo-anim .word path, .logo-anim .hand, .auth-wave path { animation: none !important; }
  .celebrate { display: none; }
  .sos.live .sos-dot::after, .sos-live .tabbar a.tab-main::before { display: none; }
  .choice:hover, .sign-btn:hover, .bcard:hover, .btn:active:not(:disabled) { transform: none; }
}
