/**
 * PCT CF7 Feedback Popup
 * Styles for the spinner overlay and the result popup.
 */

:root {
    --pct-cf7-fb-success: #30959a;
    --pct-cf7-fb-error: #d4474b;
    --pct-cf7-fb-text: #1f2933;
    --pct-cf7-fb-muted: #6b7280;
    --pct-cf7-fb-backdrop: rgba(0, 0, 0, 0.5);
    --pct-cf7-fb-surface: #ffffff;
    --pct-cf7-fb-radius: 10px;
    --pct-cf7-fb-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

/* ---------------------------------------------------------------------------
 * Spinner overlay
 * ------------------------------------------------------------------------- */

.wpcf7-form {
    position: relative;
}

.pct-cf7-fb-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.2s ease,
        visibility 0.2s ease;
}

.pct-cf7-fb-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.pct-cf7-fb-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.pct-cf7-fb-spinner::before {
    content: "";
    width: 44px;
    height: 44px;
    border: 4px solid rgba(48, 149, 154, 0.25);
    border-top-color: var(--pct-cf7-fb-success);
    border-radius: 50%;
    animation: pct-cf7-fb-spin 0.8s linear infinite;
}

.pct-cf7-fb-spinner-label {
    font-size: 0.95rem;
    color: var(--pct-cf7-fb-text);
}

@keyframes pct-cf7-fb-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------------------------------------------------------------------------
 * Result popup
 * ------------------------------------------------------------------------- */

body.pct-cf7-fb-popup-open {
    overflow: hidden;
}

.pct-cf7-fb-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pct-cf7-fb-popup-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--pct-cf7-fb-backdrop);
    animation: pct-cf7-fb-fade-in 0.2s ease;
}

.pct-cf7-fb-popup-dialog {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: var(--pct-cf7-fb-surface);
    border-radius: var(--pct-cf7-fb-radius);
    box-shadow: var(--pct-cf7-fb-shadow);
    padding: 32px 28px 28px;
    text-align: center;
    animation: pct-cf7-fb-pop-in 0.25s ease;
}

.pct-cf7-fb-popup-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pct-cf7-fb-popup-icon::before {
    content: "";
    width: 24px;
    height: 12px;
    border-left: 3px solid #ffffff;
    border-bottom: 3px solid #ffffff;
    transform: rotate(-45deg) translate(1px, -2px);
}

.pct-cf7-fb-popup-success .pct-cf7-fb-popup-icon {
    background: var(--pct-cf7-fb-success);
}

.pct-cf7-fb-popup-error .pct-cf7-fb-popup-icon {
    background: var(--pct-cf7-fb-error);
}

.pct-cf7-fb-popup-error .pct-cf7-fb-popup-icon::before {
    border: 0;
    width: 22px;
    height: 22px;
    background:
        linear-gradient(
            45deg,
            transparent 44%,
            #ffffff 44%,
            #ffffff 56%,
            transparent 56%
        ),
        linear-gradient(
            -45deg,
            transparent 44%,
            #ffffff 44%,
            #ffffff 56%,
            transparent 56%
        );
    transform: none;
}

.pct-cf7-fb-popup-title {
    margin: 0 0 10px;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--pct-cf7-fb-text);
}

.pct-cf7-fb-popup-message {
    margin: 0 0 24px;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--pct-cf7-fb-muted);
}

.pct-cf7-fb-popup-close {
    display: inline-block;
    padding: 12px 28px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    background: var(--pct-cf7-fb-success);
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.pct-cf7-fb-popup-close:hover,
.pct-cf7-fb-popup-close:focus {
    opacity: 0.85;
}

.pct-cf7-fb-popup-error .pct-cf7-fb-popup-close {
    background: var(--pct-cf7-fb-error);
}

@keyframes pct-cf7-fb-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pct-cf7-fb-pop-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .pct-cf7-fb-overlay,
    .pct-cf7-fb-popup-backdrop,
    .pct-cf7-fb-popup-dialog {
        animation: none;
        transition: none;
    }
}
