/**
 * CF7 Step Wizard - Professional Compact Styles
 * Version: 2.5.1
 * 
 * COMPACT VERSION - Optimized for popups and modals
 * Compatible with Contact Form 7 6.x+
 */

/* ============================================
   CSS Variables (Customizable via Admin)
   ============================================ */
:root {
    /* Primary Colors - Overridden by admin settings via inline CSS */
    --cf7sw-primary: #10b981;
    --cf7sw-primary-dark: #059669;
    --cf7sw-primary-light: #d1fae5;
    --cf7sw-primary-rgb: 16, 185, 129;
    
    /* Neutral Colors */
    --cf7sw-white: #ffffff;
    --cf7sw-background: #f8fafc;
    --cf7sw-border: #e2e8f0;
    --cf7sw-border-focus: var(--cf7sw-primary);
    
    /* Text Colors */
    --cf7sw-text: #334155;
    --cf7sw-text-light: #64748b;
    --cf7sw-text-muted: #94a3b8;
    
    /* Status Colors */
    --cf7sw-error: #ef4444;
    --cf7sw-error-light: #fef2f2;
    --cf7sw-success: var(--cf7sw-primary);
    
    /* Border Radius */
    --cf7sw-radius: 6px;
    
    /* Transitions */
    --cf7sw-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Main Wrapper - COMPACT
   ============================================ */
.cf7sw-wizard-wrapper {
    max-width: 100%;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--cf7sw-white);
    border-radius: 8px;
    overflow: hidden;
}

/* ============================================
   HIDE CF7 Default Success Message
   ============================================ */
.cf7sw-wizard-wrapper ~ .wpcf7-response-output,
.cf7sw-wizard-container .wpcf7-response-output,
.wpcf7-form.cf7sw-wizard-active .wpcf7-response-output,
.wpcf7-form .wpcf7-response-output.wpcf7-mail-sent-ok,
.wpcf7-form .wpcf7-response-output.wpcf7-mail-sent-ng,
.cf7sw-wizard-wrapper + .wpcf7-response-output,
form.wpcf7-form:has(.cf7sw-wizard-wrapper) .wpcf7-response-output {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

/* ============================================
   Progress Bar - FULLY INTEGRATED (inside form)
   ============================================ */
.cf7sw-progress-container {
    background: transparent;
    padding: 12px 16px 0;
    margin: 0;
    box-shadow: none;
    border-bottom: none;
}

.cf7sw-progress-bar {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0;
}

/* Progress Line Background */
.cf7sw-progress-bar::before {
    content: '';
    position: absolute;
    top: 17px;
    left: var(--cf7sw-line-offset, 10%);
    right: var(--cf7sw-line-offset, 10%);
    height: 3px;
    background: var(--cf7sw-border);
    border-radius: 10px;
    z-index: 1;
}

/* Progress Line Fill - Animated */
.cf7sw-progress-fill {
    position: absolute;
    top: 17px;
    left: var(--cf7sw-line-offset, 10%);
    height: 3px;
    background: linear-gradient(90deg, var(--cf7sw-primary), var(--cf7sw-primary-dark));
    border-radius: 10px;
    z-index: 2;
    transition: width 0.4s ease;
    box-shadow: 0 0 8px rgba(var(--cf7sw-primary-rgb), 0.5);
}

/* Glow effect on fill end - hidden when width is 0 */
.cf7sw-progress-fill::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: var(--cf7sw-primary);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(var(--cf7sw-primary-rgb), 0.7);
    animation: cf7sw-glow 1.5s ease-in-out infinite;
    transition: opacity 0.3s ease;
}

/* Hide glow dot when fill has no width (step 0) */
.cf7sw-progress-fill[style*="width: 0"],
.cf7sw-progress-fill[style*="width:0"] {
    overflow: hidden;
}
.cf7sw-progress-fill[style*="width: 0"]::after,
.cf7sw-progress-fill[style*="width:0"]::after {
    display: none;
}

@keyframes cf7sw-glow {
    0%, 100% { box-shadow: 0 0 8px rgba(var(--cf7sw-primary-rgb), 0.5); }
    50% { box-shadow: 0 0 16px rgba(var(--cf7sw-primary-rgb), 0.9); }
}

/* ============================================
   Step Items - COMPACT circles
   ============================================ */
.cf7sw-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 3;
    flex: 1;
}

.cf7sw-step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--cf7sw-white);
    border: 2px solid var(--cf7sw-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--cf7sw-text-light);
    transition: var(--cf7sw-transition);
    position: relative;
}

.cf7sw-step-number {
    transition: var(--cf7sw-transition);
    line-height: 1;
}

/* Checkmark - CENTERED FIX */
.cf7sw-step-check {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: var(--cf7sw-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cf7sw-step-check svg {
    width: 18px;
    height: 18px;
    stroke: var(--cf7sw-white);
    stroke-width: 3;
    fill: none;
    display: block;
}

/* Step Title - under circles */
.cf7sw-step-title {
    margin-top: 6px;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--cf7sw-text-muted);
    text-align: center;
    transition: var(--cf7sw-transition);
    line-height: 1.2;
    max-width: 80px;
}

/* ============================================
   Step States
   ============================================ */

/* Active Step */
.cf7sw-step-item.cf7sw-active .cf7sw-step-circle {
    background: var(--cf7sw-primary);
    border-color: var(--cf7sw-primary);
    color: var(--cf7sw-white);
    box-shadow: 0 0 0 3px rgba(var(--cf7sw-primary-rgb), 0.2);
    transform: scale(1.08);
}

.cf7sw-step-item.cf7sw-active .cf7sw-step-title {
    color: var(--cf7sw-primary);
    font-weight: 600;
}

/* Completed Step */
.cf7sw-step-item.cf7sw-completed .cf7sw-step-circle {
    background: var(--cf7sw-primary);
    border-color: var(--cf7sw-primary);
}

.cf7sw-step-item.cf7sw-completed .cf7sw-step-number {
    opacity: 0;
    transform: scale(0);
}

.cf7sw-step-item.cf7sw-completed .cf7sw-step-check {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.cf7sw-step-item.cf7sw-completed .cf7sw-step-title {
    color: var(--cf7sw-primary);
}

.cf7sw-step-item.cf7sw-completed {
    cursor: pointer;
}

.cf7sw-step-item.cf7sw-completed:hover .cf7sw-step-circle {
    transform: scale(1.05);
}

/* ============================================
   Hide Progress Text (redundant)
   ============================================ */
.cf7sw-progress-text {
    display: none;
}

/* ============================================
   Step Content Panels - COMPACT
   ============================================ */
.cf7sw-steps-content {
    background: var(--cf7sw-white);
    box-shadow: none;
    border-radius: 0;
}

.cf7sw-step-panel {
    display: none;
    padding: 20px;
    margin-top: 0;
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.cf7sw-step-panel.cf7sw-active {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

/* Slide animations */
.cf7sw-step-panel.cf7sw-slide-left {
    animation: cf7sw-slideLeft 0.35s ease forwards;
}

.cf7sw-step-panel.cf7sw-slide-right {
    animation: cf7sw-slideRight 0.35s ease forwards;
}

@keyframes cf7sw-slideLeft {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes cf7sw-slideRight {
    from { opacity: 0; transform: translateX(-40px); }
    to { opacity: 1; transform: translateX(0); }
}

/* HIDE Panel Header (redundant - already shown in progress bar) */
.cf7sw-panel-header {
    display: none !important;
}

/* ============================================
   Form Fields - COMPACT
   ============================================ */
.cf7sw-panel-content {
    margin: 0;
}

.cf7sw-step-panel p {
    margin-bottom: 10px;
}

.cf7sw-step-panel label {
    display: block;
    font-weight: 500;
    color: var(--cf7sw-text);
    margin-bottom: 4px;
    font-size: 0.8rem;
}

.cf7sw-step-panel input[type="text"],
.cf7sw-step-panel input[type="email"],
.cf7sw-step-panel input[type="tel"],
.cf7sw-step-panel input[type="url"],
.cf7sw-step-panel input[type="number"],
.cf7sw-step-panel input[type="date"],
.cf7sw-step-panel textarea,
.cf7sw-step-panel select {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.9rem;
    border: 1px solid var(--cf7sw-border);
    border-radius: 6px;
    background: var(--cf7sw-white);
    color: var(--cf7sw-text);
    transition: var(--cf7sw-transition);
    box-sizing: border-box;
}

.cf7sw-step-panel textarea {
    min-height: 80px;
    resize: vertical;
}

.cf7sw-step-panel input:focus,
.cf7sw-step-panel textarea:focus,
.cf7sw-step-panel select:focus {
    outline: none;
    border-color: var(--cf7sw-primary);
    box-shadow: 0 0 0 2px rgba(var(--cf7sw-primary-rgb), 0.15);
}

/* Valid state - green border when field is valid */
input.cf7sw-valid,
textarea.cf7sw-valid,
select.cf7sw-valid {
    border-color: var(--cf7sw-primary) !important;
    background: rgba(var(--cf7sw-primary-rgb), 0.03) !important;
}

/* Field completed indicator */
.cf7sw-field-wrapper {
    position: relative;
}

.cf7sw-field-wrapper.cf7sw-completed::after {
    content: '✓';
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--cf7sw-primary);
    font-size: 14px;
    font-weight: bold;
    pointer-events: none;
}

/* Hide checkmark on date inputs (conflicts with calendar icon) */
.cf7sw-field-wrapper.cf7sw-completed:has(input[type="date"])::after {
    display: none;
}

/* Hide checkmark on checkbox/radio groups (not needed) */
.cf7sw-field-wrapper.cf7sw-completed:has(input[type="checkbox"])::after,
.cf7sw-field-wrapper.cf7sw-completed:has(input[type="radio"])::after {
    display: none;
}

/* Error state */
.cf7sw-error input,
.cf7sw-error textarea,
.cf7sw-error select,
input.cf7sw-invalid,
textarea.cf7sw-invalid,
select.cf7sw-invalid {
    border-color: var(--cf7sw-error) !important;
    background: var(--cf7sw-error-light) !important;
}

.cf7sw-error-message {
    color: var(--cf7sw-error);
    font-size: 0.7rem;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.cf7sw-error-message svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* ============================================
   Checkbox & Radio - Ensure always clickable
   ============================================ */
.cf7sw-step-panel input[type="checkbox"],
.cf7sw-step-panel input[type="radio"] {
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 4px 0 0 !important;
    border: revert !important;
    border-radius: revert !important;
    background: revert !important;
    box-shadow: revert !important;
    -webkit-appearance: checkbox !important;
    appearance: checkbox !important;
    position: static !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

.cf7sw-step-panel input[type="radio"] {
    -webkit-appearance: radio !important;
    appearance: radio !important;
}

.cf7sw-step-panel .wpcf7-list-item {
    display: inline-block;
    margin: 4px 12px 4px 0;
    cursor: pointer;
}

.cf7sw-step-panel .wpcf7-list-item label {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    cursor: pointer !important;
    font-size: 0.85rem;
    color: var(--cf7sw-text);
}

/* ============================================
   Character Counter for Textarea
   ============================================ */
.cf7sw-char-counter {
    display: flex;
    justify-content: flex-end;
    font-size: 0.7rem;
    color: var(--cf7sw-text-muted);
    margin-top: 4px;
}

.cf7sw-char-counter.cf7sw-warning {
    color: #f59e0b;
}

.cf7sw-char-counter.cf7sw-danger {
    color: var(--cf7sw-error);
}

/* ============================================
   Loading/Saving indicator
   ============================================ */
.cf7sw-saving-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--cf7sw-text);
    color: var(--cf7sw-white);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 9999;
}

.cf7sw-saving-indicator.cf7sw-visible {
    opacity: 1;
    transform: translateY(0);
}

.cf7sw-saving-indicator svg {
    width: 16px;
    height: 16px;
    animation: cf7sw-spin 1s linear infinite;
}

@keyframes cf7sw-spin {
    to { transform: rotate(360deg); }
}

/* Restored data notice */
.cf7sw-restored-notice {
    background: rgba(var(--cf7sw-primary-rgb), 0.1);
    border-left: 3px solid var(--cf7sw-primary);
    padding: 10px 14px;
    margin-bottom: 16px;
    border-radius: 0 6px 6px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.cf7sw-restored-notice button {
    background: none;
    border: none;
    color: var(--cf7sw-error);
    cursor: pointer;
    font-size: 0.8rem;
    text-decoration: underline;
}

/* ============================================
   Navigation Buttons - COMPACT
   ============================================ */
.cf7sw-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--cf7sw-border);
    gap: 12px;
}

.cf7sw-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    border-radius: var(--cf7sw-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    /* Safari iOS touch fixes */
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.cf7sw-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

/* Previous Button */
.cf7sw-btn-prev {
    background: var(--cf7sw-background);
    color: var(--cf7sw-text);
    border: 1px solid var(--cf7sw-border);
}

.cf7sw-btn-prev:hover {
    background: var(--cf7sw-border);
}

.cf7sw-btn-prev:hover svg {
    transform: translateX(-3px);
}

.cf7sw-btn-prev:disabled {
    opacity: 0;
    pointer-events: none;
}

/* Next & Submit Buttons */
.cf7sw-btn-next,
.cf7sw-btn-submit {
    background: var(--cf7sw-primary);
    color: var(--cf7sw-white);
    box-shadow: 0 2px 8px rgba(var(--cf7sw-primary-rgb), 0.3);
}

.cf7sw-btn-next:hover,
.cf7sw-btn-submit:hover {
    background: var(--cf7sw-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--cf7sw-primary-rgb), 0.4);
}

.cf7sw-btn-next:hover svg {
    transform: translateX(3px);
}

/* ============================================
   Success Message - COMPACT
   ============================================ */
.cf7sw-success-message {
    text-align: center;
    padding: 24px 20px;
}

.cf7sw-success-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 12px;
    background: rgba(var(--cf7sw-primary-rgb), 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: cf7sw-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cf7sw-success-icon svg {
    width: 30px;
    height: 30px;
    stroke: var(--cf7sw-primary);
    stroke-width: 3;
    fill: none;
}

.cf7sw-success-message h3 {
    font-size: 1.1rem;
    margin: 0 0 6px;
    color: var(--cf7sw-text);
}

.cf7sw-success-message p {
    font-size: 1rem;
    color: var(--cf7sw-text-light);
    margin: 0;
    line-height: 1.5;
}

@keyframes cf7sw-pop {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

/* ============================================
   Responsive - MOBILE OPTIMIZED
   ============================================ */
@media (max-width: 600px) {
    .cf7sw-progress-container {
        padding: 12px 16px 10px;
    }
    
    .cf7sw-step-circle {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .cf7sw-step-check svg {
        width: 14px;
        height: 14px;
    }
    
    .cf7sw-progress-bar::before,
    .cf7sw-progress-fill {
        top: 15px;
        height: 2px;
    }
    
    .cf7sw-step-title {
        font-size: 0.6rem;
        max-width: 60px;
    }
    
    /* Hide titles on mobile except active */
    .cf7sw-step-item:not(.cf7sw-active) .cf7sw-step-title {
        display: none;
    }
    
    .cf7sw-step-panel {
        padding: 14px 16px;
    }
    
    .cf7sw-navigation {
        flex-direction: column-reverse;
        gap: 10px;
    }
    
    .cf7sw-btn {
        width: 100%;
        padding: 12px;
    }
    
    .cf7sw-btn-prev:disabled {
        display: none;
    }
}

/* ============================================
   Utilities
   ============================================ */
.cf7sw-step-marker {
    display: none !important;
}

/* SECURITY: Honeypot field - must be invisible to humans */
input[name="cf7sw_website_url"],
#cf7sw_hp_field {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.cf7sw-wizard-container .wpcf7-submit {
    display: none !important;
}

/* Shake animation */
.cf7sw-shake {
    animation: cf7sw-shake 0.4s ease;
}

@keyframes cf7sw-shake {
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

/* Accessibility */
.cf7sw-btn:focus,
.cf7sw-step-item.cf7sw-completed:focus {
    outline: 2px solid var(--cf7sw-primary);
    outline-offset: 2px;
}

/* Safari iOS Active State */
.cf7sw-btn:active {
    transform: scale(0.97);
}

/* iOS Safari specific fixes - CRITICAL for click events */
@supports (-webkit-touch-callout: none) {
    .cf7sw-btn,
    .cf7sw-btn-next,
    .cf7sw-btn-prev,
    .cf7sw-btn-submit {
        cursor: pointer !important;
        -webkit-appearance: none !important;
        appearance: none !important;
    }
    
    .cf7sw-wizard-wrapper,
    .cf7sw-navigation {
        cursor: pointer;
    }
}

/* Ensure buttons are always clickable */
.cf7sw-btn,
.cf7sw-btn-next,
.cf7sw-btn-prev,
.cf7sw-btn-submit {
    cursor: pointer;
    position: relative;
    z-index: 10;
}

.cf7sw-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ============================================
   LOADING SPINNER STYLES
   ============================================ */

/* Submit button loading state */
.cf7sw-btn-submit.cf7sw-submitting {
    pointer-events: none;
    opacity: 0.85;
}

.cf7sw-btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cf7sw-btn-loading span {
    font-size: 0.9rem;
}

/* Spinner animation (uses cf7sw-spin defined above) */
.cf7sw-spinner {
    width: 20px;
    height: 20px;
    animation: cf7sw-spin 1s linear infinite;
}

/* Error highlighting on invalid fields */
.cf7sw-step-panel .wpcf7-not-valid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15) !important;
}

.cf7sw-step-panel .wpcf7-not-valid-tip {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 4px;
    display: block;
}

/* Step indicator pulse animation for error step */
.cf7sw-step-item.cf7sw-has-error .cf7sw-step-circle {
    animation: cf7sw-error-pulse 1.5s ease-in-out infinite;
}

@keyframes cf7sw-error-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(220, 53, 69, 0);
    }
}

/* ============================================
   DIVI BUILDER COMPATIBILITY
   Prevents style conflicts with Divi theme
   ============================================ */

/* Reset Divi button styles inside wizard */
.et_pb_section .cf7sw-wizard-wrapper .cf7sw-btn,
.et_pb_module .cf7sw-wizard-wrapper .cf7sw-btn,
.et_pb_row .cf7sw-wizard-wrapper .cf7sw-btn,
.et-db #et-boc .cf7sw-wizard-wrapper .cf7sw-btn,
.et_divi_builder .cf7sw-wizard-wrapper .cf7sw-btn {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    line-height: 1.5 !important;
    border-radius: 6px !important;
}

/* Override Divi's default input styles */
.et_pb_section .cf7sw-wizard-wrapper input[type="text"],
.et_pb_section .cf7sw-wizard-wrapper input[type="email"],
.et_pb_section .cf7sw-wizard-wrapper input[type="tel"],
.et_pb_section .cf7sw-wizard-wrapper input[type="url"],
.et_pb_section .cf7sw-wizard-wrapper input[type="number"],
.et_pb_section .cf7sw-wizard-wrapper input[type="date"],
.et_pb_section .cf7sw-wizard-wrapper textarea,
.et_pb_section .cf7sw-wizard-wrapper select,
.et_pb_module .cf7sw-wizard-wrapper input[type="text"],
.et_pb_module .cf7sw-wizard-wrapper input[type="email"],
.et_pb_module .cf7sw-wizard-wrapper input[type="tel"],
.et_pb_module .cf7sw-wizard-wrapper input[type="url"],
.et_pb_module .cf7sw-wizard-wrapper input[type="number"],
.et_pb_module .cf7sw-wizard-wrapper input[type="date"],
.et_pb_module .cf7sw-wizard-wrapper textarea,
.et_pb_module .cf7sw-wizard-wrapper select {
    width: 100% !important;
    padding: 10px 12px !important;
    font-size: 0.9rem !important;
    border: 1px solid var(--cf7sw-border) !important;
    border-radius: 6px !important;
    background: var(--cf7sw-white) !important;
    color: var(--cf7sw-text) !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

/* Preserve native checkbox and radio appearance in Divi */
.et_pb_section .cf7sw-wizard-wrapper input[type="checkbox"],
.et_pb_section .cf7sw-wizard-wrapper input[type="radio"],
.et_pb_module .cf7sw-wizard-wrapper input[type="checkbox"],
.et_pb_module .cf7sw-wizard-wrapper input[type="radio"] {
    width: auto !important;
    padding: 0 !important;
    border: revert !important;
    border-radius: revert !important;
    background: revert !important;
    box-shadow: revert !important;
    -webkit-appearance: checkbox !important;
    appearance: checkbox !important;
}

/* Divi focus states */
.et_pb_section .cf7sw-wizard-wrapper input:focus,
.et_pb_section .cf7sw-wizard-wrapper textarea:focus,
.et_pb_section .cf7sw-wizard-wrapper select:focus {
    outline: none !important;
    border-color: var(--cf7sw-primary) !important;
    box-shadow: 0 0 0 2px rgba(var(--cf7sw-primary-rgb), 0.15) !important;
}

/* Divi button hover override */
.et_pb_section .cf7sw-btn-next:hover,
.et_pb_section .cf7sw-btn-submit:hover,
.et_pb_module .cf7sw-btn-next:hover,
.et_pb_module .cf7sw-btn-submit:hover {
    background: var(--cf7sw-primary-dark) !important;
    opacity: 1 !important;
}

/* Fix Divi's z-index conflicts */
.et_pb_section .cf7sw-wizard-wrapper {
    position: relative;
    z-index: 10;
}

.et_pb_section .cf7sw-progress-container {
    z-index: 11;
}

/* Divi tabs/toggles: ensure form shows correctly when revealed */
.et_pb_tab .cf7sw-wizard-wrapper,
.et_pb_toggle_content .cf7sw-wizard-wrapper,
.et_pb_accordion_content .cf7sw-wizard-wrapper {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

/* Divi Visual Builder: ensure visibility in editor */
.et-fb-root-ancestor .cf7sw-wizard-wrapper,
.et-db #et-boc .cf7sw-wizard-wrapper {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Fix Divi animations interfering with wizard animations */
.et_pb_section .cf7sw-step-panel {
    animation-delay: 0s !important;
}

.et_pb_section .cf7sw-step-panel.cf7sw-active {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Ensure progress bar is visible in Divi */
.et_pb_section .cf7sw-progress-fill,
.et_pb_module .cf7sw-progress-fill {
    transition: width 0.4s ease !important;
}

/* Divi overlay/modal compatibility */
.et_pb_section .cf7sw-success-message,
.diviOverlay .cf7sw-success-message,
.et_pb_modal .cf7sw-success-message {
    text-align: center !important;
    padding: 24px 20px !important;
}

/* Fix label styles in Divi */
.et_pb_section .cf7sw-step-panel label,
.et_pb_module .cf7sw-step-panel label {
    display: block !important;
    font-weight: 500 !important;
    color: var(--cf7sw-text) !important;
    margin-bottom: 4px !important;
    font-size: 0.8rem !important;
}

/* Prevent Divi from adding bottom margins to form elements */
.et_pb_section .cf7sw-step-panel p,
.et_pb_module .cf7sw-step-panel p {
    margin-bottom: 10px !important;
    padding-bottom: 0 !important;
}

/* Divi responsive fixes */
@media (max-width: 980px) {
    .et_pb_section .cf7sw-navigation {
        flex-direction: column-reverse !important;
        gap: 10px !important;
    }
    
    .et_pb_section .cf7sw-btn {
        width: 100% !important;
    }
}

@media (max-width: 767px) {
    .et_pb_section .cf7sw-step-title {
        font-size: 0.6rem !important;
    }
    
    .et_pb_section .cf7sw-step-circle {
        width: 32px !important;
        height: 32px !important;
    }
}
