/* Newsletter Contact Form - Modern Clean Design */
/* All styles scoped to .newsletter-contact-form to prevent conflicts */

.newsletter-contact-form {
    /* max-width: 1100px; */
    margin: 0 auto;
    background: #ffffff;
    color: #1a1a1a;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    overflow: visible;
}

/* Container Layout */
.newsletter-contact-form .newsletter-form-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 600px;
    overflow: visible;
}

/* Contact Form 7 Specific Fixes */
.newsletter-contact-form .wpcf7 {
    overflow: visible;
}

.newsletter-contact-form .wpcf7-form {
    overflow: visible;
}

/* Left Content Section */
.newsletter-contact-form .newsletter-content {
    padding: 40px 50px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.newsletter-contact-form .newsletter-content h2 {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.newsletter-contact-form .newsletter-content .subtitle {
    font-size: 16px;
    color: #475569;
    margin: 12px 0 0 0;
    font-weight: 500;
}

.newsletter-contact-form .newsletter-content .description {
    font-size: 15px;
    color: #64748b;
    margin: 24px 0 0 0;
    line-height: 1.6;
}

/* Features List */
.newsletter-contact-form .newsletter-features {
    list-style: none;
    padding: 0;
    margin: 32px 0 0 0;
}

.newsletter-contact-form .newsletter-features li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 16px;
    font-size: 14px;
    color: #64748b;
}

.newsletter-contact-form .newsletter-features li::before {
    content: "✓";
    color: #10b981;
    font-weight: 600;
    font-size: 14px;
    margin-right: 12px;
    margin-top: 1px;
    flex-shrink: 0;
}

.newsletter-contact-form .newsletter-features .feature-title {
    font-weight: 600;
    color: #374151;
    margin-right: 6px;
}

.newsletter-contact-form .newsletter-disclaimer {
    font-size: 13px;
    color: #9ca3af;
    margin-top: 24px;
    font-style: italic;
}

/* Right Form Section */
.newsletter-contact-form .newsletter-form {
    padding: 40px 50px;
    background: #ffffff;
    overflow: visible;
}

.newsletter-contact-form .newsletter-form h3 {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.3;
    letter-spacing: -0.01em;
    overflow: visible;
    white-space: normal;
}

.newsletter-contact-form .newsletter-form .form-subtitle {
    font-size: 14px;
    color: #64748b;
    margin: 6px 0 32px 0;
    line-height: 1.5;
    overflow: visible;
    white-space: normal;
}

/* Form Field Containers */
.newsletter-contact-form .wpcf7-form-control-wrap {
    display: block;
    position: relative;
}

/* Two Column Layout for Name and Company */
.newsletter-contact-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-left: 0;
    margin-right: 0;
}

.newsletter-contact-form .form-row .wpcf7-form-control-wrap {
    margin-bottom: 0;
}

.newsletter-contact-form .form-row > div {
    display: flex;
    flex-direction: column;
    margin-left: 0;
    margin-right: 0;
}

/* Inline layout for label and input in form rows */
.newsletter-contact-form .form-row label {
    display: block;
    margin-bottom: 6px;
    margin-right: 0;
}

.newsletter-contact-form .form-row .wpcf7-form-control-wrap {
    margin-bottom: 0;
    display: block;
}

/* Labels */
.newsletter-contact-form .newsletter-form label {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    margin-right: 8px;
    letter-spacing: 0.01em;
}

/* Remove Contact Form 7 auto-generated breaks and paragraph margins */
.newsletter-contact-form .newsletter-form br {
    display: none;
}

.newsletter-contact-form .newsletter-form p {
    margin: 0;
    margin-bottom: 0;
    padding: 0;
}

.newsletter-contact-form .form-row p {
    margin: 0;
    margin-bottom: 0;
    padding: 0;
}

/* Input Fields */
.newsletter-contact-form .newsletter-form input[type="text"],
.newsletter-contact-form .newsletter-form input[type="email"],
.newsletter-contact-form .newsletter-form textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    color: #1e293b;
    font-family: inherit;
    transition: all 0.2s ease;
    outline: none;
    margin: 0;
    margin-bottom: 0;
}

.newsletter-contact-form .newsletter-form input[type="text"]:focus,
.newsletter-contact-form .newsletter-form input[type="email"]:focus,
.newsletter-contact-form .newsletter-form textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: #fafbff;
}

.newsletter-contact-form .newsletter-form input::placeholder,
.newsletter-contact-form .newsletter-form textarea::placeholder {
    color: #94a3b8;
    font-style: normal;
}

.newsletter-contact-form .newsletter-form textarea {
    min-height: 100px;
    resize: vertical;
    line-height: 1.6;
}

/* Preferences Section */
.newsletter-contact-form .preferences-section {
    margin: 24px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.newsletter-contact-form .preferences-section h4 {
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.newsletter-contact-form .preferences-section h4::before {
    content: "⚙";
    font-size: 16px;
    color: #6b7280;
}

/* Checkbox Group with improved visual organization */
.newsletter-contact-form .checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 6px 0;
    background: #ffffff;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.newsletter-contact-form .checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 6px 0;
}

.newsletter-contact-form .checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.newsletter-contact-form .checkbox-item:hover {
    background-color: #f8fafc;
}

/* Custom Checkboxes with better styling */
.newsletter-contact-form .newsletter-form input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    margin: 0;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    flex-shrink: 0;
    vertical-align: middle;
    display: inline-block;
}

/* Contact Form 7 checkbox alignment */
.newsletter-contact-form .wpcf7-list-item input[type="checkbox"] {
    margin-top: 0;
    margin-right: 0;
    vertical-align: top;
    align-self: flex-start;
    margin-top: 1px; /* Fine-tune vertical alignment */
}

.newsletter-contact-form .newsletter-form input[type="checkbox"]:checked {
    background: #3b82f6;
    border-color: #3b82f6;
}

.newsletter-contact-form .newsletter-form input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 6px;
    width: 4px;
    height: 8px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.newsletter-contact-form .newsletter-form input[type="checkbox"]:hover {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.newsletter-contact-form .newsletter-form input[type="checkbox"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.newsletter-contact-form .checkbox-item label {
    font-size: 14px;
    font-weight: 400;
    margin: 0;
    cursor: pointer;
    color: #475569;
    line-height: 1.5;
    flex: 1;
}

/* Contact Form 7 specific checkbox styling */
.newsletter-contact-form .wpcf7-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    margin-bottom: 12px;
}

.newsletter-contact-form .wpcf7-list-item:hover {
    background-color: #f8fafc;
}

.newsletter-contact-form .wpcf7-list-item label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    cursor: pointer;
    width: 100%;
}

.newsletter-contact-form .wpcf7-list-item-label {
    font-size: 14px;
    font-weight: 400;
    color: #475569;
    line-height: 1.5;
    margin: 0;
    padding: 0;
    display: inline-block;
    vertical-align: middle;
}

/* EU Notice */
.newsletter-contact-form .eu-notice {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 12px;
    margin: 16px 0;
    font-size: 13px;
    color: #1e40af;
    line-height: 1.5;
}

/* Privacy Agreement */
.newsletter-contact-form .privacy-agreement {
    margin: 20px 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}

.newsletter-contact-form .privacy-agreement input[type="checkbox"] {
    margin-right: 8px;
    margin-top: 2px;
}

.newsletter-contact-form .privacy-agreement a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.newsletter-contact-form .privacy-agreement a:hover {
    text-decoration: underline;
}

/* Submit Button */
.newsletter-contact-form .newsletter-form input[type="submit"] {
    width: 100%;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    border: none;
    padding: 16px 32px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 4px;
    letter-spacing: 0.01em;
}

.newsletter-contact-form .newsletter-form input[type="submit"]:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.newsletter-contact-form .newsletter-form input[type="submit"]:active {
    transform: translateY(0);
}

/* Footer Text */
.newsletter-contact-form .form-footer {
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 12px;
}

/* Contact Form 7 Response Messages - Enhanced Styling */
.newsletter-contact-form .wpcf7-response-output {
    padding: 16px 20px;
    margin: 0 0 20px 0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    color: #374151;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Success Message */
.newsletter-contact-form .wpcf7-mail-sent-ok {
    background: linear-gradient(135deg, #d1fae5 0%, #ecfdf5 100%) !important;
    border: 1px solid #10b981 !important;
    color: #047857 !important;
    padding: 16px 20px !important;
    padding-left: 50px !important;
    border-radius: 8px !important;
    margin-bottom: 20px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    position: relative !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1) !important;
}

.newsletter-contact-form .wpcf7-mail-sent-ok::before {
    content: "✓";
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: #10b981;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

/* Error Messages */
.newsletter-contact-form .wpcf7-mail-sent-ng,
.newsletter-contact-form .wpcf7-validation-errors,
.newsletter-contact-form .wpcf7-aborted {
    background: linear-gradient(135deg, #fee2e2 0%, #fef2f2 100%) !important;
    border: 1px solid #ef4444 !important;
    color: #dc2626 !important;
    padding: 16px 20px !important;
    padding-left: 50px !important;
    border-radius: 8px !important;
    margin-bottom: 20px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    position: relative !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.1) !important;
}

.newsletter-contact-form .wpcf7-mail-sent-ng::before,
.newsletter-contact-form .wpcf7-validation-errors::before,
.newsletter-contact-form .wpcf7-aborted::before {
    content: "!";
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: #ef4444;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

/* Spam/Security Messages */
.newsletter-contact-form .wpcf7-spam-blocked {
    background: linear-gradient(135deg, #fef3c7 0%, #fffbeb 100%);
    border: 1px solid #f59e0b;
    color: #d97706;
    padding: 16px 20px;
    padding-left: 50px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.1);
}

.newsletter-contact-form .wpcf7-spam-blocked::before {
    content: "⚠";
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: #f59e0b;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

/* Field Validation Messages */
.newsletter-contact-form .wpcf7-not-valid-tip {
    color: #dc2626;
    font-size: 12px;
    margin-top: 6px;
    padding: 4px 8px;
    background: #fee2e2;
    border-radius: 4px;
    border-left: 3px solid #ef4444;
    font-weight: 500;
}

/* Loading/Processing State */
.newsletter-contact-form .wpcf7-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .newsletter-contact-form {
        margin: 0;
        border-radius: 12px;
    }

    .newsletter-contact-form .newsletter-form-container {
        grid-template-columns: 1fr;
    }

    .newsletter-contact-form .newsletter-content,
    .newsletter-contact-form .newsletter-form {
        padding: 40px 30px;
    }

    .newsletter-contact-form .newsletter-content h2 {
        font-size: 24px;
    }

    .newsletter-contact-form .newsletter-content .subtitle {
        font-size: 15px;
    }

    /* Stack form fields on mobile */
    .newsletter-contact-form .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .newsletter-contact-form .form-row .wpcf7-form-control-wrap {
        margin-bottom: 20px;
    }

    /* Improved checkbox layout on mobile */
    .newsletter-contact-form .preferences-section {
        padding: 16px;
        margin: 20px 0;
    }

    .newsletter-contact-form .checkbox-group {
        padding: 12px;
        gap: 12px;
    }

    .newsletter-contact-form .checkbox-item {
        padding: 6px;
    }

    /* Ensure response messages are properly sized on mobile */
    .newsletter-contact-form .wpcf7-mail-sent-ok,
    .newsletter-contact-form .wpcf7-mail-sent-ng,
    .newsletter-contact-form .wpcf7-validation-errors,
    .newsletter-contact-form .wpcf7-aborted,
    .newsletter-contact-form .wpcf7-spam-blocked {
        padding: 14px 18px;
        padding-left: 44px;
        font-size: 13px;
    }

    .newsletter-contact-form .wpcf7-mail-sent-ok::before,
    .newsletter-contact-form .wpcf7-mail-sent-ng::before,
    .newsletter-contact-form .wpcf7-validation-errors::before,
    .newsletter-contact-form .wpcf7-aborted::before,
    .newsletter-contact-form .wpcf7-spam-blocked::before {
        left: 14px;
        width: 18px;
        height: 18px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .newsletter-contact-form {
        margin: 0;
    }

    .newsletter-contact-form .newsletter-content,
    .newsletter-contact-form .newsletter-form {
        padding: 30px 20px;
    }

    .newsletter-contact-form .newsletter-content h2 {
        font-size: 22px;
    }
}
