
/* ==========================================================
   SISTEMA DE TASA DE RESOLUCIÓN
   Formulario OTP - WordPress
   ========================================================== */

/* ----------------------------------------------------------
   1. CONTENEDOR PRINCIPAL
   ---------------------------------------------------------- */

.cj-tr-otp {
    box-sizing: border-box;
    width: 100%;
    max-width: 690px;
    margin: 10px auto;
    padding: 30px;
    border: 1px solid #e2e7ed;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 5px 20px rgba(20, 40, 75, .04);
    color: #08285d;
    font-family: Arial, Helvetica, sans-serif;
}

.cj-tr-otp *,
.cj-tr-otp *::before,
.cj-tr-otp *::after {
    box-sizing: border-box;
}

.cj-tr-otp [hidden] {
    display: none !important;
}

.cj-tr-otp-stage + .cj-tr-otp-stage {
    margin-top: 22px;
    padding-top: 24px;
    border-top: 1px solid #e7ebf0;
}

/* ----------------------------------------------------------
   2. TÍTULOS Y TEXTOS
   ---------------------------------------------------------- */

.cj-tr-otp h2 {
    margin: 0 0 8px;
    color: #08285d;
    font-size: 20px;
    line-height: 1.3;
    font-weight: 800;
}

.cj-tr-otp-stage > p:not([role]) {
    margin: 0 0 19px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.55;
}

.cj-tr-otp form {
    margin: 0;
}

.cj-tr-otp fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.cj-tr-otp label {
    display: block;
    margin: 0 0 6px;
    color: #273956;
    font-size: 12px;
    font-weight: 700;
}

/* ----------------------------------------------------------
   3. CAMPOS DE ENTRADA
   ---------------------------------------------------------- */

.cj-tr-otp-field {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    height: 41px;
    margin: 0 0 16px;
    padding: 0 14px;
    border: 1px solid #d9e0e8;
    border-radius: 8px;
    background: #fff;
    transition:
        border-color .2s ease,
        background-color .2s ease,
        box-shadow .2s ease;
}

.cj-tr-otp-field:focus-within {
    border-color: #123da5;
    box-shadow: 0 0 0 3px rgba(18, 61, 165, .13);
}


/* ----------------------------------------------------------
   TELÉFONO DE CONTACTO - FORMULARIO DE AYUDA
   ---------------------------------------------------------- */

.cj-tr-otp .cj-tr-otp-help input[name="telefono"] {
    display: block;
    width: 100%;
    min-width: 0;
    height: 44px;
    margin: 0 0 14px;
    padding: 0 12px;
    border: 1px solid #d9e0e8;
    border-radius: 8px;
    outline: 0;
    background: #fff;
    color: #152b4c;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.5;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.cj-tr-otp .cj-tr-otp-help input[name="telefono"]::placeholder {
    color: #8492a8;
    opacity: 1;
}

.cj-tr-otp .cj-tr-otp-help input[name="telefono"]:focus {
    border-color: #123da5;
    box-shadow: 0 0 0 3px rgba(18, 61, 165, .13);
}

.cj-tr-otp .cj-tr-otp-help input[name="telefono"][aria-invalid="true"] {
    border-color: #a32727;
    background: #fff4f4;
}

.cj-tr-otp .cj-tr-otp-help input[name="telefono"]:read-only,
.cj-tr-otp .cj-tr-otp-help input[name="telefono"]:disabled {
    border-color: #cbd5e1;
    background: #f1f5f9;
    color: #64748b;
    cursor: default;
}

.cj-tr-otp-field > span {
    flex: none;
    width: 14px;
    color: #9da9bc;
    font-size: 14px;
    text-align: center;
}

.cj-tr-otp input {
    flex: 1;
    width: 100%;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #152b4c;
    font: inherit;
    font-size: 13px;
}

.cj-tr-otp input::placeholder {
    color: #8492a8;
    opacity: 1;
}

/* ----------------------------------------------------------
   4. CAMPOS READONLY
   Cédula y correo después de enviar OTP
   ---------------------------------------------------------- */

.cj-tr-otp .cj-tr-otp-field:has(input:read-only) {
    background: #f1f5f9;
    border-color: #cbd5e1;
    box-shadow: none;
    cursor: default;
}

.cj-tr-otp .cj-tr-otp-field input:read-only {
    color: #64748b;
    background: transparent;
    cursor: default;
    opacity: 1;
    -webkit-text-fill-color: #64748b;
}

.cj-tr-otp .cj-tr-otp-field:has(input:read-only) > span {
    color: #94a3b8;
}

/* Indicador visual de bloqueo */
.cj-tr-otp .cj-tr-otp-field:has(input:read-only)::after {
    content: "🔒";
    flex: none;
    margin-left: auto;
    font-size: 13px;
    opacity: .75;
}

/* Sin resaltado de edición */
.cj-tr-otp .cj-tr-otp-field:has(input:read-only):focus-within {
    border-color: #cbd5e1;
    box-shadow: none;
}

/* ----------------------------------------------------------
   5. CAMPOS DESHABILITADOS
   OTP antes de solicitar código
   ---------------------------------------------------------- */

.cj-tr-otp .cj-tr-otp-field:has(input:disabled) {
    background: #f8fafc;
    border-color: #e2e8f0;
    opacity: .65;
    cursor: not-allowed;
}

.cj-tr-otp .cj-tr-otp-field input:disabled {
    color: #94a3b8;
    cursor: not-allowed;
}

.cj-tr-otp .cj-tr-otp-field:has(input:disabled)::after {
    content: none;
}

.cj-tr-otp-confirm-stage fieldset:disabled .cj-tr-otp-access {
    opacity: .55;
}

/* ----------------------------------------------------------
   6. GOOGLE reCAPTCHA
   ---------------------------------------------------------- */

.cj-tr-recaptcha {
    min-height: 78px;
    margin: 2px 0 16px;
    overflow: hidden;
}

.cj-tr-recaptcha > div {
    transform-origin: left top;
}

.cj-tr-recaptcha-missing {
    margin: 2px 0 16px;
    padding: 10px 12px;
    border: 1px solid #efb4b4;
    border-radius: 8px;
    background: #fff4f4;
    color: #a32727;
    font-size: 12px;
    line-height: 1.45;
}

/* ----------------------------------------------------------
   7. BOTONES GENERALES
   ---------------------------------------------------------- */

.cj-tr-otp button {
    width: 100%;
    min-height: 46px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition:
        background-color .2s ease,
        opacity .2s ease;
}

.cj-tr-otp button span {
    margin-right: 8px;
    font-size: 16px;
    vertical-align: -1px;
}

.cj-tr-otp button:focus-visible {
    outline: 3px solid #93b0f2;
    outline-offset: 3px;
}

.cj-tr-otp button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

/* Enviar OTP */
.cj-tr-otp-send {
    margin-top: 2px;
    background: #1d7d35;
}

.cj-tr-otp-send:hover:not(:disabled) {
    background: #17642a;
}

/* Acceder al certificado */
.cj-tr-otp-access {
    margin-top: 2px;
    background: #123da5;
}

.cj-tr-otp-access:hover:not(:disabled) {
    background: #0b2f85;
}

/* ----------------------------------------------------------
   8. REENVIAR CÓDIGO OTP
   ---------------------------------------------------------- */

.cj-tr-otp .cj-tr-otp-resend {
    display: block;
    width: auto;
    min-height: 0;
    margin: 12px auto 0;
    padding: 4px 8px;
    background: transparent;
    color: #2457da;
    font-size: 12px;
    font-weight: 600;
}

.cj-tr-otp .cj-tr-otp-resend:hover:not(:disabled) {
    color: #123da5;
    text-decoration: underline;
}

.cj-tr-otp .cj-tr-otp-resend:disabled {
    color: #677a9f;
    opacity: 1;
}

/* ----------------------------------------------------------
   9. MENSAJES OTP
   ---------------------------------------------------------- */

.cj-tr-otp-request-status,
.cj-tr-otp-confirm-status {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
}

.cj-tr-otp-request-status:not(:empty),
.cj-tr-otp-confirm-status:not(:empty) {
    margin-top: 10px;
}

.cj-tr-otp [data-state="error"] {
    color: #a32727;
}

.cj-tr-otp [data-state="success"] {
    color: #187338;
}

.cj-tr-otp [data-state="loading"] {
    color: #385783;
}

.cj-tr-otp [data-state="info"] {
    color: #1e4c87;
}

/* ----------------------------------------------------------
   10. BOTÓN SOLICITAR AYUDA
   ---------------------------------------------------------- */

.cj-tr-otp .cj-tr-otp-help-toggle {
    display: block;
    width: auto;
    min-height: 0;
    margin: 14px auto 0;
    padding: 6px 10px;
    background: transparent;
    color: #2457da;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cj-tr-otp .cj-tr-otp-help-toggle:hover:not(:disabled) {
    color: #123da5;
}

.cj-tr-otp .cj-tr-otp-help-back {
    display: block;
    width: auto;
    min-height: 0;
    margin: 16px auto 0;
    padding: 6px 10px;
    background: transparent;
    color: #2457da;
    font-size: 12px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cj-tr-otp .cj-tr-otp-help-back:hover {
    color: #123da5;
}

/* ----------------------------------------------------------
   11. FORMULARIO DE AYUDA
   ---------------------------------------------------------- */

.cj-tr-otp .cj-tr-otp-help {
    margin-top: 16px;
    padding: 18px;
    border: 1px solid #dbe5f0;
    border-radius: 10px;
    background: #f8fafc;
}

.cj-tr-otp .cj-tr-otp-help textarea {
    display: block;
    width: 100%;
    min-height: 95px;
    padding: 12px;
    border: 1px solid #d9e0e8;
    border-radius: 8px;
    outline: 0;
    background: #fff;
    color: #152b4c;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}

.cj-tr-otp .cj-tr-otp-help textarea:focus {
    border-color: #123da5;
    box-shadow: 0 0 0 3px rgba(18, 61, 165, .13);
}

.cj-tr-otp .cj-tr-otp-help textarea:read-only {
    border-color: #cbd5e1;
    background: #f1f5f9;
    color: #64748b;
    cursor: default;
}

/* Advertencia sobre información sensible */
.cj-tr-otp .cj-tr-otp-help > p {
    margin: 10px 0 14px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
}

/* Botón registrar ayuda */
.cj-tr-otp .cj-tr-otp-help button[type="submit"] {
    background: #123da5;
}

.cj-tr-otp .cj-tr-otp-help button[type="submit"]:hover:not(:disabled) {
    background: #0b2f85;
}

/* ----------------------------------------------------------
   12. MENSAJES DE SOLICITUD DE AYUDA
   ---------------------------------------------------------- */

.cj-tr-otp .cj-tr-otp-help-status {
    margin: 0;
    font-size: 12px;
    line-height: 1.6;
}

.cj-tr-otp .cj-tr-otp-help-status:not(:empty) {
    margin-top: 14px;
}

/* Solicitud pendiente */
.cj-tr-otp .cj-tr-otp-help-status[data-state="info"] {
    padding: 12px 14px;
    border: 1px solid #b8d4f5;
    border-radius: 8px;
    background: #eff6ff;
    color: #1e4c87;
}

/* Solicitud registrada */
.cj-tr-otp .cj-tr-otp-help-status[data-state="success"] {
    padding: 12px 14px;
    border: 1px solid #b9e2c4;
    border-radius: 8px;
    background: #f0fdf4;
    color: #187338;
}

/* Error al registrar */
.cj-tr-otp .cj-tr-otp-help-status[data-state="error"] {
    padding: 12px 14px;
    border: 1px solid #efb4b4;
    border-radius: 8px;
    background: #fff4f4;
    color: #a32727;
}

/* Procesando solicitud */
.cj-tr-otp .cj-tr-otp-help-status[data-state="loading"] {
    padding: 12px 14px;
    border: 1px solid #dbe5f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #385783;
}

/* ----------------------------------------------------------
   13. ELEMENTOS OCULTOS POR JAVASCRIPT
   ---------------------------------------------------------- */

.cj-tr-otp [hidden] {
    display: none !important;
}

/* ----------------------------------------------------------
   14. CERTIFICADO GENERADO
   ---------------------------------------------------------- */

.cj-tr-otp.cj-tr-otp-complete {
    max-width: 650px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.cj-tr-otp-complete .cj-tr-pdf-result {
    margin: 0 auto;
}





/* ----------------------------------------------------------
   15. RESPONSIVE - TABLET
   ---------------------------------------------------------- */

@media (max-width: 768px) {
    .cj-tr-otp {
        padding: 24px;
    }

    .cj-tr-otp h2 {
        font-size: 19px;
    }
}

/* ----------------------------------------------------------
   16. RESPONSIVE - MÓVIL
   ---------------------------------------------------------- */

@media (max-width: 520px) {
    .cj-tr-otp {
        padding: 20px;
    }

    .cj-tr-otp h2 {
        font-size: 18px;
    }

    .cj-tr-otp button {
        font-size: 12px;
    }

    .cj-tr-otp-field {
        gap: 10px;
        padding: 0 12px;
    }

    .cj-tr-otp input {
        font-size: 16px;
    }

    .cj-tr-otp .cj-tr-otp-field input:read-only {
        font-size: 14px;
    }

    .cj-tr-recaptcha {
        max-width: 100%;
        overflow-x: auto;
    }

    .cj-tr-otp .cj-tr-otp-help {
        padding: 14px;
    }

    .cj-tr-otp .cj-tr-otp-help textarea,
    .cj-tr-otp .cj-tr-otp-help input[name="telefono"] {
        font-size: 16px;
    }

    .cj-tr-otp .cj-tr-otp-help-status[data-state] {
        padding: 10px 12px;
    }

    
}

/* ----------------------------------------------------------
   17. ACCESIBILIDAD - MOVIMIENTO REDUCIDO
   ---------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .cj-tr-otp button,
    .cj-tr-otp-field,
    .cj-tr-otp .cj-tr-otp-help textarea {
        transition: none;
    }
}
