/* =============================================================
   Jeturing Sign — Portal CSS
   Paleta: Azul oscuro #1F3864 | Verde #16A34A | Gris claro #F8FAFC
   ============================================================= */

/* ---------- Reset / Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #F8FAFC;
    color: #1E293B;
}

a { color: #1F3864; }
a:hover { color: #16A34A; }

/* ---------- Page shell ---------- */
.jsign-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ---------- Header ---------- */
.jsign-header {
    background: #1F3864;
    color: #fff;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.jsign-header__logo {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -.02em;
}

.jsign-header__sub {
    font-size: .75rem;
    opacity: .8;
}

/* ---------- Footer ---------- */
.jsign-footer {
    background: #1E293B;
    color: #94A3B8;
    text-align: center;
    padding: 16px;
    font-size: .75rem;
    margin-top: auto;
}

.jsign-footer a { color: #94A3B8; }
.jsign-footer a:hover { color: #fff; }

/* ---------- Hero ---------- */
.jsign-hero__title {
    font-size: 2rem;
    font-weight: 800;
    color: #1F3864;
    line-height: 1.2;
}

.jsign-hero__sub {
    color: #475569;
    margin-top: 8px;
}

@media (max-width: 576px) {
    .jsign-hero__title { font-size: 1.4rem; }
}

/* ---------- Cards ---------- */
.jsign-card {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 28px 28px 24px;
    box-shadow: 0 4px 16px rgba(0,0,0,.06);
}

.jsign-card__title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1F3864;
    margin-bottom: 20px;
}

/* ---------- Form sections ---------- */
.jsign-form-section { border-top: 1px solid #E2E8F0; padding-top: 16px; }

.jsign-form-section__label {
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #64748B;
    margin-bottom: 12px;
}

/* ---------- Tabs de firma ---------- */
.jsign-tabs {
    display: flex;
    border-bottom: 2px solid #E2E8F0;
    gap: 4px;
}

.jsign-tab {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 8px 18px;
    font-size: .9rem;
    color: #64748B;
    cursor: pointer;
    transition: color .15s, border-color .15s;
}

.jsign-tab:hover { color: #1F3864; }

.jsign-tab--active {
    color: #1F3864;
    border-bottom-color: #1F3864;
    font-weight: 600;
}

/* ---------- Canvas de firma ---------- */
.jsign-canvas-wrapper {
    position: relative;
    background: #F8FAFC;
    border: 2px dashed #CBD5E1;
    border-radius: 8px;
    overflow: hidden;
}

#jsign-canvas {
    display: block;
    width: 100%;
    height: 180px;
    cursor: crosshair;
    touch-action: none;
}

/* ---------- Tipo (preview texto) ---------- */
.jsign-type-preview {
    min-height: 80px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Dancing Script', cursive;
    font-size: 2.2rem;
    color: #1E293B;
    padding: 8px 16px;
}

/* ---------- Upload preview ---------- */
.jsign-upload-preview {
    max-height: 120px;
    max-width: 100%;
    object-fit: contain;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 4px;
    background: #fff;
}

/* ---------- OTP Box ---------- */
.jsign-otp-box {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: 10px;
    padding: 20px;
}

.jsign-otp-box h5 {
    font-size: 1rem;
    font-weight: 700;
    color: #1F3864;
    margin-bottom: 6px;
}

/* ---------- Botones de accion ---------- */
.jsign-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.jsign-actions .btn-secondary {
    background: #1F3864;
    border-color: #1F3864;
    padding: 12px 32px;
}

.jsign-actions .btn-secondary:hover {
    background: #16305A;
    border-color: #16305A;
}

/* ---------- Visor del PDF ---------- */
.jsign-pdf-viewer {
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.jsign-pdf-frame {
    width: 100%;
    height: 500px;
    border: none;
    display: block;
}

.jsign-pdf-download {
    padding: 8px 12px;
    background: #F8FAFC;
    border-top: 1px solid #E2E8F0;
    text-align: right;
}

@media (max-width: 768px) {
    .jsign-pdf-frame { height: 320px; }
}

/* ---------- Informacion del documento ---------- */
.jsign-doc-info {
    background: #fff;
    border-left: 4px solid #1F3864;
    border-radius: 0 8px 8px 0;
    padding: 16px 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,.05);
}

.jsign-doc-info__title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1F3864;
    margin-bottom: 4px;
}

.jsign-doc-info__meta { color: #64748B; font-size: .9rem; }

.jsign-doc-info__message {
    margin-top: 8px;
    color: #475569;
    font-style: italic;
    font-size: .9rem;
}

/* ---------- Pantalla de exito ---------- */
.jsign-success { text-align: center; padding: 24px 0; }

.jsign-success__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: #16A34A;
    color: #fff;
    border-radius: 50%;
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(22,163,74,.35);
}

.jsign-success__title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #16A34A;
}

.jsign-success__sub {
    color: #475569;
    margin-top: 8px;
}

/* ---------- Cuota bar ---------- */
.jsign-quota-bar {
    background: #F1F5F9;
    border-radius: 8px;
    padding: 12px 16px;
    display: inline-block;
    min-width: 220px;
}

/* ---------- Features bloqueadas ---------- */
.jsign-upsell-features { padding: 4px 0; }

.jsign-locked-feature {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
    font-size: .9rem;
    color: #475569;
}

.jsign-locked-feature:hover {
    background: #EFF6FF;
    border-color: #BFDBFE;
    color: #1F3864;
}

.jsign-locked-feature__lock { font-size: 1rem; flex-shrink: 0; }

/* ---------- Sajet CTA block ---------- */
.jsign-sajet-cta {
    background: linear-gradient(135deg, #1F3864 0%, #16305A 100%);
    color: #fff;
    border-radius: 12px;
    padding: 24px 28px;
    text-align: center;
}

.jsign-sajet-cta p { color: rgba(255,255,255,.85); }
.jsign-sajet-cta strong { color: #fff; }

.jsign-sajet-cta .btn-primary {
    background: #16A34A;
    border-color: #16A34A;
}

.jsign-sajet-cta .btn-primary:hover {
    background: #15803D;
    border-color: #15803D;
}

/* ---------- Error box ---------- */
.jsign-error-box {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 48px 32px;
    max-width: 480px;
    margin: 0 auto;
    text-align: center;
}

/* ---------- Upload form ---------- */
.jsign-upload-form .form-control:focus,
.jsign-upload-form .form-check-input:focus {
    border-color: #1F3864;
    box-shadow: 0 0 0 3px rgba(31,56,100,.15);
}

.jsign-upload-form .btn-primary {
    background: #1F3864;
    border-color: #1F3864;
    font-weight: 600;
}

.jsign-upload-form .btn-primary:hover {
    background: #16305A;
    border-color: #16305A;
}

/* ---------- Responsive utilities ---------- */
@media (max-width: 576px) {
    .jsign-card { padding: 20px 16px; }
    .jsign-actions { flex-direction: column; align-items: stretch; }
    .jsign-actions .btn { width: 100%; }
    .jsign-header { flex-direction: column; align-items: flex-start; gap: 2px; }
}
