/* Signax 2027 — estilos propios sobre Bootstrap 5.3 */
:root {
    --sx-morado: #430c74;
    --sx-azul-osc: #1e3a8a;
    --sx-azul: #3b82f6;
    --sx-fondo: #f5f6fa;
    --bs-primary: #4f46e5;
    --bs-primary-rgb: 79, 70, 229;
    --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body { background: var(--sx-fondo); }

.btn-primary {
    --bs-btn-bg: #4f46e5; --bs-btn-border-color: #4f46e5;
    --bs-btn-hover-bg: #4338ca; --bs-btn-hover-border-color: #4338ca;
    --bs-btn-active-bg: #3730a3; --bs-btn-active-border-color: #3730a3;
}

/* Marca */
.sx-marca { font-weight: 800; font-size: 3rem; letter-spacing: -0.03em; color: var(--sx-azul-osc); text-align: center; text-decoration: none; line-height: 1; }
.sx-marca span { color: var(--sx-azul); }
.sx-marca--peq { font-size: 1.6rem; text-align: left; }

/* Login */
.sx-auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.sx-auth__caja { width: 100%; max-width: 380px; }

/* Panel */
.sx-barra { background: #fff; border-bottom: 1px solid #e5e7eb; }
.sx-barra .nav-link { color: #4b5563; }
.sx-barra .nav-link.active { color: var(--sx-morado); font-weight: 600; }

/* Listados */
.sx-tabla thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: #6b7280; font-weight: 600; background: #fafafa; }
.sx-badge { background: #eef2ff; color: #3730a3; font-weight: 500; }
.sx-vacio { background: #fff; border: 1px dashed #d1d5db; border-radius: .5rem; padding: 2.5rem; text-align: center; color: #6b7280; }

/* Editor de plantillas */
.sx-pestanas .nav-link { color: #4b5563; }
.sx-panel-editor { background: #fff; border: 1px solid #dee2e6; border-top: 0; border-radius: 0 0 .5rem .5rem; }
.sx-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; padding: .4rem .5rem; border-bottom: 1px solid #eef0f3; background: #fafbfc; }
.sx-toolbar button { border: 1px solid transparent; background: transparent; border-radius: .3rem; padding: .15rem .5rem; font-size: .85rem; color: #374151; }
.sx-toolbar button:hover { background: #eef2ff; border-color: #c7d2fe; }
.sx-toolbar .form-select { width: auto; font-size: .85rem; }
.sx-tb-sep { width: 1px; height: 1.2rem; background: #e5e7eb; margin: 0 .25rem; }
.sx-documento { min-height: 60vh; max-height: 75vh; overflow: auto; padding: 2rem 2.5rem; outline: none; font-family: "DejaVu Sans", Arial, sans-serif; font-size: 11pt; line-height: 1.55; }
.sx-documento:focus { box-shadow: inset 0 0 0 2px #c7d2fe; }
.sx-documento h1, .sx-documento h2, .sx-documento h3 { color: #0d2a6b; }
.sx-documento img { max-width: 100%; height: auto; }
.sx-previa { width: 100%; height: 75vh; border: 0; background: #fff; display: block; }
.sx-panel-editor[data-sx-panel="previa"] { padding: .75rem; background: #e9ebf0; }
.sx-campo { border-bottom: 1px solid #f1f2f4; padding: .5rem 0; }
.sx-campo:last-child { border-bottom: 0; }
.sx-versiones li { padding: .25rem 0; border-bottom: 1px solid #f1f2f4; }

/* Firmante (/f/…, /q/…) */
.sx-firmante { background: #f4f6fb; }
.sx-firmante__cabecera { background: #fff; border-top: 4px solid var(--sx-morado); border-bottom: 1px solid #e5e7eb; padding: .75rem 0; }
.sx-firmante__caja { max-width: 760px; margin: 0 auto; padding-left: 1rem; padding-right: 1rem; }
.sx-tarjeta { background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; padding: 1.5rem; box-shadow: 0 8px 24px rgba(15, 23, 42, .05); }
@media (min-width: 576px) { .sx-tarjeta { padding: 2rem; } }
.sx-pasos { display: flex; gap: .5rem; list-style: none; padding: 0; margin: 0 0 1.25rem; font-size: .8rem; color: #9ca3af; counter-reset: paso; }
.sx-pasos li { counter-increment: paso; display: flex; align-items: center; gap: .35rem; }
.sx-pasos li::before { content: counter(paso); display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: #eef0f4; font-weight: 600; }
.sx-pasos li + li::after { order: -1; content: ""; width: 1.25rem; height: 1px; background: #d1d5db; }
.sx-pasos li.activo { color: #1f2937; font-weight: 600; }
.sx-pasos li.activo::before { background: #4f46e5; color: #fff; }
.sx-pasos li.hecho::before { content: "✓"; background: #dcfce7; color: #15803d; }
.sx-seccion { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; font-weight: 600; margin-bottom: .5rem; }
.sx-codigo { font-size: 1.6rem; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.sx-doc-firma { max-height: 55vh; overflow: auto; border: 1px solid #e5e7eb; border-radius: 8px; padding: 1.25rem 1.5rem; font-family: "DejaVu Sans", Arial, sans-serif; font-size: .95rem; line-height: 1.6; background: #fff; }
.sx-doc-firma img { max-width: 100%; height: auto; }
.sx-doc-firma table { max-width: 100%; }
.sx-doc-firma h1, .sx-doc-firma h2, .sx-doc-firma h3 { color: #0d2a6b; }
.sx-hueco-firma { display: inline-block; min-width: 220px; padding: 1.2rem 1rem; border: 1px dashed #a5b4fc; border-radius: 6px; color: #6366f1; background: #eef2ff; font-size: .85rem; text-align: center; }
.sx-resumen { background: #f9fafb; border-radius: 8px; padding: .6rem .9rem; }
.sx-check { padding-top: .35rem; padding-bottom: .35rem; }
.sx-pad { position: relative; height: 200px; border: 2px dashed #c7d2fe; border-radius: 10px; background: #fff; touch-action: none; }
.sx-pad canvas { width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: none; }
.sx-pad__guia { position: absolute; left: 1rem; bottom: 2.2rem; right: 1rem; border-bottom: 1px solid #e0e7ff; color: #a5b4fc; font-size: .8rem; pointer-events: none; }
.sx-pad--firmado .sx-pad__guia { color: transparent; }
.sx-ok { width: 3.5rem; height: 3.5rem; border-radius: 50%; display: grid; place-items: center; background: #dcfce7; color: #15803d; font-size: 1.8rem; }

/* Panel: firmas */
.sx-estado { font-weight: 500; }
.sx-estado--firmada { background: #dcfce7; color: #166534; }
.sx-estado--pendiente { background: #fef9c3; color: #854d0e; }
.sx-estado--caducada, .sx-estado--cancelada { background: #f3f4f6; color: #4b5563; }
.sx-eventos { font-size: .85rem; }
.sx-eventos td { padding: .3rem .5rem; }
/* Fecha de nacimiento en tres desplegables: sin el icono de error, que no cabe */
[data-sx-nacimiento] .form-select.is-invalid { --bs-form-select-bg-icon: none; padding-right: 2.25rem; }

/* Tablet de recepción: letra y botones algo mayores */
.sx-firmante--tablet { font-size: 1.08rem; }
.sx-firmante--tablet .form-control, .sx-firmante--tablet .form-select { min-height: 2.9rem; }
.sx-firmante--tablet .sx-pad { height: 260px; }

/* Decisiones de consentimiento agrupadas (Sí / No por tema) */
.sx-decision { padding: .6rem 0; }
.sx-decision--par { border: 1px solid #e5e7eb; border-radius: 10px; padding: .75rem 1rem; margin-bottom: .6rem; background: #fcfcfd; }
.sx-firmante-extra { border-left: 3px solid #c7d2fe; padding-left: .6rem; margin-bottom: .75rem; }
.sx-firmante__logo { max-height: 48px; max-width: 220px; display: block; margin-bottom: .2rem; }
