/* ==========================================================================
 * GATED CONTENT CSS
 * ========================================================================== */

/* 1. The Gated Wrapper (Locked State) */
.kratos-gated-wrapper.is-locked {
    position: relative;
    /* Shorter max-height on mobile to ensure the form appears sooner */
    max-height: 350px;
    overflow: hidden;

    /* Cross-browser gradient fade */
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 30%, rgba(0, 0, 0, 0) 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 30%, rgba(0, 0, 0, 0) 100%);

    pointer-events: none;
    user-select: none;
    transition: all 0.5s ease-in-out;
}

/* Apply blur only on larger screens to save mobile GPU */
@media (min-width: 768px) {
    .kratos-gated-wrapper.is-locked>* {
        filter: blur(2px);
        transition: filter 0.5s ease-in-out;
    }
}

/* 2. The Form Container */
.kratos-gate-form-container {
    position: relative;
    z-index: 10;

    /* Reduced negative margin and padding for mobile screens */
    margin-top: -80px;
    padding: 1.5rem 1rem;

    background: var(--wp--preset--color--white);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    transition: opacity 0.3s ease;
}

/* Map Gravity Forms 'Orbital' CSS Variables to theme.json presets */
.kratos-gate-form-container .gform_wrapper.gravity-theme {
    --gf-ctrl-label-color: var(--wp--preset--color--ship-gray);
    --gf-ctrl-font-family: inherit;
    --gf-ctrl-btn-bg-color: var(--wp--preset--color--kratos-maroon);
    --gf-ctrl-btn-bg-color-hover: #933751;
    --gf-ctrl-btn-color: var(--wp--preset--color--white);
    --gf-ctrl-btn-border-radius: 4px;
}

/* Desktop Enhancements */
@media (min-width: 768px) {
    .kratos-gated-wrapper.is-locked {
        /* Allow more teaser text to show on wider screens */
        max-height: 500px;
    }

    .kratos-gate-form-container {
        /* Pull the form higher up into the blurred area and add breathing room */
        margin-top: -150px;
        padding: 3rem;
        box-shadow: 0 -10px 50px rgba(0, 0, 0, 0.12);
    }
}

/* ==========================================================================
 * 3. RETURNING VISITOR UNLOCKED CTA CARD
 * ========================================================================== */

.kratos-unlocked-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2.25rem 1.5rem;
    background: #ffffff;
    border: 1px solid rgba(115, 26, 54, 0.12);
    border-radius: 10px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.06);
    animation: kratosFadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes kratosFadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.kratos-unlocked-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    margin-bottom: 1.25rem;
    background: rgba(34, 197, 94, 0.1);
    color: #15803d;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: 9999px;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.kratos-unlocked-card__badge .kratos-check-icon {
    stroke: #16a34a;
    stroke-width: 2.8;
}

.kratos-unlocked-card__title {
    margin: 0 0 0.75rem;
    color: var(--wp--preset--color--ship-gray, #1f2937);
    font-family: inherit;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.25;
}

.kratos-unlocked-card__desc {
    margin: 0 0 1.75rem;
    max-width: 540px;
    color: #64748b;
    font-family: inherit;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.kratos-unlocked-card__action {
    display: flex;
    justify-content: center;
    width: 100%;
}

.kratos-unlocked-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    min-width: 220px;
    padding: 0.9rem 2rem;
    background: var(--wp--preset--color--kratos-maroon, #731a36);
    color: #ffffff;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(115, 26, 54, 0.28);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.kratos-unlocked-cta-btn:hover {
    background: #933751;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(115, 26, 54, 0.36);
}

.kratos-unlocked-cta-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(115, 26, 54, 0.2);
}

.kratos-unlocked-cta-btn .kratos-cta-icon {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.kratos-unlocked-cta-btn:hover .kratos-cta-icon {
    transform: translateY(2px);
}

.kratos-unlocked-cta-btn.is-watch:hover .kratos-cta-icon {
    transform: scale(1.15);
}

/* Autofill highlight transition */
input.is-autofilled,
select.is-autofilled {
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

/* ==========================================================================
 * 4. GATED FORM CONFIRMATION CARD (Black Theme / White Text)
 * ========================================================================== */

.kratos-gated-confirmation-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    padding: 2.5rem 1.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    margin: 1.5rem 0;
    color: #ffffff;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    animation: kratosFadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.kratos-gated-confirmation-card .kratos-confirmation-title,
.kratos-gated-confirmation-card h3,
.kratos-gated-confirmation-card h4 {
    font-family: var(--font-display);
    color: #ffffff;
    font-size: 1.5rem;
    margin: 0 0 0.75rem;
    letter-spacing: -0.01em;
}

.kratos-gated-confirmation-card .kratos-confirmation-message {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
    max-width: 580px;
    width: 100%;
}

.kratos-gated-confirmation-card .kratos-confirmation-message p {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 0.5rem;
}

.kratos-confirmation-actions {
    width: 100%;
    text-align: center;
}

.kratos-confirmation-actions .kratos-confirmation-btn {
    display: block;
    width: fit-content;
    margin: 0 auto 0.75rem;
    text-align: center;
    padding: 0.85rem 2rem;
    background: var(--wp--preset--color--kratos-maroon, #731a36);
    color: #ffffff;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.2;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(115, 26, 54, 0.28);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.kratos-confirmation-actions .kratos-confirmation-btn:hover {
    background: #933751;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(115, 26, 54, 0.36);
}

.kratos-confirmation-actions .kratos-confirmation-btn .kratos-cta-icon {
    display: inline-block;
    vertical-align: -3px;
    margin-right: 0.5rem;
}

.kratos-confirmation-actions .kratos-confirmation-subtext {
    display: block;
    text-align: center;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.6);
}
