/**
 * Ponttonline - Loading Screen & Modal Styles
 */

:root {
    --pt-loading-bg: rgba(7, 27, 49, 0.78);
    --pt-loading-card-bg: linear-gradient(165deg, rgba(13, 37, 68, 0.98) 0%, rgba(7, 25, 47, 0.99) 100%);
    --pt-loading-border: rgba(255, 255, 255, 0.12);
    --pt-loading-glow: rgba(13, 110, 253, 0.35);
}

/* ==========================================================================
   Overlay em Tela Cheia (Backdrop com Blur)
   ========================================================================== */
.pt-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10050;
    background: var(--pt-loading-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.pt-loading-overlay.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

body.pt-loading-locked {
    overflow: hidden !important;
}

/* ==========================================================================
   Card Modal Central
   ========================================================================== */
.pt-loading-modal {
    position: relative;
    width: 100%;
    max-width: 520px;
    background: var(--pt-loading-card-bg);
    border: 1px solid var(--pt-loading-border);
    border-radius: 26px;
    padding: 2.5rem 2.25rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45),
        0 0 45px var(--pt-loading-glow);
    text-align: center;
    color: #ffffff;
    overflow: hidden;
    transform: scale(0.92) translateY(12px);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.pt-loading-overlay.is-active .pt-loading-modal {
    transform: scale(1) translateY(0);
}

/* Efeito de detalhe de luz no fundo do card*/
.pt-loading-modal::before {
    content: "";
    position: absolute;
    top: -80px;
    right: -80px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(13, 110, 253, 0.28) 0%, transparent 70%);
    pointer-events: none;
}

.pt-loading-modal::after {
    content: "";
    position: absolute;
    bottom: -70px;
    left: -70px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(22, 163, 74, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.pt-loading-header {
    display: flex;
    justify-content: center;
    margin-bottom: 1.75rem;
}

.pt-loading-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 0.82rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 600;
    color: #e2e8f0;
}

.pt-loading-badge i {
    color: #60a5fa;
}

/* ==========================================================================
   Spinner & Animação Central
   ========================================================================== */
.pt-spinner-wrapper {
    position: relative;
    width: 96px;
    height: 96px;
    margin: 0 auto 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pt-spinner-pulse {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(13, 110, 253, 0.3) 0%, transparent 70%);
    animation: ptPulse 2s infinite ease-in-out;
}

.pt-spinner-ring {
    width: 82px;
    height: 82px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.08);
    border-top-color: #0d6efd;
    border-right-color: #16a34a;
    animation: ptSpin 1s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
    box-shadow: 0 0 20px rgba(13, 110, 253, 0.4);
}

.pt-spinner-icon {
    position: absolute;
    font-size: 1.85rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
    animation: ptIconBreath 2s infinite ease-in-out;
}

/* ==========================================================================
   Tipografia e Mensagens Dinâmicas
   ========================================================================== */
.pt-loading-step-tag {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #60a5fa;
    margin-bottom: 0.4rem;
}

.pt-loading-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.65rem;
    line-height: 1.3;
}

.pt-loading-message {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 1.75rem;
    line-height: 1.5;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.pt-loading-progress-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
    margin-bottom: 1.5rem;
}

.pt-loading-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 45%;
    border-radius: 999px;
    background: linear-gradient(90deg, #0d6efd 0%, #20c997 50%, #16a34a 100%);
    animation: ptShimmer 1.8s infinite ease-in-out;
    box-shadow: 0 0 12px rgba(13, 110, 253, 0.7);
}

/* ==========================================================================
   Footer do Modal
   ========================================================================== */
.pt-loading-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.pt-loading-security {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.pt-loading-security i {
    color: #22c55e;
}

/* ==========================================================================
   Estado de Botão Desabilitado Durante o Envio
   ========================================================================== */
.btn.pt-btn-submitting {
    position: relative;
    pointer-events: none !important;
    opacity: 0.75 !important;
    cursor: not-allowed !important;
}

.btn.pt-btn-submitting::after {
    content: "";
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-left: 0.5rem;
    vertical-align: -0.15em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: ptSpin 0.75s linear infinite;
}

/* ==========================================================================
   Keyframes das Animações
   ========================================================================== */
@keyframes ptSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes ptPulse {

    0%,
    100% {
        transform: scale(0.95);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.15);
        opacity: 0.9;
    }
}

@keyframes ptIconBreath {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.9;
    }

    50% {
        transform: scale(1.08);
        opacity: 1;
    }
}

@keyframes ptShimmer {
    0% {
        left: -45%;
        width: 35%;
    }

    50% {
        left: 35%;
        width: 60%;
    }

    100% {
        left: 100%;
        width: 35%;
    }
}

@media (max-width: 576px) {
    .pt-loading-modal {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }

    .pt-spinner-wrapper {
        width: 80px;
        height: 80px;
        margin-bottom: 1.25rem;
    }

    .pt-spinner-ring {
        width: 70px;
        height: 70px;
    }

    .pt-loading-title {
        font-size: 1.25rem;
    }

    .pt-loading-message {
        font-size: 0.88rem;
    }
}