/* ==========================================================================
   Portal del cliente v2 (body.pv2): formato profesional.
   - Formulario: en computadora, panel informativo a la izquierda + tarjeta del formulario.
     En celular, solo la tarjeta.
   - Solicitud: tarjeta con el color de la plataforma, anillo con el tiempo restante y código grande.
   Se carga al final (después de cliente.css, mis-servicios.css y solicitud.css) y solo cambia el estilo.
   ========================================================================== */
body.pv2 {
    --pv-ink: #0f172a;
    --pv-ink-2: #334155;
    --pv-muted: #64748b;
    --pv-line: #e5e7eb;
    --pv-soft: #f8fafc;
    --pv-accent: #e9573f;
    --pv-accent-2: #f26b4f;
    --pv-accent-soft: #fff1ed;
    --pv-ok: #0f9d6b;
    gap: 22px;
    padding: max(28px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
    background:
        radial-gradient(1100px 600px at 100% -10%, rgba(233, 87, 63, .22), transparent 60%),
        radial-gradient(900px 600px at -10% 110%, rgba(56, 97, 186, .32), transparent 60%),
        linear-gradient(180deg, #0b1324, #111c33);
    color: var(--pv-ink);
}
/* Con imagen de fondo propia (Imágenes del panel) se respeta esa imagen. */
body.pv2.has-bg { background-color: #0b1324; }

/* ---------- Estructura ---------- */
.pv-shell { display: flex; justify-content: center; width: 100%; }
.pv2.pv-is-form .pv-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 470px);
    width: min(1000px, 100%);
    overflow: hidden;
    border-radius: 26px;
    background: #fff;
    box-shadow: 0 40px 90px -20px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .06);
    animation: card-in .45s cubic-bezier(.2, .7, .2, 1) both;
}

/* ---------- Panel informativo (izquierda) ---------- */
.pv-side {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 38px 38px 32px;
    overflow: hidden;
    background:
        radial-gradient(420px 300px at 110% 0%, rgba(233, 87, 63, .35), transparent 70%),
        radial-gradient(380px 320px at -20% 100%, rgba(56, 97, 186, .45), transparent 70%),
        linear-gradient(160deg, #15233f, #0e1830);
    color: #e2e8f0;
}
.pv-side::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px);
    background-size: 18px 18px;
    mask-image: linear-gradient(180deg, transparent, #000 40%, transparent);
    pointer-events: none;
}
.pv-side > * { position: relative; z-index: 1; }
.pv-side .brand { color: #fff; font-size: 18px; }
.pv-side-main { flex: 1; }
.pv-kicker { display: inline-block; margin-bottom: 14px; padding: 5px 11px; border: 1px solid rgba(255, 255, 255, .16); border-radius: 999px; background: rgba(255, 255, 255, .06); color: #fbd5cb; font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; }
.pv-side h2 { margin: 0 0 12px; color: #fff; font: 700 32px/1.12 'Space Grotesk', sans-serif; letter-spacing: -.6px; }
.pv-side-main > p { max-width: 380px; margin: 0 0 26px; color: #b6c2d6; font-size: 15px; line-height: 1.6; }
.pv-feats { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.pv-feats li { display: flex; align-items: flex-start; gap: 14px; }
.pv-feat-ico { display: grid; flex: none; place-items: center; width: 40px; height: 40px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 12px; background: rgba(255, 255, 255, .07); color: #ffb4a3; }
.pv-feats b { display: block; color: #fff; font-size: 14.5px; }
.pv-feats small { display: block; margin-top: 2px; color: #a3b1c6; font-size: 13px; line-height: 1.45; }
.pv-side-foot { padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .1); }
.pv-side-foot > small { display: block; margin-bottom: 10px; color: #8b9ab2; font-size: 11.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.pv-plats { display: flex; flex-wrap: wrap; gap: 8px; }
.pv-plat { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px 5px 5px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 999px; background: rgba(255, 255, 255, .06); color: #dbe3ef; font-size: 12.5px; font-weight: 600; }
.pv-plat i, .pv-plat img { display: grid; flex: none; place-items: center; width: 22px; height: 22px; border-radius: 7px; color: #fff; font: 700 11px 'Space Grotesk', sans-serif; font-style: normal; object-fit: contain; }

/* ---------- Tarjeta ---------- */
body.pv2 .client-card {
    width: min(500px, 100%);
    padding: 34px 32px 28px;
    border: 0;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 40px 90px -20px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .06);
}
.pv2.pv-is-form .client-card { width: auto; padding: 40px 40px 30px; border-radius: 0; box-shadow: none; animation: none; text-align: left; }
.pv2.pv-is-form .client-card > .brand { display: none; }
body.pv2 .client-card .brand { color: var(--pv-ink); }
body.pv2 .brand-mark { background: linear-gradient(135deg, var(--pv-accent-2), var(--pv-accent)); box-shadow: 0 6px 14px -4px rgba(233, 87, 63, .6); }

/* Encabezado del formulario */
.pv-head { margin-bottom: 22px; }
.pv2 .pv-head .eyebrow { margin-bottom: 10px; padding: 0; border-radius: 0; background: none; color: var(--pv-accent); font-size: 11.5px; letter-spacing: 1.3px; }
body.pv2 .pv-head h1 { margin: 0 0 6px; color: var(--pv-ink); font: 700 28px/1.15 'Space Grotesk', sans-serif; letter-spacing: -.5px; }
body.pv2 .pv-head p { margin: 0; color: var(--pv-muted); font-size: 14.5px; line-height: 1.55; }

/* Campos */
body.pv2 .client-card form { gap: 20px; }
body.pv2 .client-card .field label { display: flex; align-items: center; gap: 9px; color: var(--pv-ink); font-size: 13.5px; font-weight: 700; }
.pv-step { display: grid; flex: none; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--pv-ink); color: #fff; font: 700 11.5px 'Space Grotesk', sans-serif; }
.pv-input { position: relative; display: flex; align-items: center; }
.pv-input > svg { position: absolute; left: 14px; color: #94a3b8; pointer-events: none; transition: color .15s; }
body.pv2 .client-card .pv-input input {
    width: 100%;
    height: 50px;
    padding: 0 14px 0 44px;
    border: 1.5px solid #dfe3ea;
    border-radius: 12px;
    background: var(--pv-soft);
    color: var(--pv-ink);
    font: 500 15px 'DM Sans', sans-serif;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
body.pv2 .client-card .pv-input input::placeholder { color: #9aa5b5; font-weight: 400; }
body.pv2 .client-card .pv-input input:hover { border-color: #cbd2dc; }
body.pv2 .client-card .pv-input input:focus { border-color: var(--pv-accent); background: #fff; outline: none; box-shadow: 0 0 0 4px rgba(233, 87, 63, .14); }
.pv-input:focus-within > svg { color: var(--pv-accent); }
body.pv2 .client-card #pin { letter-spacing: 3px; }
body.pv2 .client-card #pin::placeholder { letter-spacing: 0; }
body.pv2 .client-card .field.is-invalid .pv-input input { border-color: #dc2626; background: #fffafa; box-shadow: 0 0 0 4px rgba(220, 38, 38, .1); }
body.pv2 .client-card .field.is-invalid .pv-input > svg { color: #dc2626; }
body.pv2 .client-card .field.is-invalid .pv-step { background: #dc2626; }

/* Plataformas: cuadrícula pareja */
body.pv2 .platform-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); grid-auto-rows: 1fr; align-items: stretch; gap: 10px; }
body.pv2 .platform-option span { height: 100%; }
body.pv2 .platform-option { display: flex; align-self: stretch; max-width: none; }
body.pv2 .platform-option span { justify-content: center; gap: 8px; padding: 14px 6px 12px; border: 1.5px solid #e3e7ee; border-radius: 14px; background: #fff; color: var(--pv-ink-2); font-size: 12.5px; font-weight: 700; line-height: 1.25; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
body.pv2 .platform-option:hover span { border-color: #c8d0dc; box-shadow: 0 6px 16px -8px rgba(15, 23, 42, .25); }
body.pv2 .platform-option i { width: 42px; height: 42px; border-radius: 12px; font-size: 18px; box-shadow: 0 6px 14px -6px rgba(15, 23, 42, .45); }
body.pv2 .platform-option input:checked + span { border-color: var(--pv-accent); background: var(--pv-accent-soft); color: var(--pv-ink); box-shadow: 0 0 0 3px rgba(233, 87, 63, .15); }

/* Botón principal */
body.pv2 .client-card .btn-primary { gap: 10px; min-height: 52px; border-radius: 13px; background: linear-gradient(135deg, var(--pv-accent-2), var(--pv-accent)); font-size: 15.5px; font-weight: 700; letter-spacing: .1px; box-shadow: 0 12px 24px -10px rgba(233, 87, 63, .75); transition: transform .15s, box-shadow .15s, filter .15s; }
body.pv2 .client-card .btn-primary:hover { filter: brightness(1.04); box-shadow: 0 16px 30px -12px rgba(233, 87, 63, .85); }
.pv-submit svg { transition: transform .15s; }
.pv-submit:hover svg { transform: translateX(3px); }
.pv-secure { display: flex; align-items: center; justify-content: center; gap: 6px; margin: -6px 0 0 !important; color: #8a95a8 !important; font-size: 12.5px !important; text-align: center; }
.pv-secure svg { color: var(--pv-ok); }

/* Aviso de error */
body.pv2 .client-card .alert { border: 1px solid #fecaca; background: #fef2f2; color: #991b1b; }

/* Mis servicios y nota final */
body.pv2 .ms-entry { margin-top: 22px; border-radius: 14px; }
.pv2.pv-is-form .client-card > .hint { margin-top: 14px; text-align: center; }

/* ---------- Solicitud ---------- */
.pv2.pv-is-request .client-card { position: relative; overflow: hidden; padding-top: 30px; }
.pv2.pv-is-request .client-card::before { content: ''; position: absolute; top: 0; right: 0; left: 0; height: 5px; background: linear-gradient(90deg, var(--pc, var(--pv-accent)), color-mix(in srgb, var(--pc, var(--pv-accent)) 55%, #fff)); }
.pv2.pv-is-request .client-card > .brand { margin-bottom: 20px; font-size: 16px; }
.pv2 .rq-top { padding: 14px; border: 1px solid var(--pv-line); border-radius: 16px; background: var(--pv-soft); }
.pv2 .rq-logo { width: 48px; height: 48px; border-radius: 14px; box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--pc, #0f172a) 70%, transparent); }
.pv2 .client-card .rq-top h1 { font-size: 19px; }
.pv2 .client-card .rq-member { margin: 12px 2px 0; padding: 10px 12px; border-radius: 12px; background: #f0fdf4; color: #166534; font-size: 13px; }
.pv2 .client-card .rq-member.is-warn { background: #fffbeb; color: #92400e; }
.pv2 .client-card .rq-member.is-over { background: #fef2f2; color: #991b1b; }
.pv2 .rq-member b { color: inherit; font-weight: 700; }

/* Pasos */
body.pv2 .steps { margin: 22px 0 6px; color: #94a3b8; font-size: 12px; }
body.pv2 .steps li { padding-top: 26px; }
body.pv2 .steps li::before { width: 18px; height: 18px; border: 2px solid #e2e8f0; background: #fff; box-sizing: border-box; }
body.pv2 .steps li::after { top: 8px; height: 2px; background: #e2e8f0; }
body.pv2 .steps li.done { color: var(--pv-ok); }
body.pv2 .steps li.done::before { border-color: var(--pv-ok); background: var(--pv-ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 10px no-repeat; }
body.pv2 .steps li.done::after { background: var(--pv-ok); }
body.pv2 .steps li.active { color: var(--pv-ink); }
body.pv2 .steps li.active::before { border-color: var(--pv-accent); background: #fff; box-shadow: 0 0 0 5px rgba(233, 87, 63, .16); }

/* Esperando: anillo con el tiempo restante */
.pv-wait { display: grid; justify-items: center; gap: 6px; margin: 18px 0 6px; padding: 24px 16px 20px; border: 1px solid var(--pv-line); border-radius: 18px; background: linear-gradient(180deg, #fff, var(--pv-soft)); }
.pv-ring { --p: 1; position: relative; width: 138px; height: 138px; margin-bottom: 8px; }
.pv-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pv-ring circle { fill: none; stroke-width: 7; }
.pv-ring-bg { stroke: #eef1f5; }
.pv-ring-fg { stroke: var(--pc, var(--pv-accent)); stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--p) * 100); stroke-linecap: round; transition: stroke-dashoffset 1s linear, stroke .3s; }
.pv-ring.is-low .pv-ring-fg { stroke: #dc2626; }
.pv-ring-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.pv-ring-text b { color: var(--pv-ink); font: 700 30px/1 'Space Grotesk', sans-serif; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.pv-ring-text small { margin-top: 4px; color: var(--pv-muted); font-size: 11.5px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; }
.pv-ring.is-low .pv-ring-text b { color: #dc2626; }
.pv-wait-title { display: inline-flex; align-items: center; gap: 10px; color: var(--pv-ink); font: 700 17px 'Space Grotesk', sans-serif; }
.pv-wait-sub { max-width: 320px; color: var(--pv-muted); font-size: 13px; line-height: 1.5; text-align: center; }
.pv-dots { display: inline-flex; gap: 4px; }
.pv-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--pc, var(--pv-accent)); animation: pv-dot 1.2s ease-in-out infinite; }
.pv-dots i:nth-child(2) { animation-delay: .15s; }
.pv-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes pv-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
body.pv2 #view-waiting .hint { margin: 14px 4px 14px; color: var(--pv-muted); font-size: 13px; line-height: 1.55; }
body.pv2 .client-card .btn-secondary { gap: 8px; min-height: 46px; border: 1.5px solid #e2e8f0; border-radius: 12px; background: #fff; color: var(--pv-ink); font-size: 14.5px; font-weight: 700; transition: background .15s, border-color .15s; }
body.pv2 .client-card .btn-secondary:hover { border-color: #cbd5e1; background: var(--pv-soft); }
body.pv2 #check-now { width: 100%; }

/* Código listo */
body.pv2 .client-code { gap: 12px; margin: 18px 0 10px; padding: 24px 18px 20px; border: 1px solid #a7f3d0; border-radius: 18px; background: linear-gradient(180deg, #ecfdf5, #f7fefb); color: #047857; }
body.pv2 .client-code > span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: #d1fae5; color: #065f46; font-size: 11.5px; letter-spacing: .8px; }
body.pv2 .client-code strong { padding: 12px 18px; border: 1.5px dashed #6ee7b7; border-radius: 14px; background: #fff; color: #064e3b; font-size: 44px; letter-spacing: 8px; font-variant-numeric: tabular-nums; }
body.pv2 .client-code .copy-btn { width: 100%; border-color: transparent; background: linear-gradient(135deg, #10b981, #059669); color: #fff; box-shadow: 0 10px 20px -10px rgba(5, 150, 105, .8); }
body.pv2 .client-code .copy-btn:hover { background: linear-gradient(135deg, #10b981, #047857); }
body.pv2 #view-ready > .hint { margin: 4px 0 6px; color: var(--pv-muted); font-size: 13px; }

/* Usado / vencido */
body.pv2 #view-used .alert, body.pv2 #view-expired .alert, body.pv2 #view-revoked .alert { border: 1px solid #fecaca; border-radius: 14px; background: #fef2f2; color: #991b1b; text-align: center; }

/* Ayuda y acciones */
body.pv2 .rq-help { margin-top: 18px; border-radius: 14px; }
body.pv2 .client-new-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
body.pv2 .client-new-row .client-new { width: 100%; margin: 0; }

/* Pie */
body.pv2 .client-footer { color: rgba(226, 232, 240, .55); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .pv2.pv-is-form .pv-shell { grid-template-columns: minmax(0, 1fr); width: min(520px, 100%); }
    .pv2 .pv-side { display: none; }
    .pv2.pv-is-form .client-card > .brand { display: flex; justify-content: center; margin-bottom: 22px; }
    .pv2.pv-is-form .pv-head { text-align: center; }
}
@media (max-width: 480px) {
    body.pv2 { padding: 14px 12px 18px; justify-content: flex-start; }
    .pv2.pv-is-form .pv-shell { border-radius: 22px; }
    .pv2.pv-is-form .client-card, body.pv2 .client-card { padding: 26px 18px 22px; }
    body.pv2 .pv-head h1 { font-size: 24px; }
    body.pv2 .pv-head p { font-size: 14px; }
    body.pv2 .platform-options { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
    body.pv2 .platform-option span { padding: 12px 4px 10px; font-size: 12px; }
    body.pv2 .platform-option i { width: 38px; height: 38px; font-size: 16px; }
    .pv-ring { width: 120px; height: 120px; }
    .pv-ring-text b { font-size: 26px; }
    body.pv2 .client-code strong { padding: 10px 12px; font-size: 34px; letter-spacing: 5px; }
}
@media (max-width: 340px) {
    body.pv2 .platform-options { grid-template-columns: 1fr 1fr; }
    body.pv2 .client-code strong { font-size: 28px; letter-spacing: 3px; }
}
@media (prefers-reduced-motion: reduce) {
    .pv2.pv-is-form .pv-shell, .pv-dots i { animation: none; }
    .pv-ring-fg, .pv-submit svg { transition: none; }
}

/* ==========================================================================
   Mis servicios v2 (mismo estilo del portal): acceso y panel con los servicios.
   ========================================================================== */

/* ---------- Acceso ---------- */
.pv-side-note { margin: 0; color: #a3b1c6; font-size: 13px; }
body.pv2 .ms-login form { gap: 18px; }
body.pv2 .ms-seg { padding: 4px; border: 1px solid #e5e7eb; border-radius: 13px; background: var(--pv-soft); }
body.pv2 .client-card .ms-seg label { display: block; }
body.pv2 .ms-seg span { padding: 10px 8px; color: var(--pv-muted); font-size: 13.5px; }
body.pv2 .ms-seg input:checked + span { background: #fff; color: var(--pv-ink); box-shadow: 0 1px 2px rgba(15, 23, 42, .08), 0 4px 12px -4px rgba(15, 23, 42, .18); }
body.pv2 .ms-help { margin-top: 2px; color: #8a95a8; font-size: 12.5px; }
body.pv2 .client-card .ms-secret.pv-input input { padding-right: 50px; }
body.pv2 .ms-eye { right: 7px; }
[data-ms-login][data-by="phone"] .pv-ico-email, [data-ms-login][data-by="email"] .pv-ico-phone { display: none; }
body.pv2 .ms-back { display: block; margin-top: 16px; color: var(--pv-muted); text-align: center; }
body.pv2 .ms-back:hover { color: var(--pv-accent); }

/* ---------- Panel del cliente ---------- */
body.pv2.pv-is-ms { justify-content: flex-start; }
.pv-is-ms .ms-shell { width: min(1040px, 100%); }
.pv-is-ms .ms-top { margin-bottom: 20px; }
.pv-is-ms .ms-logout { border-color: rgba(255, 255, 255, .16); border-radius: 12px; background: rgba(255, 255, 255, .06); }

/* Saludo y resumen */
.pv-is-ms .ms-hello { align-items: center; margin-bottom: 20px; padding: 26px 28px; border-radius: 24px; background: #fff; box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .06); }
.pv-is-ms .ms-kicker { margin-bottom: 8px; padding: 0; border-radius: 0; background: none; color: var(--pv-accent); font-size: 11.5px; letter-spacing: 1.3px; }
.pv-is-ms .ms-hello h1 { color: var(--pv-ink); font-size: 30px; }
.pv-is-ms .ms-hello p { color: var(--pv-muted); }
.pv-is-ms .ms-hello p strong { color: var(--pv-ink); }
.pv-is-ms .ms-summary { gap: 10px; }
.pv-is-ms .ms-sum { position: relative; min-width: 110px; padding: 14px 16px 14px 18px; overflow: hidden; border: 1px solid var(--pv-line); border-radius: 16px; background: var(--pv-soft); }
.pv-is-ms .ms-sum::before { content: ''; position: absolute; top: 14px; bottom: 14px; left: 0; width: 3px; border-radius: 0 3px 3px 0; background: #94a3b8; }
.pv-is-ms .ms-sum strong { font-size: 28px; }
.pv-is-ms .ms-sum span { color: var(--pv-muted); font-size: 12.5px; }
.pv-is-ms .ms-sum.is-ok { background: #f0fdf4; border-color: #bbf7d0; }
.pv-is-ms .ms-sum.is-ok::before { background: #16a34a; }
.pv-is-ms .ms-sum.is-ok strong { color: #15803d; }
.pv-is-ms .ms-sum.is-warn { background: #fffbeb; border-color: #fde68a; }
.pv-is-ms .ms-sum.is-warn::before { background: #f59e0b; }
.pv-is-ms .ms-sum.is-warn strong { color: #b45309; }
.pv-is-ms .ms-sum.is-next { min-width: 210px; border-color: transparent; background: linear-gradient(150deg, #1b2a4a, #0f1a30); }
.pv-is-ms .ms-sum.is-next::before { background: var(--pv-accent); }
.pv-is-ms .ms-sum.is-next span { color: #9fb0c8; }
.pv-is-ms .ms-sum.is-next strong { color: #fff; font-size: 17px; }
.pv-is-ms .ms-sum.is-next small { color: #cbd5e1; }

/* Avisos y filtros */
.pv-is-ms .ms-notice { border-radius: 16px; }
.pv-is-ms .ms-filters { gap: 8px; margin-bottom: 16px; }
.pv-is-ms .ms-chip { padding: 8px 14px; border-color: rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .06); color: #e2e8f0; }
.pv-is-ms .ms-chip[aria-pressed="true"] { border-color: #fff; background: #fff; color: var(--pv-ink); box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .6); }

/* Tarjetas de servicio */
.pv-is-ms .ms-grid { gap: 18px; }
.pv-is-ms .ms-card { gap: 16px; padding: 22px 20px 20px; border-radius: 22px; background: #fff; box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .65), 0 0 0 1px rgba(255, 255, 255, .06); }
.pv-is-ms .ms-card::before { height: 5px; background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 55%, #fff)); }
.pv-is-ms .ms-card:hover { transform: translateY(-3px); box-shadow: 0 36px 80px -30px rgba(0, 0, 0, .75), 0 0 0 1px rgba(255, 255, 255, .08); }
.pv-is-ms .ms-logo { width: 48px; height: 48px; border-radius: 14px; box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--c) 75%, transparent); }
.pv-is-ms .ms-title strong { color: var(--pv-ink); font: 700 16.5px/1.25 'Space Grotesk', sans-serif; }
.pv-is-ms .ms-title small { color: var(--pv-muted); }
.pv-is-ms .ms-card-body { gap: 18px; padding: 14px; border: 1px solid var(--pv-line); border-radius: 16px; background: var(--pv-soft); }
.pv-is-ms .ms-ring { width: 84px; height: 84px; }
.pv-is-ms .ms-ring-bg { stroke: color-mix(in srgb, var(--st) 14%, #fff); }
.pv-is-ms .ms-facts { gap: 8px; }
.pv-is-ms .ms-facts dt, .pv-is-ms .ms-more dt { color: #94a3b8; font-size: 10.5px; letter-spacing: .7px; }
.pv-is-ms .ms-facts dd, .pv-is-ms .ms-more dd { color: var(--pv-ink); }
.pv-is-ms .ms-copy { background: #fff; box-shadow: inset 0 0 0 1px var(--pv-line); }

/* Más detalles y comprobante: filas iguales */
.pv-is-ms .ms-more, .pv-is-ms .ms-pay { padding-top: 0; border-top: 0; }
.pv-is-ms .ms-more summary, .pv-is-ms .ms-pay summary { justify-content: flex-start; padding: 11px 14px; border: 1px solid var(--pv-line); border-radius: 12px; background: #fff; color: var(--pv-ink-2); font-size: 13.5px; transition: background .15s, border-color .15s; }
.pv-is-ms .ms-more summary:hover, .pv-is-ms .ms-pay summary:hover { border-color: #cbd5e1; background: var(--pv-soft); color: var(--pv-ink); }
.pv-is-ms .ms-more summary::after { margin-left: auto; }
.pv-is-ms .ms-pay summary::after { content: ''; width: 7px; height: 7px; margin-left: auto; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .2s; }
.pv-is-ms .ms-pay[open] summary::after { transform: rotate(225deg) translateY(-1px); }
.pv-is-ms .ms-pay summary svg { color: #2563eb; }
.pv-is-ms .ms-pay.is-urgent summary { border-color: #fde68a; background: #fffbeb; color: #92400e; }
.pv-is-ms .ms-pay.is-urgent summary svg { color: #d97706; }
.pv-is-ms .ms-more dl { padding: 4px 4px 0; }
.pv-is-ms .ms-receipt { margin-top: 10px; }
.pv-is-ms .ms-file { border-radius: 12px; }
.pv-is-ms .ms-note { height: 44px; border-radius: 11px; }
.pv-is-ms .ms-receipt .ms-btn { min-height: 44px; }

/* Avisos dentro de la tarjeta */
.pv-is-ms .ms-2fa, .pv-is-ms .ms-locked, .pv-is-ms .ms-receipt-state { padding: 10px 12px; border-radius: 12px; font-size: 13px; }
.pv-is-ms .ms-locked { border: 1px solid #fecaca; background: #fef2f2; color: #991b1b; }
.pv-is-ms .ms-2fa { border: 1px solid #bbf7d0; background: #f0fdf4; color: #166534; }

/* Botones */
.pv-is-ms .ms-actions { gap: 10px; padding-top: 4px; }
.pv-is-ms .ms-btn { min-height: 48px; border-radius: 13px; font-size: 14.5px; }
.pv-is-ms .ms-btn-primary { background: linear-gradient(135deg, var(--pv-accent-2), var(--pv-accent)); box-shadow: 0 12px 24px -12px rgba(233, 87, 63, .8); }
.pv-is-ms .ms-btn-ghost { border: 1.5px solid #e2e8f0; background: #fff; color: var(--pv-ink); }
.pv-is-ms .ms-btn-ghost:hover { border-color: #cbd5e1; background: var(--pv-soft); }
.pv-is-ms .ms-btn-wa { background: linear-gradient(135deg, #22c55e, #16a34a); box-shadow: 0 12px 24px -12px rgba(22, 163, 74, .8); }
.pv-is-ms .ms-foot { color: rgba(226, 232, 240, .55); }

@media (max-width: 640px) {
    .pv-is-ms .ms-hello { padding: 22px 18px; border-radius: 20px; }
    .pv-is-ms .ms-hello h1 { font-size: 25px; }
    .pv-is-ms .ms-sum { min-width: 0; }
    .pv-is-ms .ms-card { padding: 20px 16px 16px; }
    .pv-is-ms .ms-card-body { gap: 14px; padding: 12px; }
}

/* ==========================================================================
   Portal v3 · interactivo y accesible (pv-*): saltar al contenido, foco visible, mensajes en vivo,
   recordar correo, aviso de 2 minutos, guía, copiar y abrir, texto más grande y calendario.
   ========================================================================== */
.pv-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.pv-skip { position: fixed; top: -80px; left: 16px; z-index: 100; padding: 12px 16px; border-radius: 12px; background: #fff; color: #0f172a; font-weight: 700; text-decoration: none; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); transition: top .15s; }
.pv-skip:focus { top: 16px; outline: 3px solid #2563eb; outline-offset: 2px; }
#contenido:focus { outline: none; }

/* Foco visible y claro en todo el portal (teclado) */
body.pv2 a:focus-visible, body.pv2 button:focus-visible, body.pv2 summary:focus-visible, body.pv2 input:focus-visible,
body.pv2 .platform-option input:focus-visible + span { outline: 3px solid #2563eb !important; outline-offset: 3px; box-shadow: 0 0 0 6px rgba(37, 99, 235, .18) !important; }
body.pv2 .client-footer a:focus-visible, body.pv2 .pv-textsize:focus-visible, body.pv2 .ms-top a:focus-visible, body.pv2 .ms-logout:focus-visible, body.pv2 .ms-chip:focus-visible { outline-color: #fff !important; }

/* Mensajes en vivo bajo cada campo */
.pv-hint { display: block; min-height: 1.3em; margin-top: 2px; color: #64748b; font-size: 12.5px; line-height: 1.4; }
.pv-hint:empty { min-height: 0; margin: 0; }
.pv-hint.is-ok { color: #0f7a52; }
.pv-hint.is-ok::before { content: '✓ '; font-weight: 700; }
.pv-hint.is-bad { color: #b42318; }
.pv-hint.is-bad::before { content: '! '; font-weight: 800; }

/* Usar mi último correo */
.pv-recall { display: flex; align-items: center; gap: 6px; margin: -6px 0 -4px; }
.pv-recall[hidden] { display: none; }
.pv-recall-use { display: inline-flex; flex: 1; align-items: center; gap: 8px; min-width: 0; min-height: 44px; padding: 0 14px; border: 1.5px dashed #f3b4a6; border-radius: 12px; background: #fff7f4; color: #b8361f; font: 600 13.5px 'DM Sans', sans-serif; text-align: left; cursor: pointer; }
.pv-recall-use b { overflow: hidden; color: #0f172a; text-overflow: ellipsis; white-space: nowrap; }
.pv-recall-use:hover { border-style: solid; }
.pv-recall-x { display: grid; flex: none; place-items: center; width: 44px; height: 44px; border: 1.5px solid #e5e7eb; border-radius: 12px; background: #fff; color: #64748b; font-size: 15px; cursor: pointer; }
.pv-recall-x:hover { color: #0f172a; border-color: #cbd5e1; }

/* Enviando */
body.pv2 .client-card .pv-submit.is-busy { opacity: .8; cursor: progress; }

/* Estados con ícono además del color */
body.pv2 .status-pill .status-dot { display: none; }
body.pv2 .status-pill::before { content: '⏳'; font-size: 12px; letter-spacing: 0; }
body.pv2 .status-pill[data-state="ready"]::before, body.pv2 .status-pill[data-state="totp"]::before { content: '✓'; font-weight: 800; }
body.pv2 .status-pill[data-state="used"]::before { content: '✓'; }
body.pv2 .status-pill[data-state="expired"]::before, body.pv2 .status-pill[data-state="revoked"]::before { content: '✕'; font-weight: 800; }
.ms-page .state-pill.state-activos i, .ms-page .state-pill.state-por_vencer i, .ms-page .state-pill.state-vencidos i, .ms-page .state-pill.state-suspendidos i { display: none; }
.ms-page .state-pill::before { font-size: 11px; font-weight: 800; letter-spacing: 0; }
.ms-page .state-pill.state-activos::before { content: '✓'; }
.ms-page .state-pill.state-por_vencer::before { content: '⚠'; }
.ms-page .state-pill.state-vencidos::before { content: '✕'; }
.ms-page .state-pill.state-suspendidos::before { content: '⏸'; }

/* Aviso: quedan 2 minutos */
.pv-warn { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 10px 0 0 !important; padding: 10px 12px; border: 1px solid #fde68a; border-radius: 12px; background: #fffbeb; color: #92400e !important; font-size: 13.5px !important; font-weight: 600; text-align: center; }
.pv-warn[hidden] { display: none; }
.pv-warn svg { flex: none; }

/* ¿Dónde pido el código? */
.pv-guide { margin: 0 0 14px; border: 1px solid #e5e7eb; border-radius: 14px; background: #fff; text-align: left; }
.pv-guide summary { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 14px; color: #0f172a; font-size: 14px; font-weight: 700; list-style: none; cursor: pointer; }
.pv-guide summary::-webkit-details-marker { display: none; }
.pv-guide summary svg { flex: none; color: #2563eb; }
.pv-guide summary::after { content: ''; width: 7px; height: 7px; margin-left: auto; border-right: 2px solid #94a3b8; border-bottom: 2px solid #94a3b8; transform: rotate(45deg) translateY(-2px); transition: transform .2s; }
.pv-guide[open] summary::after { transform: rotate(225deg); }
.pv-guide dl { display: grid; gap: 10px; margin: 0; padding: 4px 14px 0; }
.pv-guide dl div { display: grid; gap: 2px; }
.pv-guide dt { color: #0f172a; font-size: 13px; font-weight: 700; }
.pv-guide dd { margin: 0; color: #475569; font-size: 13.5px; line-height: 1.5; }
.pv-guide p { margin: 10px 14px 14px !important; color: #64748b !important; font-size: 12.5px !important; }

/* Código listo: aparece con un pequeño salto + Copiar y abrir */
body.pv2 .client-code .pv-arrive { animation: pv-arrive .6s cubic-bezier(.2, .8, .2, 1.2) both; }
@keyframes pv-arrive { 0% { transform: translateY(-10px) scale(.96); opacity: 0; } 100% { transform: none; opacity: 1; } }
body.pv2 .client-code .pv-open { width: 100%; gap: 8px; border: 1.5px solid #a7f3d0; background: #fff; color: #065f46; box-shadow: none; }
body.pv2 .client-code .pv-open:hover { background: #ecfdf5; }
.pv-again { margin-top: 12px; }
.pv-again .btn { width: 100%; gap: 8px; }

/* Pie con "Texto más grande" */
.pv-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px; }
.pv-textsize { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid rgba(226, 232, 240, .25); border-radius: 999px; background: rgba(255, 255, 255, .06); color: #e2e8f0; font: 600 13px 'DM Sans', sans-serif; cursor: pointer; }
.pv-textsize b { font: 700 15px 'Space Grotesk', sans-serif; }
.pv-textsize:hover { background: rgba(255, 255, 255, .12); }
.pv-textsize[aria-pressed="true"] { border-color: #fff; background: #fff; color: #0f172a; }
html.pv-large body.pv2 .pv-shell, html.pv-large body.pv2 .ms-shell { zoom: 1.14; }
@supports not (zoom: 1) { html.pv-large body.pv2 { font-size: 114%; } }

/* Mis servicios: calendario */
.ms-cal { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid #dbeafe; border-radius: 12px; background: #f5f9ff; color: #1d4ed8; font-size: 13.5px; font-weight: 700; text-decoration: none; }
.ms-cal:hover { border-color: #93c5fd; background: #eff6ff; }
.ms-cal svg { flex: none; }

@media (prefers-reduced-motion: reduce) {
    body.pv2 .client-code .pv-arrive { animation: none; }
    .pv-skip, .pv-guide summary::after { transition: none; }
}

/* Portal v3 · campo con error mientras escribe */
body.pv2 .client-card .pv-input input[aria-invalid="true"] { border-color: #dc2626; background: #fffafa; }

/* ==========================================================================
   Portal · párrafos justificados (con guiones en español para que no queden huecos grandes)
   ========================================================================== */
body.pv2 .pv-side-main > p,
body.pv2 .pv-feats small,
body.pv2 .pv-head p,
body.pv2 .client-card > .hint,
body.pv2 #note,
body.pv2 .pv-wait-sub,
body.pv2 #view-ready > .hint,
body.pv2 .pv-guide dd,
body.pv2 .pv-guide p,
body.pv2 .pv-warn,
body.pv2 .client-card .alert,
body.pv2 .client-card .rq-member,
body.pv2 .rq-home-note,
body.pv2 .rq-home-warn,
body.pv2 .ms-entry small,
body.pv2 .ms-help,
body.pv2 .ms-hello p,
body.pv2 .ms-receipt-state,
body.pv2 .ms-locked,
body.pv2 .ms-2fa,
body.pv2 .ms-receipt small,
body.pv2 .ms-none,
body.pv2 .pv-side-note {
    text-align: justify;
    text-align-last: left;
    text-justify: inter-word;
    -webkit-hyphens: auto;
    hyphens: auto;
}
/* Los párrafos que iban centrados siguen viéndose centrados en su última línea. */
body.pv2 .client-card > .hint,
body.pv2 #note,
body.pv2 .pv-wait-sub,
body.pv2 #view-ready > .hint,
body.pv2 .pv-warn,
body.pv2 .rq-home-note,
body.pv2 .rq-home-warn,
body.pv2 .ms-receipt small,
body.pv2 .ms-none { text-align-last: center; }
@media (max-width: 900px) {
    body.pv2.pv-is-form .pv-head p { text-align-last: center; }
}

/* Celulares: los textos cortos en recuadros angostos van alineados a la izquierda (justificados dejaban huecos). */
@media (max-width: 480px) {
    body.pv2 .ms-entry small { text-align: left; }
}

/* ==========================================================================
   Área del cliente (Mis servicios) · formato profesional: barra superior, resumen, pestañas,
   tarjetas con opciones agrupadas, «Boletas y facturas» y visor de documentos.
   ========================================================================== */
.pv-is-ms .ms-shell { width: min(1080px, 100%); }

/* Barra superior */
.pv-is-ms .ms-top { padding: 10px 10px 10px 14px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 18px; background: rgba(255, 255, 255, .04); backdrop-filter: blur(10px); }
.ms-top-right { display: flex; align-items: center; gap: 10px; }
.ms-user { display: inline-flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border-radius: 999px; background: rgba(255, 255, 255, .06); color: #fff; }
.ms-user > i { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--pv-accent-2), var(--pv-accent)); font: 700 14px 'Space Grotesk', sans-serif; font-style: normal; }
.ms-user b { display: block; font-size: 13.5px; line-height: 1.15; }
.ms-user small { display: block; color: #9fb0c8; font-size: 11px; }
.pv-is-ms .ms-logout { min-height: 42px; }

/* Saludo y resumen */
.pv-is-ms .ms-hello { position: relative; overflow: hidden; gap: 22px; }
.pv-is-ms .ms-hello::after { content: ''; position: absolute; top: -80px; right: -60px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(233, 87, 63, .08), transparent 70%); pointer-events: none; }
.ms-hello-text { min-width: 0; flex: 1 1 320px; }
/* Sin justificar: en este texto corto dejaba espacios grandes entre palabras. */
body.pv2.pv-is-ms .ms-hello p, body.pv2.pv-is-ms .ms-receipt-state { text-align: left; text-align-last: auto; }
.pv-is-ms .ms-kicker { color: var(--pv-muted); font-weight: 700; letter-spacing: .4px; text-transform: none; font-size: 12.5px; }
.pv-is-ms .ms-kicker::first-letter { text-transform: uppercase; }
.pv-is-ms .ms-summary { position: relative; z-index: 1; }
.ms-sum-ico { display: grid; place-items: center; width: 28px; height: 28px; margin-bottom: 8px; border-radius: 9px; background: #fff; color: var(--pv-muted); box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }
.pv-is-ms .ms-sum.is-ok .ms-sum-ico { color: #16a34a; }
.pv-is-ms .ms-sum.is-warn .ms-sum-ico { color: #d97706; }
.pv-is-ms .ms-sum.is-docs { border-color: #bfdbfe; background: #eff6ff; color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s, border-color .15s; }
.pv-is-ms .ms-sum.is-docs::before { background: #2563eb; }
.pv-is-ms .ms-sum.is-docs strong { color: #1d4ed8; }
.pv-is-ms .ms-sum.is-docs .ms-sum-ico { color: #2563eb; }
.pv-is-ms .ms-sum.is-docs:hover { border-color: #93c5fd; transform: translateY(-2px); box-shadow: 0 10px 22px -12px rgba(37, 99, 235, .55); }
.pv-is-ms .ms-sum.is-docs:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }

/* Pestañas */
.ms-tabs { display: flex; gap: 6px; margin: 0 0 18px; padding: 6px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 16px; background: rgba(255, 255, 255, .05); backdrop-filter: blur(10px); }
.ms-tabs [role="tab"] { display: inline-flex; flex: 1; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 16px; border: 0; border-radius: 12px; background: transparent; color: #cbd5e1; font: inherit; font-size: 14.5px; font-weight: 700; cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
.ms-tabs [role="tab"]:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.ms-tabs [role="tab"] b { min-width: 24px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .12); font-size: 12px; }
.ms-tabs [role="tab"] em { padding: 2px 8px; border-radius: 999px; background: #22c55e; color: #fff; font-size: 10.5px; font-style: normal; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; }
.ms-tabs [role="tab"][aria-selected="true"] { background: #fff; color: var(--pv-ink); box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .6); }
.ms-tabs [role="tab"][aria-selected="true"] b { background: var(--pv-soft); box-shadow: inset 0 0 0 1px var(--pv-line); }
.ms-tabs [role="tab"]:focus-visible { outline: 3px solid rgba(255, 255, 255, .5); outline-offset: 2px; }
.ms-panel[hidden] { display: none !important; }

/* Encabezado de sección (sobre el fondo oscuro) */
.ms-section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 18px; margin: 4px 2px 16px; }
.ms-section-head h2 { margin: 0; color: #fff; font: 700 21px/1.2 'Space Grotesk', sans-serif; letter-spacing: -.2px; }
.ms-section-head p { margin: 3px 0 0; color: #94a3b8; font-size: 13.5px; }
.pv-is-ms .ms-section-head .ms-filters { margin: 0; }

/* Tarjeta: opciones del servicio en una sola lista */
.pv-is-ms .ms-links { display: grid; overflow: hidden; border: 1px solid var(--pv-line); border-radius: 16px; background: #fff; }
.pv-is-ms .ms-links > * + * { border-top: 1px solid var(--pv-line); }
.pv-is-ms .ms-link,
.pv-is-ms .ms-links .ms-more > summary,
.pv-is-ms .ms-links .ms-pay > summary { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; margin: 0; padding: 10px 14px; border: 0; border-radius: 0; background: #fff; color: var(--pv-ink); font: inherit; text-align: left; text-decoration: none; list-style: none; cursor: pointer; transition: background .15s; }
.pv-is-ms .ms-link:hover,
.pv-is-ms .ms-links .ms-more > summary:hover,
.pv-is-ms .ms-links .ms-pay > summary:hover { border: 0; background: var(--pv-soft); color: var(--pv-ink); }
.pv-is-ms .ms-link:focus-visible,
.pv-is-ms .ms-links summary:focus-visible { outline: none; box-shadow: inset 0 0 0 3px #bfdbfe; }
.ms-link-ico { display: grid; flex: none; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: #f1f5f9; color: var(--pv-ink-2); }
.ms-link-text { display: grid; flex: 1; min-width: 0; gap: 1px; }
.ms-link-text b { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.ms-link-text small { overflow: hidden; color: var(--pv-muted); font-size: 12.5px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.ms-link-go { flex: none; color: #94a3b8; font-size: 22px; line-height: 1; transition: transform .15s, color .15s; }
.ms-link:hover .ms-link-go { transform: translateX(3px); color: var(--pv-ink); }
.ms-link em { flex: none; padding: 2px 8px; border-radius: 999px; background: #22c55e; color: #fff; font-size: 10.5px; font-style: normal; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; }
.pv-is-ms .ms-link.is-docs .ms-link-ico { background: #eff6ff; color: #2563eb; }
.pv-is-ms .ms-link.ms-cal .ms-link-ico { background: #eef2ff; color: #4f46e5; }
.pv-is-ms .ms-links .ms-pay .ms-link-ico { background: #ecfdf5; color: #059669; }
.pv-is-ms .ms-links .ms-pay.is-urgent > summary { background: #fffbeb; }
.pv-is-ms .ms-links .ms-pay.is-urgent .ms-link-ico { background: #fef3c7; color: #b45309; }
.pv-is-ms .ms-links .ms-more > summary::after,
.pv-is-ms .ms-links .ms-pay > summary::after { content: ''; flex: none; width: 7px; height: 7px; margin: 0 6px 0 auto; border-right: 2px solid #94a3b8; border-bottom: 2px solid #94a3b8; transform: rotate(45deg) translateY(-2px); transition: transform .2s; }
.pv-is-ms .ms-links .ms-more[open] > summary::after,
.pv-is-ms .ms-links .ms-pay[open] > summary::after { transform: rotate(225deg) translateY(-1px); }
.pv-is-ms .ms-links .ms-more dl { margin: 0; padding: 4px 16px 16px 62px; }
.pv-is-ms .ms-links .ms-receipt { margin: 0; padding: 4px 14px 14px; }

/* Panel «Boletas y facturas» */
.ms-docs-panel { padding: 24px; border-radius: 24px; background: #fff; box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .06); animation: card-in .35s cubic-bezier(.2, .7, .2, 1) both; }
.ms-docs-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.ms-docs-badge { display: grid; flex: none; place-items: center; width: 50px; height: 50px; border-radius: 15px; background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff; box-shadow: 0 12px 24px -12px rgba(29, 78, 216, .8); }
.ms-docs-head h2 { margin: 0; color: var(--pv-ink); font: 700 22px/1.2 'Space Grotesk', sans-serif; }
.ms-docs-head p { margin: 3px 0 0; color: var(--pv-muted); font-size: 13.5px; line-height: 1.45; }

.ms-docs-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.ms-docs-search { position: relative; display: flex; flex: 1 1 260px; align-items: center; }
.ms-docs-search svg { position: absolute; left: 13px; color: #94a3b8; pointer-events: none; }
.ms-docs-search input { width: 100%; height: 44px; padding: 0 14px 0 38px; border: 1px solid #dbe1ea; border-radius: 12px; background: var(--pv-soft); color: var(--pv-ink); font: inherit; font-size: 14px; transition: border-color .15s, box-shadow .15s, background .15s; }
.ms-docs-search input:focus { outline: none; border-color: #3b82f6; background: #fff; box-shadow: 0 0 0 4px rgba(59, 130, 246, .15); }
.ms-docs-seg { display: inline-flex; gap: 3px; padding: 4px; border-radius: 12px; background: #f1f5f9; }
.ms-docs-seg button { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--pv-muted); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: background .15s, color .15s; }
.ms-docs-seg button b { font-size: 11.5px; opacity: .75; }
.ms-docs-seg button[aria-pressed="true"] { background: #fff; color: var(--pv-ink); box-shadow: 0 1px 2px rgba(15, 23, 42, .1), 0 4px 10px -6px rgba(15, 23, 42, .25); }
.ms-docs-seg button:focus-visible { outline: 3px solid #bfdbfe; outline-offset: 1px; }
.ms-docs-select { height: 44px; padding: 0 36px 0 12px; border: 1px solid #dbe1ea; border-radius: 12px; background: #fff; color: var(--pv-ink); font: inherit; font-size: 13.5px; font-weight: 600; }
.ms-docs-select:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 4px rgba(59, 130, 246, .15); }

.ms-docs-table { overflow: hidden; border: 1px solid var(--pv-line); border-radius: 16px; }
.ms-docs-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.1fr) 110px 110px 230px; align-items: center; gap: 14px; padding: 12px 16px; border-top: 1px solid #eef1f5; transition: background .12s; }
.ms-docs-row[hidden] { display: none; }
.ms-docs-row.is-head { padding-top: 10px; padding-bottom: 10px; border-top: 0; background: var(--pv-soft); color: #94a3b8; font-size: 11px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; }
.ms-docs-row:not(.is-head):hover { background: #fafcff; }
.ms-docs-row .is-num { text-align: right; }
.ms-docs-doc { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ms-docs-doc > span { display: grid; min-width: 0; }
.ms-docs-doc b { overflow: hidden; color: var(--pv-ink); font-size: 14.5px; text-overflow: ellipsis; white-space: nowrap; }
.ms-docs-doc small { overflow: hidden; color: var(--pv-muted); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.ms-doc-num { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 13.5px; letter-spacing: .2px; }
.ms-new { margin-left: 4px; padding: 2px 7px; border-radius: 999px; background: #dcfce7; color: #15803d; font-size: 10.5px; font-style: normal; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; vertical-align: 2px; }
.ms-doc-ico { display: grid; flex: none; place-items: center; width: 40px; height: 46px; border-radius: 8px 14px 8px 8px; background: #eff6ff; color: #1d4ed8; font-size: 10.5px; font-style: normal; font-weight: 800; letter-spacing: .5px; box-shadow: inset 0 0 0 1px rgba(29, 78, 216, .15); }
.ms-doc-ico.is-factura { background: #f5f3ff; color: #6d28d9; box-shadow: inset 0 0 0 1px rgba(109, 40, 217, .15); }
.ms-doc-ico.is-big { width: 74px; height: 86px; border-radius: 12px 24px 12px 12px; font-size: 16px; }
.ms-docs-svc { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; color: var(--pv-ink-2); font-size: 13.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.ms-docs-svc i { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--c, #94a3b8); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, #94a3b8) 18%, transparent); }
.ms-docs-date { color: var(--pv-ink-2); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.ms-docs-amount { color: var(--pv-ink); font: 700 15px 'Space Grotesk', sans-serif; font-variant-numeric: tabular-nums; }
.ms-docs-actions { display: flex; justify-content: flex-end; gap: 8px; }
.ms-doc-btn { display: inline-flex; flex: none; align-items: center; justify-content: center; gap: 6px; min-width: 40px; height: 40px; padding: 0 12px; border: 1px solid #dbe1ea; border-radius: 11px; background: #fff; color: var(--pv-ink-2); font: inherit; font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, color .15s, transform .15s; }
.ms-doc-btn:hover { border-color: #cbd5e1; background: var(--pv-soft); color: var(--pv-ink); }
.ms-doc-btn:focus-visible { outline: 3px solid #bfdbfe; outline-offset: 1px; }
.ms-doc-btn:disabled { opacity: .4; cursor: default; }
.ms-doc-btn.is-main { border-color: #2563eb; background: #2563eb; color: #fff; }
.ms-doc-btn.is-main:hover { border-color: #1d4ed8; background: #1d4ed8; color: #fff; }
.ms-docs-none { margin: 14px 0 0; padding: 22px; border: 1px dashed #dbe1ea; border-radius: 14px; color: var(--pv-muted); text-align: center; }
.ms-docs-none[hidden] { display: none; }
.ms-docs-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 14px; color: var(--pv-muted); font-size: 12.5px; }
.ms-docs-foot span { display: inline-flex; align-items: center; gap: 6px; }
.ms-docs-foot a { color: #2563eb; font-weight: 700; text-decoration: none; }
.ms-docs-foot a:hover { text-decoration: underline; }

/* Visor de documentos */
html.ms-lock { overflow: hidden; }
.ms-viewer { width: min(920px, calc(100vw - 32px)); max-width: none; height: min(860px, calc(100vh - 32px)); max-height: none; padding: 0; border: 0; border-radius: 22px; background: #fff; color: var(--pv-ink); box-shadow: 0 40px 100px -20px rgba(0, 0, 0, .7); }
.ms-viewer::backdrop { background: rgba(8, 13, 26, .72); backdrop-filter: blur(4px); }
.ms-viewer[open] { animation: card-in .25s cubic-bezier(.2, .7, .2, 1) both; }
.ms-viewer-box { display: flex; flex-direction: column; height: 100%; }
.ms-viewer-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--pv-line); }
.ms-viewer-ico { display: grid; flex: none; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #eff6ff; color: #2563eb; }
.ms-viewer-title { flex: 1; min-width: 0; }
.ms-viewer-title h3 { margin: 0; overflow: hidden; font: 700 17px/1.25 'Space Grotesk', sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.ms-viewer-title p { margin: 2px 0 0; overflow: hidden; color: var(--pv-muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.ms-viewer-x { display: grid; flex: none; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--pv-line); border-radius: 12px; background: #fff; color: var(--pv-ink-2); cursor: pointer; }
.ms-viewer-x:hover { background: var(--pv-soft); color: var(--pv-ink); }
.ms-viewer-x:focus-visible { outline: 3px solid #bfdbfe; }
.ms-viewer-stage { position: relative; display: flex; flex: 1; min-height: 0; align-items: center; justify-content: center; overflow: auto; padding: 18px; background: repeating-conic-gradient(#f1f5f9 0 25%, #f8fafc 0 50%) 0 0 / 22px 22px; }
/* La imagen entra completa en pantalla; un toque la muestra en tamaño real (y otro la vuelve a ajustar). */
.ms-viewer-stage img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; background: #fff; box-shadow: 0 12px 40px -12px rgba(15, 23, 42, .35); cursor: zoom-in; }
.ms-viewer-stage.is-zoom { align-items: flex-start; justify-content: flex-start; }
.ms-viewer-stage.is-zoom img { max-width: none; max-height: none; margin: auto; cursor: zoom-out; }
.ms-viewer-stage iframe { width: 100%; height: 100%; min-height: 420px; border: 0; border-radius: 8px; background: #fff; box-shadow: 0 12px 40px -12px rgba(15, 23, 42, .35); }
.ms-viewer-stage [hidden] { display: none !important; }
.ms-viewer-loading, .ms-viewer-fallback, .ms-viewer-error { display: grid; justify-items: center; gap: 10px; max-width: 340px; padding: 26px; border-radius: 18px; background: #fff; color: var(--pv-muted); text-align: center; box-shadow: 0 12px 40px -16px rgba(15, 23, 42, .3); }
.ms-viewer-loading i { width: 34px; height: 34px; border: 3px solid #dbeafe; border-top-color: #2563eb; border-radius: 50%; animation: ms-spin .8s linear infinite; }
@keyframes ms-spin { to { transform: rotate(360deg); } }
.ms-viewer-fallback strong, .ms-viewer-error strong { color: var(--pv-ink); font-size: 16px; }
.ms-viewer-fallback p, .ms-viewer-error p { margin: 0; font-size: 13.5px; line-height: 1.5; }
.ms-viewer-error strong { color: #b91c1c; }
.ms-viewer-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--pv-line); }
.ms-viewer-nav { display: inline-flex; align-items: center; gap: 8px; color: var(--pv-muted); font-size: 13px; font-weight: 700; }
.ms-viewer-nav[hidden] { display: none; }
.ms-viewer-nav .ms-doc-btn { padding: 0; }
.ms-viewer-actions { display: flex; gap: 10px; margin-left: auto; }
.ms-viewer-actions .ms-btn { flex: 0 0 auto; min-height: 44px; padding: 0 18px; }
.pv-is-ms .ms-viewer-actions .ms-btn-primary { background: linear-gradient(135deg, #3b82f6, #1d4ed8); box-shadow: 0 12px 24px -12px rgba(29, 78, 216, .8); }

/* Tableta y celular */
@media (max-width: 900px) {
    .ms-docs-row { grid-template-columns: minmax(0, 1fr) 110px 200px; }
    .ms-docs-row .ms-docs-svc, .ms-docs-row .ms-docs-date { display: none; }
    .ms-docs-row.is-head span:nth-child(2), .ms-docs-row.is-head span:nth-child(3) { display: none; }
}
@media (max-width: 640px) {
    .ms-user span { display: none; }
    .ms-user { padding: 3px; }
    .pv-is-ms .ms-logout span { display: none; }
    .pv-is-ms .ms-logout { width: 42px; padding: 0; justify-content: center; }
    .ms-tabs [role="tab"] { gap: 6px; min-height: 46px; padding: 0 8px; font-size: 13px; }
    .ms-tabs [role="tab"] svg, .ms-tabs [role="tab"] em { display: none; }
    .ms-tabs [role="tab"] b { min-width: 20px; padding: 1px 6px; font-size: 11px; }
    .ms-section-head h2 { font-size: 19px; }
    .pv-is-ms .ms-sum.is-docs { flex: 1; }
    .ms-docs-panel { padding: 18px 14px; border-radius: 20px; }
    .ms-docs-head { align-items: flex-start; }
    .ms-docs-badge { width: 44px; height: 44px; border-radius: 13px; }
    .ms-docs-head h2 { font-size: 19px; }
    .ms-docs-tools > * { flex: 1 1 100%; }
    .ms-docs-seg button { flex: 1; justify-content: center; }
    .ms-docs-table { border: 0; border-radius: 0; overflow: visible; display: grid; gap: 10px; }
    .ms-docs-row.is-head { display: none; }
    .ms-docs-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "doc amount" "svc svc" "act act"; gap: 8px 10px; padding: 14px; border: 1px solid var(--pv-line); border-radius: 16px; }
    .ms-docs-row .ms-docs-doc { grid-area: doc; align-items: flex-start; }
    .ms-docs-row .ms-docs-doc small { white-space: normal; }
    .ms-docs-row .ms-docs-amount { grid-area: amount; align-self: start; }
    .ms-docs-row .ms-docs-svc { display: flex; grid-area: svc; font-size: 12.5px; }
    .ms-docs-row .ms-docs-svc::after { content: ' · ' attr(data-date); }
    .ms-docs-row .ms-docs-actions { grid-area: act; }
    .ms-docs-row .ms-docs-actions .ms-doc-btn { flex: 1; height: 44px; }
    .ms-viewer { width: 100vw; height: 100dvh; max-height: none; border-radius: 0; }
    .ms-viewer-head, .ms-viewer-foot { padding: 12px 14px; }
    .ms-viewer-stage { padding: 12px; }
    .ms-viewer-foot { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
    .ms-viewer-actions { flex: 1 1 100%; }
    .ms-viewer-actions .ms-btn { flex: 1; }
    .ms-viewer-nav { flex: 1 1 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
    .ms-docs-panel, .ms-viewer[open] { animation: none; }
    .ms-viewer-loading i { animation-duration: 2s; }
}

/* ==========================================================================
   Área del cliente · aviso corto, botón Ayuda y pestaña «Ayuda» (sobre el fondo oscuro)
   ========================================================================== */
.ms-help-btn { min-height: 42px; }
.ms-tab-short { display: none; }

/* Aviso corto dentro de la tarjeta de saludo: solo cuando hay algo que hacer */
.ms-alertbar { --t: #b45309; --tb: #fffbeb; --tl: #fde68a; display: flex; flex: 1 1 100%; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; border: 1px solid var(--tl); border-radius: 16px; background: var(--tb); }
.ms-alertbar.is-bad { --t: #b91c1c; --tb: #fef2f2; --tl: #fecaca; }
.ms-alertbar-ico { display: grid; flex: none; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: #fff; color: var(--t); box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }
.ms-alertbar-text { flex: 1 1 260px; min-width: 0; }
.ms-alertbar-text strong { display: block; color: var(--t); font-size: 14.5px; }
.ms-alertbar-text span { display: block; color: var(--pv-ink-2); font-size: 13.5px; line-height: 1.45; }
.ms-alertbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ms-alertbar-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 16px; border: 1px solid #e2e8f0; border-radius: 11px; background: #fff; color: var(--pv-ink); font: inherit; font-size: 13.5px; font-weight: 700; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s; }
.ms-alertbar-btn:hover { border-color: #cbd5e1; background: var(--pv-soft); }
.ms-alertbar-btn.is-main { border-color: transparent; background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; }
.ms-alertbar-btn.is-main:hover { background: linear-gradient(135deg, #16a34a, #15803d); }
.ms-alertbar-btn:focus-visible { outline: 3px solid #bfdbfe; outline-offset: 2px; }

/* Pestaña «Ayuda» */
.ms-helpdesk { display: grid; gap: 16px; }
.ms-helpdesk-head h2 { margin: 0; color: #fff; font: 700 21px/1.2 'Space Grotesk', sans-serif; }
.ms-helpdesk-head p { margin: 3px 0 0; color: #94a3b8; font-size: 13.5px; }
.ms-guides { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.ms-guide, .ms-faq { padding: 22px; border-radius: 22px; background: #fff; box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .65), 0 0 0 1px rgba(255, 255, 255, .06); }
.ms-guide-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.ms-guide h3, .ms-faq h3 { margin: 0; color: var(--pv-ink); font: 700 17px/1.25 'Space Grotesk', sans-serif; }
.ms-guide-ico { display: grid; flex: none; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: #fff; }
.ms-guide-ico.is-code { background: linear-gradient(135deg, var(--pv-accent-2), var(--pv-accent)); }
.ms-guide-ico.is-renew { background: linear-gradient(135deg, #22c55e, #16a34a); }
.ms-steps { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.ms-steps li { position: relative; display: grid; gap: 2px; padding-left: 42px; counter-increment: step; }
.ms-steps li::before { content: counter(step); position: absolute; top: 0; left: 0; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--pv-accent-soft); color: var(--pv-accent); font: 700 13px 'Space Grotesk', sans-serif; }
.ms-steps li:not(:last-child)::after { content: ''; position: absolute; top: 32px; bottom: -12px; left: 13px; width: 2px; background: #eef1f5; }
.ms-steps b { color: var(--pv-ink); font-size: 14.5px; }
.ms-steps span { color: var(--pv-muted); font-size: 13.5px; line-height: 1.5; }
.ms-faq h3 { margin-bottom: 6px; }
.ms-faq-item { border-top: 1px solid #eef1f5; }
.ms-faq-item:first-of-type { border-top: 0; }
.ms-faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 2px; color: var(--pv-ink); font-size: 14.5px; font-weight: 700; list-style: none; cursor: pointer; }
.ms-faq-item summary::-webkit-details-marker { display: none; }
.ms-faq-item summary::after { content: ''; flex: none; width: 8px; height: 8px; margin-right: 6px; border-right: 2px solid #94a3b8; border-bottom: 2px solid #94a3b8; transform: rotate(45deg) translateY(-2px); transition: transform .2s; }
.ms-faq-item[open] summary::after { transform: rotate(225deg) translateY(-1px); }
.ms-faq-item summary:hover { color: var(--pv-accent); }
.ms-faq-item summary:focus-visible { outline: 3px solid #bfdbfe; outline-offset: 2px; border-radius: 8px; }
.ms-faq-item p { margin: -4px 30px 14px 2px; color: var(--pv-muted); font-size: 14px; line-height: 1.6; }
.ms-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; padding: 18px 20px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 20px; background: rgba(255, 255, 255, .05); }
.ms-contact-ico { display: grid; flex: none; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: #16a34a; color: #fff; }
.ms-contact > div { flex: 1 1 240px; min-width: 0; }
.ms-contact strong { display: block; color: #fff; font: 700 16px 'Space Grotesk', sans-serif; }
.ms-contact p { margin: 2px 0 0; color: #94a3b8; font-size: 13.5px; }
.pv-is-ms .ms-contact .ms-btn { flex: 0 0 auto; padding: 0 18px; }
body.pv2.pv-is-ms .ms-locked, body.pv2.pv-is-ms .ms-2fa { text-align: left; text-align-last: auto; }

@media (max-width: 640px) {
    .ms-help-btn span { display: none; }
    .ms-help-btn { width: 42px; padding: 0; justify-content: center; }
    .ms-tab-full { display: none; }
    .ms-tab-short { display: inline; }
    .pv-is-ms .ms-top .brand { font-size: 16px; }
    .pv-is-ms .ms-top { padding-left: 10px; }
    .ms-alertbar { align-items: flex-start; }
    .ms-alertbar-text { flex: 1 1 0; }
    .ms-alertbar-actions { flex: 1 1 100%; }
    .ms-alertbar-btn { flex: 1; }
    .ms-guide, .ms-faq { padding: 18px; border-radius: 20px; }
    .ms-faq-item p { margin-right: 4px; }
    .pv-is-ms .ms-contact .ms-btn { flex: 1 1 100%; }
}
