/* rtl: * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
} */

body {
    background-color: #f5f5f5;
    color: #333;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.steps-container {
    display: flex;
    justify-content: space-between;
    padding: 20px;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    cursor: pointer;
    transition: all 0.3s ease;
}

.step:hover .step-number {
    transform: scale(1.05);
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 10px;
    color: white;
    transition: all 0.3s ease;
}

.step-inactive .step-number {
    background-color: #ccc;
}

.step-active .step-number {
    background-color: #fbaf3d;
}

.step-completed .step-number {
    background-color: #fbaf3d;
}

.step-title {
    font-size: 14px;
    text-align: center;
}

.progress-bar {
    position: absolute;
    top: 40px;
    left: 0;
    right: 0;
    height: 4px;
    background-color: #eee;
    z-index: 1;
}

.progress-completed {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 0%;
    background-color: #fbaf3d;
    transition: width 0.5s ease;
}

.instruction {
    text-align: center;
    padding: 15px;
    background-color: #f9f9f9;
}

.action-button-container {
    text-align: center;
    padding: 15px;
    background-color: #f9f9f9;
    z-index: 10;
    position: relative;
}

.action-button {
    background-color: #fbaf3d;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
}

.action-button:hover {
    background-color: #e99c2a;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.action-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.pdf-viewer {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #e6e6e6;
    overflow: hidden;
    position: relative;
    width: 100%;
    height: 100%;
}

.pdf-toolbar {
    display: flex;
    align-items: center;
    padding: 8px;
    background-color: #f0f0f0;
    border-bottom: 1px solid #ddd;
    width: 100%;
    z-index: 5;
}

.pdf-toolbar button, 
.pdf-toolbar select {
    background-color: transparent;
    border: none;
    padding: 5px 10px;
    margin: 0 2px;
    cursor: pointer;
    border-radius: 3px;
}

.pdf-toolbar button:hover {
    background-color: #e0e0e0;
}

.pdf-toolbar .spacer {
    flex: 1;
}

.pdf-content {
    position: absolute;
    top: 0px;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: auto;
    background-color: #e6e6e6;
}

.pdf-embed {
    display: block;
    width: 100%;
    height: 100%;
    border: none;
}

.step-view {
    display: none;
    width: 100%;
    height: 100%;
    position: relative;
}

.step-view.active {
    display: flex;
    flex-direction: column;
}

.signature-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: white;
    
}

.signature-pad {
    border: 2px solid #ccc;
    border-radius: 8px;
    width: 100%;
    max-width: 600px;
    height: 200px;
    margin: 20px auto;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    touch-action: none;
}

.signature-pad canvas {
    width: 100% !important;
    height: 100% !important;
    border-radius: 6px;
    touch-action: none;
    cursor: crosshair;
}

.signature-actions {
    display: flex;
    gap: 1rem;
    margin-top: 20px;
}

.signed-document-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
}

.signature-stamp {
    position: absolute;
    top: 10px;
    right: 20px;
    background-color: rgba(251, 175, 61, 0.1);
    border: 2px solid #fbaf3d;
    padding: 10px 20px;
    border-radius: 8px;
    color: #fbaf3d;
    font-weight: bold;
    font-size: 14px;
    text-align: center;
}

.signature-date {
    font-size: 12px;
    margin-top: 5px;
    color: #666;
}

@media (max-width: 768px) {
    .step-title {
        font-size: 12px;
    }
    
    .signature-pad {
        height: 150px;
    }
}

.success-message {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background-color: #fbaf3d;
    color: white;
    text-align: center;
    padding: 10px;
    font-weight: bold;
    z-index: 100;
}

.step-views {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}



.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #fbaf3d;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-container p {
    font-size: 16px;
    color: #666;
}

#pdf-viewer {
    display: none; /* Ocultar el PDF hasta que esté listo */
}





/* Estilos personalizados para el área de firma */
.signature-pad {
    border: 2px solid #ccc;
    border-radius: 8px;
    width: 100%;
    max-width: 600px;
    height: 200px;
    margin: 20px auto;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    touch-action: none;
}

/* Estilos para el botón de limpiar firma */
.black-new-design, .white-new-design {
    background-color: #000;
    color: #fff;
    border: 2px solid #000;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 150px;
    height: 45px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.black-new-design:hover {
    background-color: #fff;
    color: #000;
    border-color: #000;
}

.white-new-design {
    background-color: #fff;
    color: #000;
}

.white-new-design:hover {
    background-color: #000;
    color: #fff;
}

#clear-signature {
    margin: 0px;
    cursor: pointer;
}




.steps-container {
    display: flex;
    flex-direction: row-reverse; /* Invierte el orden de los pasos */    
}


.step-view-2 {
    height: 100vh; /* Altura completa de la ventana */
    overflow-y: auto; /* Habilitar scroll vertical */
    scroll-behavior: smooth; /* Scroll suave */
}

.container {
    height: 100%; /* Asegurar que el contenedor ocupe toda la altura */
}

.data-container, .signature-container {
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    margin-bottom: 20px;
}

.signature-pad {
    border: 2px solid #ccc;
    border-radius: 8px;
    width: 100%;
    max-width: 600px;
    height: 200px;
    margin: 20px auto;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    touch-action: none;
}



#globalToast.toast {
    z-index: 9999;
  }
.btn-secondary {
    background-color: #6c757d;
    color: white;
    border: none;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.gap-3 {
    gap: 1rem;
}

.welcome-message {
    padding: 30px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.welcome-title {
    font-size: 32px;
    margin-bottom: 20px;
}

.welcome-decoration {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.decoration-line {
    color: #666;
    margin: 0 10px;
}

.decoration-text {
    color: #333;
    font-size: 18px;
}

.welcome-content {
    font-size: 16px;
    line-height: 1.6;
}

.welcome-content p {
    margin-bottom: 10px;
}

.welcome-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.welcome-header {
    margin-bottom: 2rem;
}

.logo-container {
    margin-bottom: 1.5rem;
}

.welcome-logo {
    max-width: 150px;
    height: auto;
}

.welcome-title {
    color: #ff9933;
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
}

.welcome-decoration {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem 0;
    gap: 1rem;
}

.decoration-line {
    height: 2px;
    flex: 1;
    background: linear-gradient(to right, transparent, #ff9933, transparent);
    max-width: 100px;
}

.decoration-text {
    font-size: 1.2rem;
    color: #666;
    padding: 0 1rem;
}

.message-box {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
}

.success-message {
    color: #28a745;
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.success-message i {
    font-size: 1.5rem;
}

.content-text {
    text-align: right;
    direction: rtl;
    line-height: 1.6;
}

.highlight {
    color: #ff9933;
    font-weight: 500;
}

.contact-info {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.support-email {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #0099cc;
    text-decoration: none;
    margin: 1rem 0;
    padding: 0.5rem 1rem;
    background: rgba(0,153,204,0.1);
    border-radius: 50px;
    transition: all 0.3s ease;
}

.support-email:hover {
    background: rgba(0,153,204,0.2);
    text-decoration: none;
}

.signature {
    margin-top: 2rem;
    text-align: right;
}

.signature span {
    display: block;
    margin-bottom: 0.5rem;
}

.welcome-action-button {
    background-color: #ff9933;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 2rem;
}

.welcome-action-button:hover {
    background-color: #ff8800;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255,153,51,0.3);
}

.button-text {
    font-weight: 500;
}
   

/* Overlay para loading global */
#global-loading-overlay {
    display: none; /* Se muestra con JS */
    position: fixed;
    z-index: 9999;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(2px);
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s;
}

/* Spinner central */
.global-loading-spinner {
    width: 64px;
    height: 64px;
    border: 8px solid #e0e0e0;
    border-top: 8px solid #009688;
    border-radius: 50%;
    animation: global-spin 1s linear infinite;
    box-shadow: 0 0 16px #00968844;
}

@keyframes global-spin {
    0% { transform: rotate(0deg);}
    100% { transform: rotate(360deg);}
}



/* Toast container */
#custom-toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

/* Toast base */
.custom-toast {
    min-width: 260px;
    max-width: 350px;
    background: #fff;
    color: #222;
    border-radius: 8px;
    box-shadow: 0 4px 24px 0 rgba(0,0,0,0.13), 0 1.5px 4px 0 rgba(0,0,0,0.10);
    padding: 1rem 1.5rem 1rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    border-left: 6px solid #007bff;
    opacity: 0;
    transform: translateY(-30px) scale(0.98);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: auto;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

/* Animación de entrada/salida */
.custom-toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.custom-toast.hide {
    opacity: 0;
    transform: translateY(-30px) scale(0.98);
    transition: opacity 0.3s, transform 0.3s;
}

/* Tipos de toast */
.custom-toast.success { border-left-color: #28a745; }
.custom-toast.error   { border-left-color: #dc3545; }
.custom-toast.warning { border-left-color: #ffc107; }
.custom-toast.info    { border-left-color: #17a2b8; }

/* Título */
.custom-toast .toast-title {
    font-weight: bold;
    margin-bottom: 0.25em;
    font-size: 1.08em;
}

/* Botón de cierre */
.custom-toast .close-toast-btn {
    position: absolute;
    top: 0.5em;
    right: 0.7em;
    background: transparent;
    border: none;
    color: #888;
    font-size: 1.3em;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    z-index: 2;
    transition: color 0.2s;
    pointer-events: auto;
}
.custom-toast .close-toast-btn:hover {
    color: #222;
}

/* Mensaje */
.custom-toast > div:not(.toast-title) {
    margin-bottom: 0.2em;
    word-break: break-word;
}

/* Responsive */
@media (max-width: 600px) {
    #custom-toast-container {
        top: 0.5rem;
        right: 0.5rem;
        left: 0.5rem;
        align-items: flex-end;
    }
    .custom-toast {
        min-width: 180px;
        max-width: 98vw;
        font-size: 0.98em;
        padding: 0.8rem 1rem 0.8rem 0.8rem;
    }
}