/* CF7 Multi-Step Enhanced Styles */
.cf7ms-wrapper {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Step Navigation */
.cf7ms-steps-nav {
    display: flex;
    margin-bottom: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0.5rem;
    gap: 0.25rem;
}

.cf7ms-steps-nav button {
    flex: 1;
    padding: 1.2rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
    color: #6c757d;
    font-weight: 500;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cf7ms-steps-nav button:hover {
    background: rgba(139, 30, 30, 0.1);
    color: #8b1e1e;
    transform: translateY(-1px);
}

.cf7ms-steps-nav button.active {
    background: #8b1e1e;
    color: #fff;
    box-shadow: 0 2px 8px rgba(139, 30, 30, 0.3);
}

.cf7ms-steps-nav button.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.2) 0%, transparent 100%);
}

/* Step Content */
.cf7ms-step {
    display: none;
    animation: fadeOut 0.3s ease;
}

.cf7ms-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(-20px); }
}

/* Form Elements */
.cf7ms-step input[type="text"],
.cf7ms-step input[type="email"],
.cf7ms-step input[type="tel"],
.cf7ms-step input[type="url"],
.cf7ms-step input[type="number"],
.cf7ms-step input[type="date"],
.cf7ms-step select,
.cf7ms-step textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    background: #fff;
    box-sizing: border-box;
}

.cf7ms-step input:focus,
.cf7ms-step select:focus,
.cf7ms-step textarea:focus {
    outline: none;
    border-color: #8b1e1e;
    box-shadow: 0 0 0 3px rgba(139, 30, 30, 0.1);
    transform: translateY(-1px);
}

.cf7ms-step label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #343a40;
    font-size: 0.95rem;
}

/* Navigation Buttons */
.cf7ms-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

.cf7ms-buttons button {
    background: #8b1e1e;
    color: #fff;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cf7ms-buttons button:hover {
    background: #721818;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 30, 30, 0.3);
}

.cf7ms-buttons button:active {
    transform: translateY(0);
}

.cf7ms-buttons .cf7ms-prev {
    background: #6c757d;
}

.cf7ms-buttons .cf7ms-prev:hover {
    background: #5a6268;
}

/* Submit Button */
.cf7ms-step input[type="submit"] {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #fff;
    border: none;
    padding: 1.2rem 3rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.cf7ms-step input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

/* Progress Indicator */
.cf7ms-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #8b1e1e 0%, #a02626 100%);
    border-radius: 4px 4px 0 0;
    transition: width 0.5s ease;
    width: 0%;
}

/* Progress Bar Animation - Updated via JavaScript */
.cf7ms-wrapper[data-progress="0"]::before { width: 0%; }
.cf7ms-wrapper[data-progress="1"]::before { width: 33.33%; }
.cf7ms-wrapper[data-progress="2"]::before { width: 66.67%; }
.cf7ms-wrapper[data-progress="3"]::before { width: 100%; }

/* Responsive Design */
@media (max-width: 768px) {
    .cf7ms-wrapper {
        margin: 1rem;
        padding: 1.5rem;
        border-radius: 8px;
    }
    
    .cf7ms-steps-nav {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .cf7ms-steps-nav button {
        padding: 0.875rem;
        text-align: center;
    }
    
    .cf7ms-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    .cf7ms-buttons button {
        width: 100%;
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .cf7ms-wrapper {
        margin: 0.5rem;
        padding: 1rem;
    }
    
    .cf7ms-steps-nav button {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}

/* Error States */
.cf7ms-step .wpcf7-not-valid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

.cf7ms-step .wpcf7-validation-errors {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

/* Success States */
.cf7ms-step .wpcf7-mail-sent-ok {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

/* Loading State */
.cf7ms-wrapper.loading {
    pointer-events: none;
    opacity: 0.7;
}

.cf7ms-wrapper.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #8b1e1e;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Custom Checkbox and Radio Styles */
.cf7ms-step input[type="checkbox"],
.cf7ms-step input[type="radio"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #e9ecef;
    border-radius: 4px;
    display: inline-block;
    position: relative;
    vertical-align: middle;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cf7ms-step input[type="radio"] {
    border-radius: 50%;
}

.cf7ms-step input[type="checkbox"]:checked,
.cf7ms-step input[type="radio"]:checked {
    background: #8b1e1e;
    border-color: #8b1e1e;
}

.cf7ms-step input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 3px;
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.cf7ms-step input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
}

/* Dynamic Search Box Fixes */
.cf7ms-step .awesomplete {
    width: 100% !important;
    display: block !important;
}

.cf7ms-step .awesomplete input {
    width: 100% !important;
    font-size: 1.1rem !important;
    padding: 0.875rem 1rem !important;
    border: 2px solid #e9ecef !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    transition: all 0.3s ease !important;
}

.cf7ms-step .awesomplete input:focus {
    outline: none !important;
    border-color: #8b1e1e !important;
    box-shadow: 0 0 0 3px rgba(139, 30, 30, 0.1) !important;
    transform: translateY(-1px) !important;
}

.cf7ms-step .awesomplete ul {
    border: 2px solid #8b1e1e !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    margin-top: 4px !important;
    font-size: 1.1rem !important;
}

.cf7ms-step .awesomplete li {
    padding: 0.75rem 1rem !important;
    border-bottom: 1px solid #e9ecef !important;
}

.cf7ms-step .awesomplete li:hover,
.cf7ms-step .awesomplete li[aria-selected="true"] {
    background: rgba(139, 30, 30, 0.1) !important;
    color: #8b1e1e !important;
}

/* Prevent text/element resizing on focus for all dynamic elements */
.cf7ms-step .awesomplete,
.cf7ms-step .awesomplete *,
.cf7ms-step input,
.cf7ms-step select,
.cf7ms-step textarea {
    -webkit-text-size-adjust: 100% !important;
    -moz-text-size-adjust: 100% !important;
    -ms-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
}