/* ============================================================
   ALUFOLD GATED DOWNLOAD MODAL & STYLES
   ============================================================ */

/* ── Overlay & Backdrop ─────────────────────────────────────── */
.afw-gate-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    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);
}

.afw-gate-overlay.afw-gate-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.afw-gate-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
}

/* ── Modal Dialog ───────────────────────────────────────────── */
.afw-gate-dialog {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 580px;
    margin: auto;
    transform: translateY(24px) scale(0.96);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.afw-gate-overlay.afw-gate-open .afw-gate-dialog {
    transform: translateY(0) scale(1);
}

.afw-gate-card {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    padding: 36px 36px 28px;
}

/* ── Close Button ───────────────────────────────────────────── */
.afw-gate-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #F1F5F9;
    border: none;
    color: #64748B;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, transform 0.2s;
    padding: 0;
    z-index: 10;
}

.afw-gate-close-btn:hover {
    background: #E2E8F0;
    color: #0F172A;
    transform: rotate(90deg);
}

/* ── Header ─────────────────────────────────────────────────── */
.afw-gate-header {
    text-align: left;
    margin-bottom: 24px;
    padding-right: 32px;
}

.afw-gate-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(233, 86, 31, 0.1);
    color: #E9561F;
    border: 1px solid rgba(233, 86, 31, 0.25);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.afw-gate-title {
    font-size: 24px;
    font-weight: 700;
    color: #232F3E;
    line-height: 1.25;
    margin: 0 0 8px 0;
}

.afw-gate-desc {
    font-size: 14px;
    color: #64748B;
    line-height: 1.5;
    margin: 0;
}

.afw-gate-desc strong {
    color: #232F3E;
    font-weight: 600;
}

/* ── Form Grid & Fields ─────────────────────────────────────── */
.afw-gate-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.afw-gate-field {
    display: flex;
    flex-direction: column;
}

.afw-gate-field p {
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
}

.afw-gate-form-grid br {
    display: none !important;
}

.afw-gate-field-full {
    grid-column: 1 / -1;
}

.afw-gate-field label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
    display: block;
}

.afw-gate-field label .required {
    color: #E9561F;
    font-weight: 700;
}

.afw-gate-input {
    width: 100% !important;
    height: 44px !important;
    padding: 10px 14px !important;
    background: #F8FAFC !important;
    border: 1.5px solid #E2E8F0 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    color: #1E293B !important;
    transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s !important;
    box-sizing: border-box !important;
}

.afw-gate-input:focus {
    background: #FFFFFF !important;
    border-color: #E9561F !important;
    box-shadow: 0 0 0 3px rgba(233, 86, 31, 0.15) !important;
    outline: none !important;
}

.afw-gate-input::placeholder {
    color: #94A3B8 !important;
}

/* ── Acceptance / Checkbox ──────────────────────────────────── */
.afw-gate-form-grid .wpcf7-acceptance {
    display: block;
    margin-top: 4px;
}

.afw-gate-form-grid .wpcf7-acceptance label {
    font-size: 12.5px;
    color: #64748B;
    font-weight: 400;
    line-height: 1.45;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
}

.afw-gate-form-grid .wpcf7-acceptance input[type="checkbox"] {
    margin-top: 3px;
    accent-color: #E9561F;
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.afw-gate-form-grid .wpcf7-acceptance a {
    color: #E9561F;
    text-decoration: underline;
    font-weight: 500;
}

/* ── Submit Button ──────────────────────────────────────────── */
.afw-gate-field-submit {
    grid-column: 1 / -1;
    margin-top: 6px;
}

.afw-gate-submit-btn {
    width: 100% !important;
    height: 48px !important;
    background: #E9561F !important;
    color: #FFFFFF !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em !important;
    cursor: pointer !important;
    transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s !important;
    box-shadow: 0 4px 12px rgba(233, 86, 31, 0.3) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.afw-gate-submit-btn:hover {
    background: #D8450F !important;
    box-shadow: 0 6px 16px rgba(233, 86, 31, 0.4) !important;
    transform: translateY(-1px);
}

.afw-gate-submit-btn:active {
    transform: translateY(0);
}

/* ── CF7 Response & Validation Styles ───────────────────────── */
.afw-gate-body .wpcf7 form.submitting .afw-gate-submit-btn {
    opacity: 0.8;
    pointer-events: none;
}

.afw-gate-body .wpcf7-spinner {
    margin: 8px auto 0 !important;
    display: block !important;
}

.afw-gate-body .wpcf7-not-valid-tip {
    font-size: 11.5px !important;
    color: #DC2626 !important;
    margin-top: 4px !important;
    font-weight: 500 !important;
}

.afw-gate-body .wpcf7-response-output {
    margin: 14px 0 0 !important;
    padding: 10px 14px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    text-align: center !important;
    border: 1px solid transparent !important;
}

.afw-gate-body form.sent .wpcf7-response-output {
    background: #ECFDF5 !important;
    border-color: #A7F3D0 !important;
    color: #065F46 !important;
}

.afw-gate-body form.invalid .wpcf7-response-output,
.afw-gate-body form.unaccepted .wpcf7-response-output,
.afw-gate-body form.failed .wpcf7-response-output {
    background: #FEF2F2 !important;
    border-color: #FECACA !important;
    color: #991B1B !important;
}

/* ── Footer / Trust Badge ───────────────────────────────────── */
.afw-gate-footer {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #F1F5F9;
    text-align: center;
}

.afw-gate-security {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #94A3B8;
    font-size: 12px;
}

.afw-gate-security svg {
    color: #10B981;
}

/* ── Mobile Responsive ──────────────────────────────────────── */
@media (max-width: 640px) {
    .afw-gate-overlay {
        padding: 12px;
        align-items: flex-end;
    }

    .afw-gate-card {
        padding: 24px 20px 20px;
        border-radius: 16px 16px 0 0;
        max-height: 90vh;
        overflow-y: auto;
    }

    .afw-gate-form-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .afw-gate-title {
        font-size: 20px;
    }

    .afw-gate-close-btn {
        top: 14px;
        right: 14px;
    }
}
