/*
 * cert-login-modal.css
 *
 * Estilo do modal de login com certificado digital (Approach 3).
 * Vanilla, sem dependencia de jQuery UI ou framework de modal.
 * Encoding: ISO-8859-1 + CRLF. Strings sem acentos.
 */

/* Backdrop ocupa viewport, semi-transparent */
.cert-modal-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    display: none;
    z-index: 9000;
    align-items: center;
    justify-content: center;
    animation: cert-fade-in 150ms ease-out;
}
.cert-modal-backdrop[data-open="true"] {
    display: flex;
}

/* Container do modal */
.cert-modal {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 420px;
    width: 90%;
    padding: 28px 24px;
    text-align: center;
    position: relative;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.cert-modal-close {
    position: absolute;
    top: 10px; right: 14px;
    background: none;
    border: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}
.cert-modal-close:hover { color: #333; }

.cert-modal-icon {
    display: block;
    margin: 8px auto 14px;
    font-size: 48px;
    line-height: 1;
    text-align: center;
}

.cert-modal-label {
    font-size: 16px;
    color: #222;
    margin-bottom: 6px;
    font-weight: 500;
}

.cert-modal-sublabel {
    font-size: 13px;
    color: #777;
    line-height: 1.45;
    min-height: 18px;
}

.cert-modal-buttons {
    display: none;
    gap: 10px;
    justify-content: center;
    margin-top: 18px;
}
.cert-modal[data-state="error"] .cert-modal-buttons { display: flex; }

.cert-modal-btn {
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 13px;
    color: #333;
}
.cert-modal-btn:hover { background: #eaeaea; }
.cert-modal-btn.primary {
    background: #0056b3;
    color: #fff;
    border-color: #0056b3;
}
.cert-modal-btn.primary:hover { background: #003d80; }

/* Spinner CSS -- visivel em A, B, C */
.cert-spinner {
    border: 4px solid #e0e0e0;
    border-top-color: #0056b3;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: cert-spin 1s linear infinite;
    margin: 8px auto 14px;
    display: block;
}
@keyframes cert-spin { to { transform: rotate(360deg); } }

/* Hide icon while spinner is visible (states A/B/C) */
.cert-modal[data-state="A"] .cert-modal-icon,
.cert-modal[data-state="B"] .cert-modal-icon,
.cert-modal[data-state="C"] .cert-modal-icon { display: none; }

/* Hide spinner in success/error */
.cert-modal[data-state="success"] .cert-spinner,
.cert-modal[data-state="error"] .cert-spinner { display: none; }

/* Icon coloring per state (FA glyphs) */
.cert-modal[data-state="success"] .cert-modal-icon { color: #28a745; }
.cert-modal[data-state="error"]   .cert-modal-icon { color: #dc3545; }

@keyframes cert-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
