/* Modal compartilhado — visualização de certificado (CertRenderer) */

.fl-cert-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: fl-cert-fade-in 0.2s ease;
}

@keyframes fl-cert-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fl-cert-modal {
    width: min(920px, 100%);
    max-height: min(94vh, 900px);
    display: flex;
    flex-direction: column;
    background: #13161c;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
    overflow: hidden;
}

.fl-cert-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.fl-cert-modal-head h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #f1f5f9;
}

.fl-cert-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.fl-cert-close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.fl-cert-status {
    margin: 0;
    padding: 10px 18px 0;
    font-size: 0.84rem;
    color: #94a3b8;
    flex-shrink: 0;
}

.fl-cert-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 18px 0;
    flex-shrink: 0;
}

.fl-cert-preview {
    flex: 1 1 auto;
    min-height: 200px;
    margin: 12px 18px 18px;
    border-radius: 10px;
    overflow: auto;
    background: #e5e7eb;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fl-cert-preview-img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

.fl-cert-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
    text-align: center;
}

.fl-cert-spinner {
    width: 44px;
    height: 44px;
    color: #8b5cf6;
    animation: fl-cert-spin 1s linear infinite;
}

@keyframes fl-cert-spin {
    to { transform: rotate(360deg); }
}

.fl-cert-loader-text {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
}

@media print {
    body > *:not(.fl-cert-overlay) {
        display: none !important;
    }
    .fl-cert-overlay {
        position: static;
        background: #fff;
        padding: 0;
    }
    .fl-cert-modal-head,
    .fl-cert-status,
    .fl-cert-actions,
    .fl-cert-close {
        display: none !important;
    }
    .fl-cert-preview {
        margin: 0;
        border: none;
        background: #fff;
    }
}
