/**
 * Altis Crédito Plugin - Extended Styles
 * Additional UI styles for error modal, loading overlays, and feedback
 */

/* ============================================
   STEP LABELS - BACKGROUND PARA NÃO SOBREPOR LINHA
   ============================================ */
.altis-step small {
    background: var(--altis-bg, #fff);
    padding: 2px 6px;
    position: relative;
    z-index: 2;
}

/* ============================================
   ERROR MODAL - STYLES CLEANED
   ============================================ */

/* WhatsApp Button in Error Modal */
.altis-btn-whatsapp,
#altis-btn-whatsapp-error {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: #25D366 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 12px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
    text-decoration: none;
}

.altis-btn-whatsapp:hover,
#altis-btn-whatsapp-error:hover {
    background: #1da851 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4) !important;
}

.altis-btn-whatsapp svg,
#altis-btn-whatsapp-error svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-bottom: -4px;
    margin-right: 5px;
}

/* ============================================
   LOADING OVERLAYS - FULLSCREEN
   ============================================ */
#altis-finalization-loader,
#altis-simulation-loader,
.altis-loading-overlay,
#altis-loading {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(255, 255, 255, 0.98) !important;
    display: none !important;
    /* Hidden by default */
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 99998 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Helper class to show flex */
.altis-loading-overlay.active,
#altis-loading.active,
#altis-finalization-loader.active {
    display: flex !important;
}

/* Text inside loader */
#altis-finalization-loader p,
#altis-simulation-loader p,
.altis-loading-overlay p,
#altis-loading p {
    margin-top: 20px !important;
    color: #374151 !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    text-align: center !important;
}

/* ============================================
   ERROR MODAL
   ============================================ */
.altis-error-message {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    background: #ffffff !important;
    border-radius: 16px !important;
    padding: 32px !important;
    max-width: 420px !important;
    width: 90% !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 100vmax rgba(0, 0, 0, 0.5) !important;
    z-index: 10000 !important;
    display: none !important;
    /* Hidden by default */
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    font-family: inherit !important;
    margin: 0 !important;
}

/* Helper class to show error */
.altis-error-message.active {
    display: flex !important;
    animation: altisFadeInUp 0.3s ease-out forwards !important;
}

@keyframes altisFadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Close button style */
.altis-error-message .altis-btn-close {
    position: absolute !important;
    top: 16px !important;
    right: 16px !important;
    background: transparent !important;
    border: none !important;
    font-size: 20px !important;
    cursor: pointer !important;
    color: #9ca3af !important;
    padding: 8px !important;
    line-height: 1 !important;
    border-radius: 50% !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
}

.altis-error-message .altis-btn-close:hover {
    color: #374151 !important;
    background-color: #f3f4f6 !important;
}

/* Error Text */
.altis-error-message #altis-error-text {
    font-size: 16px !important;
    line-height: 1.6 !important;
    color: #000000 !important;
    /* Pure Black as requested */
    margin: 10px 0 24px 0 !important;
    background: transparent !important;
}

/* Error Actions */
.altis-error-actions {
    width: 100%;
    display: flex;
    justify-content: center;
}

/* ============================================
   PROPOSAL UPDATE FEEDBACK TOAST
   ============================================ */
.altis-updating-proposal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(19, 81, 236, 0.95);
    color: #fff;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 99997;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.altis-updating-proposal .mini-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: altis-spin 0.6s linear infinite;
}

/* ============================================
   DISABLED BUTTON STATE
   ============================================ */
.altis-btn:disabled,
.altis-btn.disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* ============================================
   SUCCESS/DENIED SCREENS - CENTRALIZADO
   ============================================ */
#altis-success-screen,
#altis-denied-screen {
    background: #fff !important;
    padding: 40px !important;
    border-radius: 16px !important;
    max-width: 500px !important;
    text-align: center !important;
    z-index: 99999 !important;
}