/* ============================================================
   Certificado de Evento — Frontend CSS
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Montserrat:wght@300;400;600;700&display=swap');

#cert-widget *,
#cert-widget *::before,
#cert-widget *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

#cert-widget {
    font-family: 'Montserrat', sans-serif;
    max-width: 600px;
    margin: 40px auto;
    padding: 0 16px;
}

/* ── Card ─────────────────────────────────────────────────── */

.cert-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 48px 40px;
    text-align: center;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.cert-icon {
    font-size: 40px;
    margin-bottom: 16px;
}

.cert-logo {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 13px;
    letter-spacing: 4px;
    color: #00b49c;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.cert-card h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.cert-sub {
    font-size: 14px;
    color: #666;
    margin-bottom: 32px;
    font-weight: 300;
    line-height: 1.6;
}

.cert-divider {
    width: 48px;
    height: 3px;
    background: #00b49c;
    margin: 0 auto 28px;
    border-radius: 2px;
}

/* ── Input ────────────────────────────────────────────────── */

.cert-input-group {
    display: flex;
    gap: 10px;
    max-width: 420px;
    margin: 0 auto 24px;
}

#cert-cpf-input {
    flex: 1;
    padding: 14px 18px;
    font-size: 16px;
    font-family: 'Montserrat', sans-serif;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    outline: none;
    letter-spacing: 1px;
    transition: border-color 0.2s;
    color: #1a1a2e;
}

#cert-cpf-input:focus {
    border-color: #00b49c;
}

/* ── Botões ───────────────────────────────────────────────── */

.cert-btn {
    padding: 14px 22px;
    background: #00b49c;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
}

.cert-btn:hover:not(:disabled) {
    background: #009e89;
    transform: translateY(-1px);
}

.cert-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cert-download-btn {
    display: inline-block;
    margin-top: 20px;
    padding: 14px 36px;
    background: #1a1a2e;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: background 0.2s, transform 0.1s;
}

.cert-download-btn:hover {
    background: #00b49c;
    transform: translateY(-1px);
}

/* ── Mensagens ────────────────────────────────────────────── */

.cert-msg {
    font-size: 14px;
    padding: 12px 20px;
    border-radius: 8px;
    margin: 0 auto 16px;
    max-width: 420px;
    display: none;
    line-height: 1.5;
}

.cert-msg.cert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    display: block;
}

.cert-msg.cert-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
    display: block;
}

.cert-msg.cert-info {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    display: block;
}

/* ── Preview do Certificado ───────────────────────────────── */

.cert-preview {
    margin-top: 24px;
}

.cert-preview canvas {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

/* ── Loading spinner ──────────────────────────────────────── */

.cert-loading {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cert-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

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

/* ── Responsivo ───────────────────────────────────────────── */

@media (max-width: 480px) {
    .cert-card {
        padding: 32px 20px;
    }

    .cert-input-group {
        flex-direction: column;
    }

    .cert-btn {
        width: 100%;
    }
}
