/* WP Freebie Gate — frontend widget styles
 * Defaults are intentionally restrained so Elementor controls can override them.
 * Custom properties allow easy theming via Additional CSS without touching this file.
 */

.wpfg-widget {
    --wpfg-radius: 10px;
    --wpfg-border: #e2e6ec;
    --wpfg-text:  #1d2327;
    --wpfg-muted: #5e6470;
    --wpfg-bg:    #ffffff;
    --wpfg-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
    --wpfg-primary:        #2271b1;
    --wpfg-primary-hover:  #135e96;
    --wpfg-success:        #00a32a;
    --wpfg-success-soft:   #e6f7ec;
    --wpfg-info-soft:      #eaf3fb;
    --wpfg-warn-soft:      #fff6e0;

    box-sizing: border-box;
    max-width: 100%;
    color: var(--wpfg-text);
    line-height: 1.5;
}

.wpfg-widget *,
.wpfg-widget *::before,
.wpfg-widget *::after {
    box-sizing: inherit;
}

.wpfg-state[hidden] { display: none !important; }
.wpfg-state { margin: 0; }

/* ---------- Card container ---------- */

.wpfg-card {
    background: var(--wpfg-bg);
    border: 1px solid var(--wpfg-border);
    border-radius: var(--wpfg-radius);
    box-shadow: var(--wpfg-shadow);
    padding: clamp(1.25em, 3vw, 2em);
}

.wpfg-card--pending,
.wpfg-card--confirmed,
.wpfg-card--expired {
    text-align: center;
}

.wpfg-card--confirmed {
    background: linear-gradient(180deg, var(--wpfg-success-soft) 0%, var(--wpfg-bg) 60%);
    border-color: rgba(0,163,42,0.25);
}

.wpfg-card--pending {
    background: linear-gradient(180deg, var(--wpfg-info-soft) 0%, var(--wpfg-bg) 60%);
    border-color: rgba(34,113,177,0.25);
}

.wpfg-card--expired {
    background: linear-gradient(180deg, var(--wpfg-warn-soft) 0%, var(--wpfg-bg) 60%);
    border-color: rgba(217,168,33,0.30);
}

/* ---------- Banner image ---------- */

.wpfg-banner {
    margin: calc(clamp(1.25em, 3vw, 2em) * -1) calc(clamp(1.25em, 3vw, 2em) * -1) 1.5em;
    overflow: hidden;
    border-radius: var(--wpfg-radius) var(--wpfg-radius) 0 0;
    line-height: 0;
}

.wpfg-banner img {
    display: block;
    max-width: 100%;
    height: auto;
    margin-left: auto;
    margin-right: auto;
}

/* ---------- Heading + description ---------- */

.wpfg-heading {
    margin: 0 0 0.4em 0;
    font-size: clamp(1.15em, 2.2vw, 1.4em);
    font-weight: 600;
    line-height: 1.25;
    color: var(--wpfg-text);
}

.wpfg-heading--success {
    color: var(--wpfg-success);
}

.wpfg-description {
    margin: 0 0 1.2em 0;
    color: var(--wpfg-muted);
    font-size: 1em;
}

.wpfg-card--confirmed .wpfg-description,
.wpfg-card--pending .wpfg-description,
.wpfg-card--expired .wpfg-description {
    margin-bottom: 1.5em;
}

/* ---------- Form ---------- */

.wpfg-form {
    display: flex;
    flex-direction: column;
    gap: 0.6em;
}

.wpfg-form-row {
    display: flex;
    gap: 0.6em;
    flex-wrap: wrap;
}

.wpfg-input {
    flex: 1 1 240px;
    padding: 0.75em 1em;
    font-size: 1em;
    color: var(--wpfg-text);
    background: #fff;
    border: 1px solid var(--wpfg-border);
    border-radius: calc(var(--wpfg-radius) - 4px);
    min-width: 0;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wpfg-input:focus {
    outline: none;
    border-color: var(--wpfg-primary);
    box-shadow: 0 0 0 3px rgba(34,113,177,0.18);
}

.wpfg-input::placeholder {
    color: #9aa0a6;
}

.wpfg-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4em;
    padding: 0.75em 1.5em;
    font-size: 1em;
    font-weight: 600;
    line-height: 1.2;
    border: none;
    border-radius: calc(var(--wpfg-radius) - 4px);
    cursor: pointer;
    background: var(--wpfg-primary);
    color: #fff;
    transition: background 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
    box-shadow: 0 2px 6px rgba(34,113,177,0.25);
}

.wpfg-button:hover,
.wpfg-button:focus {
    background: var(--wpfg-primary-hover);
    color: #fff;
}

.wpfg-button:active {
    transform: translateY(1px);
}

.wpfg-button[disabled] {
    opacity: 0.65;
    cursor: not-allowed;
    box-shadow: none;
}

/* ---------- Icon circle (success / pending / expired) ---------- */

.wpfg-icon-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 1em;
    border-radius: 50%;
    color: #fff;
}

.wpfg-icon-circle svg {
    width: 32px;
    height: 32px;
}

.wpfg-icon-circle--success {
    background: var(--wpfg-success);
    box-shadow: 0 0 0 8px rgba(0,163,42,0.12), 0 4px 14px rgba(0,163,42,0.30);
    animation: wpfg-pop 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.wpfg-icon-circle--pending {
    background: var(--wpfg-primary);
    box-shadow: 0 0 0 8px rgba(34,113,177,0.12);
}

.wpfg-icon-circle--expired {
    background: #d9a821;
    box-shadow: 0 0 0 8px rgba(217,168,33,0.15);
}

@keyframes wpfg-pop {
    0%   { transform: scale(0.4); opacity: 0; }
    60%  { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1);    opacity: 1; }
}

/* ---------- Download CTA ---------- */

.wpfg-download-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55em;
    text-decoration: none;
    padding: 0.95em 1.9em;
    font-size: 1.05em;
    font-weight: 600;
    line-height: 1.2;
    background: var(--wpfg-success);
    color: #fff !important;
    border-radius: calc(var(--wpfg-radius) - 2px);
    box-shadow: 0 4px 14px rgba(0,163,42,0.30);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.wpfg-download-link:hover,
.wpfg-download-link:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(0,163,42,0.38);
    background: #008a20;
    color: #fff !important;
}

.wpfg-download-icon {
    width: 1.1em;
    height: 1.1em;
}

/* ---------- Upsell banner ---------- */

.wpfg-upsell {
    margin-top: 1.5em;
    display: flex;
    gap: 1.25em;
    align-items: center;
    padding: 1.25em;
    background: #f8f9fb;
    border: 1px solid var(--wpfg-border);
    border-radius: var(--wpfg-radius);
    text-align: left;
}

.wpfg-upsell-media {
    flex: 0 0 auto;
}

.wpfg-upsell-media img {
    display: block;
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: calc(var(--wpfg-radius) - 4px);
}

.wpfg-upsell-body {
    flex: 1 1 auto;
    min-width: 0;
}

.wpfg-upsell-eyebrow {
    display: inline-block;
    margin-bottom: 0.35em;
    padding: 0.2em 0.65em;
    background: rgba(34,113,177,0.10);
    color: var(--wpfg-primary);
    border-radius: 99px;
    font-size: 0.78em;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.wpfg-upsell-heading {
    margin: 0 0 0.3em 0;
    font-size: 1.08em;
    font-weight: 600;
    color: var(--wpfg-text);
    line-height: 1.3;
}

.wpfg-upsell-description {
    margin: 0 0 0.7em 0;
    color: var(--wpfg-muted);
    font-size: 0.95em;
}

.wpfg-upsell-button {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    padding: 0.55em 1em;
    background: transparent;
    color: var(--wpfg-primary);
    border: 1.5px solid var(--wpfg-primary);
    border-radius: calc(var(--wpfg-radius) - 4px);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95em;
    transition: background 0.15s ease, color 0.15s ease;
}

.wpfg-upsell-button:hover,
.wpfg-upsell-button:focus {
    background: var(--wpfg-primary);
    color: #fff;
}

.wpfg-upsell-arrow {
    width: 1em;
    height: 1em;
    transition: transform 0.15s ease;
}

.wpfg-upsell-button:hover .wpfg-upsell-arrow {
    transform: translateX(2px);
}

@media (max-width: 480px) {
    .wpfg-upsell {
        flex-direction: column;
        text-align: center;
    }
    .wpfg-upsell-media img {
        width: 72px;
        height: 72px;
    }
}

/* ---------- Messages (errors etc.) ---------- */

.wpfg-message {
    padding: 0.85em 1em;
    border-radius: calc(var(--wpfg-radius) - 4px);
    margin: 0 0 0.8em;
}

.wpfg-message--error {
    background: #fcf0f1;
    border-left: 4px solid #d63638;
    color: #1d2327;
    text-align: left;
}

/* ---------- Honeypot — accessible only to bots ---------- */

.wpfg-hp {
    position: absolute !important;
    left: -9999px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/* ---------- Loading spinner inside button ---------- */

.wpfg-spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    vertical-align: middle;
    animation: wpfg-spin 0.7s linear infinite;
    margin-right: 0.4em;
}

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

@media (prefers-reduced-motion: reduce) {
    .wpfg-icon-circle--success { animation: none; }
    .wpfg-spinner              { animation-duration: 1.6s; }
    .wpfg-download-link,
    .wpfg-upsell-button,
    .wpfg-upsell-arrow,
    .wpfg-button { transition: none; }
}
