/**
 * Affiliate CTA Styles
 * Professional, conversion-optimized styling for affiliate calls-to-action
 * Mobile-first design with 44px+ touch targets
 */

/* Main CTA Container */
.affiliate-cta {
    margin: 30px 0;
    padding: 24px;
    background: #f8f9fa;
    border-radius: 12px;
    text-align: center;
    border: 2px solid #e2e8f0;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.affiliate-cta:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

/* CTA Heading */
.affiliate-cta-heading {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 12px;
    line-height: 1.4;
}

/* CTA Description */
.affiliate-cta-description {
    font-size: 0.95rem;
    color: #475569;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Primary Affiliate Button */
.affiliate-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 32px;
    min-height: 48px; /* Mobile touch target */
    background: #3b82f6;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.affiliate-button:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.affiliate-button:active {
    transform: translateY(0);
}

/* External link icon */
.affiliate-button::after {
    content: '→';
    font-size: 1.2em;
    font-weight: 700;
}

/* Secondary style variant (green) */
.affiliate-button-secondary {
    background: #10b981;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.affiliate-button-secondary:hover {
    background: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Disclosure Text */
.affiliate-disclosure {
    margin-top: 14px;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

.affiliate-disclosure a {
    color: #3b82f6;
    text-decoration: underline;
}

/* Inline CTA (within results) */
.affiliate-cta-inline {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.affiliate-cta-inline .affiliate-button {
    width: 100%;
    background: white;
    color: #1e3a8a;
}

.affiliate-cta-inline .affiliate-button:hover {
    background: #f1f5f9;
    color: #1e3a8a;
}

.affiliate-cta-inline .affiliate-disclosure {
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
}

/* Sidebar CTA (for guide pages) */
.affiliate-sidebar-cta {
    position: sticky;
    top: 20px;
    background: white;
    border: 2px solid #3b82f6;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.affiliate-sidebar-cta .affiliate-cta-heading {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.affiliate-sidebar-cta .affiliate-button {
    width: 100%;
}

/* Trust Badges */
.affiliate-trust-badges {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 16px;
    font-size: 0.85rem;
    color: #64748b;
}

.affiliate-trust-badge {
    display: flex;
    align-items: center;
    gap: 6px;
}

.affiliate-trust-badge::before {
    content: '✓';
    color: #10b981;
    font-weight: bold;
    font-size: 1.1em;
}

/* Loading State */
.affiliate-button.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.affiliate-button.loading::after {
    content: '⟳';
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Mobile Responsive Styles */
@media (max-width: 767px) {
    .affiliate-cta {
        padding: 20px 16px;
        margin: 20px 0;
    }

    .affiliate-cta-heading {
        font-size: 1.1rem;
    }

    .affiliate-button {
        width: 100%;
        padding: 14px 24px;
        font-size: 15px;
    }

    .affiliate-trust-badges {
        flex-direction: column;
        gap: 8px;
    }

    .affiliate-sidebar-cta {
        position: static;
        margin-top: 20px;
    }
}

/* Tablet Styles */
@media (min-width: 768px) and (max-width: 1023px) {
    .affiliate-cta {
        padding: 28px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .affiliate-button {
        border: 2px solid currentColor;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .affiliate-button,
    .affiliate-cta {
        transition: none;
    }

    .affiliate-button:hover {
        transform: none;
    }
}

/* Print Styles - Hide CTAs */
@media print {
    .affiliate-cta,
    .affiliate-sidebar-cta {
        display: none;
    }
}

/* =============================================================================
   LEAD CAPTURE COMPONENTS
   ============================================================================= */

/* Exit-Intent Popup */
.exit-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
}

.exit-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.exit-popup-content {
    background: white;
    border-radius: 16px;
    padding: 40px 30px;
    max-width: 500px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.exit-popup-overlay.active .exit-popup-content {
    transform: scale(1);
}

.exit-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #64748b;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.exit-popup-close:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.exit-popup-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 15px;
}

.exit-popup-heading {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 10px;
    text-align: center;
    line-height: 1.3;
}

.exit-popup-subheading {
    font-size: 1rem;
    color: #475569;
    margin-bottom: 25px;
    text-align: center;
    line-height: 1.5;
}

.exit-popup-form .form-group {
    margin-bottom: 15px;
}

.exit-popup-form input[type="text"],
.exit-popup-form input[type="email"],
.exit-popup-form input[type="tel"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.exit-popup-form input:focus {
    outline: none;
    border-color: #3b82f6;
}

.exit-popup-form .checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.exit-popup-form .checkbox-group input[type="checkbox"] {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.exit-popup-form .checkbox-group span {
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
}

.exit-popup-submit {
    width: 100%;
    padding: 16px 24px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    margin-top: 10px;
}

.exit-popup-submit:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

.exit-popup-submit:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

.exit-popup-privacy {
    margin-top: 15px;
    font-size: 13px;
    color: #6b7280;
    text-align: center;
    line-height: 1.5;
}

.exit-popup-privacy a {
    color: #3b82f6;
    text-decoration: underline;
}

.exit-popup-success {
    text-align: center;
    padding: 20px;
}

.exit-popup-success .success-icon {
    width: 60px;
    height: 60px;
    background: #10b981;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 20px;
}

.exit-popup-success h4 {
    font-size: 1.5rem;
    color: #1e3a8a;
    margin-bottom: 10px;
}

.exit-popup-success p {
    font-size: 1rem;
    color: #475569;
    line-height: 1.6;
}

/* Sticky Mobile Footer CTA */
.sticky-cta-mobile {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    padding: 12px 16px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.sticky-cta-mobile.visible {
    transform: translateY(0);
}

.sticky-cta-button {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    color: #1e3a8a;
    padding: 14px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    width: 100%;
    max-width: 400px;
    justify-content: center;
    transition: transform 0.2s;
}

.sticky-cta-button:active {
    transform: scale(0.97);
}

.sticky-cta-button svg {
    flex-shrink: 0;
}

/* Lead Capture Modal */
.lead-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
    overflow-y: auto;
}

.lead-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lead-modal-content {
    background: white;
    border-radius: 16px;
    padding: 40px;
    max-width: 600px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.lead-modal-overlay.active .lead-modal-content {
    transform: scale(1);
}

.lead-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #64748b;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    z-index: 1;
}

.lead-modal-close:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.lead-modal-header {
    text-align: center;
    margin-bottom: 30px;
}

.lead-modal-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.lead-modal-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 10px;
    line-height: 1.3;
}

.lead-modal-subtitle {
    font-size: 1.05rem;
    color: #475569;
    line-height: 1.5;
}

.lead-modal-form .form-row {
    margin-bottom: 20px;
}

.lead-modal-form .form-group {
    margin-bottom: 0;
}

.lead-modal-form .form-group.full-width {
    width: 100%;
}

.lead-modal-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1e3a8a;
    font-size: 14px;
}

.lead-modal-form input[type="text"],
.lead-modal-form input[type="email"],
.lead-modal-form input[type="tel"],
.lead-modal-form input[type="number"],
.lead-modal-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.lead-modal-form input:focus,
.lead-modal-form textarea:focus {
    outline: none;
    border-color: #3b82f6;
}

.lead-modal-form textarea {
    resize: vertical;
    min-height: 80px;
}

.lead-modal-form .checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.lead-modal-form .checkbox-group label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: normal;
    margin: 0;
}

.lead-modal-form .checkbox-group input[type="checkbox"] {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.lead-modal-form .checkbox-group span {
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
}

.lead-modal-form .checkbox-group a {
    color: #3b82f6;
    text-decoration: underline;
}

.lead-modal-submit {
    width: 100%;
    padding: 16px 24px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    margin-top: 10px;
}

.lead-modal-submit:hover {
    background: #059669;
    transform: translateY(-2px);
}

.lead-modal-submit:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

.lead-modal-security {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
    font-size: 13px;
    color: #6b7280;
}

.lead-modal-security svg {
    flex-shrink: 0;
}

.lead-modal-success {
    text-align: center;
    padding: 20px;
}

.lead-modal-success .success-checkmark {
    width: 80px;
    height: 80px;
    background: #10b981;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin: 0 auto 25px;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.lead-modal-success h4 {
    font-size: 1.75rem;
    color: #1e3a8a;
    margin-bottom: 15px;
}

.lead-modal-success p {
    font-size: 1rem;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 25px;
}

.lead-modal-close-success {
    padding: 12px 32px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.lead-modal-close-success:hover {
    background: #2563eb;
}

/* Inline CTA Components */
.inline-cta {
    background: #eff6ff;
    border: 2px solid #bfdbfe;
    border-radius: 12px;
    padding: 20px;
    margin: 30px 0;
    display: flex;
    align-items: center;
    gap: 20px;
}

.inline-cta-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.inline-cta-content {
    flex: 1;
}

.inline-cta-heading {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 5px;
}

.inline-cta-text {
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.5;
}

.inline-cta-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    background: #3b82f6;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    transition: background 0.3s, transform 0.2s;
    white-space: nowrap;
    border: none;
    cursor: pointer;
}

.inline-cta-button:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

/* Newsletter Signup Component */
.newsletter-signup {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin: 40px 0;
}

.newsletter-heading {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.newsletter-description {
    font-size: 1rem;
    opacity: 0.95;
    margin-bottom: 20px;
    line-height: 1.5;
}

.newsletter-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.newsletter-input {
    flex: 1;
    min-width: 250px;
    padding: 14px 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    backdrop-filter: blur(10px);
}

.newsletter-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.newsletter-input:focus {
    outline: none;
    border-color: white;
    background: rgba(255, 255, 255, 0.2);
}

.newsletter-submit {
    padding: 14px 28px;
    background: white;
    color: #1e3a8a;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.newsletter-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.newsletter-privacy {
    font-size: 13px;
    margin-top: 12px;
    opacity: 0.9;
}

.newsletter-privacy a {
    color: white;
    text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .exit-popup-content,
    .lead-modal-content {
        padding: 30px 20px;
        margin: 20px;
    }

    .exit-popup-heading,
    .lead-modal-title {
        font-size: 1.3rem;
    }

    .inline-cta {
        flex-direction: column;
        text-align: center;
        padding: 20px 16px;
    }

    .inline-cta-button {
        width: 100%;
        justify-content: center;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-input {
        min-width: 100%;
    }

    .newsletter-submit {
        width: 100%;
    }
}
