/**
 * Freight Quote Form v2 - Styles
 * Multi-step form with enhanced UX
 */

:root {
    --fqf-brand-green: #7AB51D;
    --fqf-brand-blue: #3e73bc; /* Updated to requested color */
    --fqf-error: #D13B3B;
    --fqf-text: #1F2937;
    --fqf-text-secondary: #6B7280;
    --fqf-bg: #F8FAFC;
    --fqf-border: #E5E7EB;
    --fqf-radius: 12px;
    --fqf-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    --fqf-input-height: 48px;
}

/* Box sizing reset for all form elements */
.fqf-v2-wrapper *,
.fqf-v2-wrapper *::before,
.fqf-v2-wrapper *::after {
    box-sizing: border-box;
}

/* Container */
.fqf-v2-wrapper {
    max-width: 640px;
    margin: 0 auto;
    padding: clamp(16px, 3vw, 24px);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--fqf-text);
    position: relative;
}

/* Sidebar widget specific styles */
.widget .fqf-v2-wrapper,
.widget-area .fqf-v2-wrapper,
#secondary .fqf-v2-wrapper {
    max-width: 100%;
    padding: 0;
    margin: 0;
    background: white;
    border-radius: var(--fqf-radius);
    overflow: hidden;
}

/* Remove individual backgrounds and shadows in sidebar */
.widget .fqf-header,
.widget-area .fqf-header,
#secondary .fqf-header {
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    margin-bottom: 0;
    padding: 16px 16px 12px 16px;
    border-bottom: none; /* Remove border */
}

.widget .fqf-form,
.widget-area .fqf-form,
#secondary .fqf-form {
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    border: none;
    margin-top: 0;
    padding: 0 16px 16px 16px;
}

/* Sidebar progress bar adjustments */
.widget .fqf-progress-bar,
.widget-area .fqf-progress-bar,
#secondary .fqf-progress-bar {
    height: auto;
    min-height: 40px;
    margin-bottom: 16px;
    margin-top: 16px;
    padding: 10px 12px;
}

.widget .fqf-progress-inner,
.widget-area .fqf-progress-inner,
#secondary .fqf-progress-inner {
    padding: 0; /* Padding handled by parent */
}

.widget .fqf-progress-text,
.widget-area .fqf-progress-text,
#secondary .fqf-progress-text {
    font-size: 13px;
    line-height: 1.4;
}

.widget .fqf-progress-cta,
.widget-area .fqf-progress-cta,
#secondary .fqf-progress-cta {
    display: none; /* Hide continue button in sidebar */
}

/* Progress Bar - now inside form */
.fqf-progress-bar {
    background: #f8f9fa; /* Slightly darker than default bg for better contrast */
    border-radius: 8px;
    margin-bottom: 24px;
    position: relative;
    height: auto;
    min-height: 48px;
    padding: 12px 16px;
    border: 1px solid var(--fqf-border);
    overflow: visible; /* Allow content to be visible */
    display: flex;
    align-items: center;
    /* Removed max-height and contain to prevent clipping */
}

.fqf-progress-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    /* Padding handled by parent */
}

.fqf-progress-text {
    font-weight: 600;
    color: var(--fqf-text);
    font-size: 14px;
    line-height: 1.5;
    display: block;
    white-space: nowrap;
}

.fqf-progress-cta {
    background: var(--fqf-brand-blue); /* Changed to blue */
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.fqf-progress-cta:hover {
    background: #2d5a9e; /* Darker blue on hover */
    transform: translateY(-1px);
}

/* Completely hide the progress fill that's causing horizontal lines */
.fqf-progress-fill,
#progress-fill,
.fqf-progress-bar .fqf-progress-fill,
.fqf-progress-bar #progress-fill,
[id="progress-fill"],
[class*="progress-fill"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    position: static !important;
    overflow: hidden !important;
}

/* Header */
.fqf-header {
    text-align: center;
    margin-bottom: 24px;
    background: white;
    padding: 24px;
    border-radius: var(--fqf-radius);
    box-shadow: var(--fqf-shadow);
}

/* Sidebar widget header adjustments - removed, now handled above */

/* Date and Boxy row */
.fqf-date-boxy-row {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.fqf-date-boxy-row .fqf-field {
    flex: 1;
    margin-bottom: 0;
}

/* Boxy container */
.fqf-boxy-container {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Sidebar widget boxy adjustments */
.widget .fqf-boxy-container,
.widget-area .fqf-boxy-container,
#secondary .fqf-boxy-container {
    width: 60px;
    height: 60px;
}

.fqf-boxy-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: all 0.3s ease;
}

.fqf-boxy-image.fqf-spin {
    animation: spin 2s linear infinite;
}

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

.fqf-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--fqf-text);
}

.fqf-subcopy {
    font-size: 16px;
    color: var(--fqf-text-secondary);
    margin: 0 0 24px;
    line-height: 1.5;
}

/* Sidebar widget typography adjustments */
.widget .fqf-header h1,
.widget-area .fqf-header h1,
#secondary .fqf-header h1 {
    font-size: 12px; /* Further reduced to fit on one line */
    margin: 0 0 6px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: -0.03em; /* Tighter letter spacing */
    white-space: nowrap; /* Prevent wrapping */
}

.widget .fqf-subcopy,
.widget-area .fqf-subcopy,
#secondary .fqf-subcopy {
    font-size: 14px;
    margin: 0 0 16px;
}

/* Trust Badges */
.fqf-trust-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.fqf-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--fqf-bg);
    border-radius: 8px;
    font-size: 14px;
    color: var(--fqf-text-secondary);
}

/* Sidebar widget badge adjustments */
.widget .fqf-trust-badges,
.widget-area .fqf-trust-badges,
#secondary .fqf-trust-badges {
    gap: 8px;
}

.widget .fqf-badge,
.widget-area .fqf-badge,
#secondary .fqf-badge {
    font-size: 12px;
    padding: 6px 8px;
    flex: 1 1 100%;
    justify-content: center;
}

.fqf-badge svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Form */
.fqf-form {
    background: white;
    position: relative;
    border-radius: var(--fqf-radius);
    padding: 24px;
    box-shadow: var(--fqf-shadow);
    overflow: visible; /* Allow autocomplete dropdowns */
    isolation: isolate; /* Create new stacking context */
}

/* Sidebar widget form adjustments - removed, now handled above */

/* Steps */
.fqf-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.fqf-step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fqf-step-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 24px;
    color: var(--fqf-text);
}

/* Sidebar widget step title adjustments */
.widget .fqf-step-title,
.widget-area .fqf-step-title,
#secondary .fqf-step-title {
    font-size: 16px;
    margin: 0 0 16px;
}

/* Fields */
.fqf-field {
    margin-bottom: 20px;
    min-height: 72px;
    width: 100%;
    box-sizing: border-box;
}

.fqf-field label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--fqf-text);
}

.fqf-input {
    width: 100%;
    box-sizing: border-box;
    height: var(--fqf-input-height);
    padding: 0 16px;
    font-size: 16px;
    border: 1px solid var(--fqf-border);
    border-radius: 8px;
    background: white;
    transition: all 0.2s;
    -webkit-appearance: none;
}

.fqf-input:focus {
    outline: none;
    border-color: var(--fqf-brand-green);
    box-shadow: 0 0 0 3px rgba(122, 181, 29, 0.1);
}

.fqf-input.error {
    border-color: var(--fqf-error);
}

.fqf-textarea {
    min-height: 120px;
    padding: 12px 16px;
    resize: vertical;
    font-family: inherit;
}

.fqf-help-text {
    display: block;
    font-size: 13px;
    color: var(--fqf-text-secondary);
    margin-top: 4px;
}

.fqf-error {
    display: block;
    font-size: 13px;
    color: var(--fqf-error);
    margin-top: 4px;
}

/* Valid tick */
.fqf-valid-tick {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--fqf-brand-green);
    font-size: 20px;
    animation: scaleIn 0.2s ease;
    z-index: 2;
    pointer-events: none; /* Don't interfere with input */
}

/* Position tick relative to input height */
.fqf-input-wrapper .fqf-valid-tick {
    top: 22px; /* Half of typical input height (44px) */
}

.fqf-valid-tick.bounce {
    animation: bounce 0.5s ease;
}

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

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Word counter */
.fqf-word-counter {
    text-align: right;
    font-size: 13px;
    color: var(--fqf-text-secondary);
    margin-top: 4px;
}

.fqf-word-counter.over-limit {
    color: var(--fqf-error);
    font-weight: 600;
}

/* Smart snippets */
.fqf-smart-snippets {
    margin-top: 12px;
    padding: 12px;
    background: var(--fqf-bg);
    border-radius: 8px;
}

.fqf-snippet-label {
    font-size: 13px;
    color: var(--fqf-text-secondary);
    margin: 0 0 8px;
}

.fqf-snippet {
    display: block;
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: white;
    border: 1px solid var(--fqf-border);
    border-radius: 6px;
    text-align: left;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.fqf-snippet:hover {
    border-color: var(--fqf-brand-green);
    background: rgba(122, 181, 29, 0.05);
}

/* Distance chip */
.fqf-distance-chip {
    display: inline-block;
    padding: 8px 16px;
    background: var(--fqf-bg);
    border-radius: 20px;
    font-size: 14px;
    color: var(--fqf-text-secondary);
    margin-top: 12px;
}

/* Checkbox */
.fqf-checkbox-field label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.fqf-checkbox-field input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    cursor: pointer;
}

/* Buttons */
.fqf-btn {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: var(--fqf-input-height);
}

.fqf-btn-primary {
    background: var(--fqf-brand-blue); /* Changed to blue */
    color: white !important; /* Ensure white text */
}

.fqf-btn-primary:hover {
    background: #2d5a9e; /* Darker blue on hover */
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(62, 115, 188, 0.3);
}

/* Sidebar button adjustments */
.widget .fqf-btn,
.widget-area .fqf-btn,
#secondary .fqf-btn {
    width: 100%; /* Full width in sidebar */
    display: block;
    color: white !important; /* Ensure white text on buttons */
}

.widget .fqf-btn-group,
.widget-area .fqf-btn-group,
#secondary .fqf-btn-group {
    margin-top: 16px;
}

.fqf-btn-secondary,
.fqf-back-btn {
    background: #f3f4f6 !important;
    color: #111827 !important;
    border: 1px solid #d1d5db !important;
}

.fqf-btn-secondary:hover,
.fqf-back-btn:hover {
    background: #e5e7eb !important;
    border-color: #9ca3af !important;
    color: #111827 !important;
}

.fqf-btn-lg {
    padding: 16px 32px;
    font-size: 18px;
}

.fqf-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.fqf-btn-group {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.fqf-btn-group .fqf-btn {
    flex: 1;
}

/* Review section */
.fqf-review-section {
    background: var(--fqf-bg);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    overflow: hidden;
    word-wrap: break-word;
}

.fqf-review-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 16px;
    color: var(--fqf-text);
}

.fqf-review-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 16px;
    margin: 0;
}

.fqf-review-list dt {
    font-weight: 500;
    color: var(--fqf-text-secondary);
}

.fqf-review-list dd {
    margin: 0;
    color: var(--fqf-text);
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* Legal text */
.fqf-legal-text {
    font-size: 13px;
    color: var(--fqf-text-secondary);
    text-align: center;
    margin: 16px 0;
}

/* Success state */
.fqf-success-state {
    text-align: center;
    padding: 40px 20px;
}

.fqf-success-state h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 16px 0 8px;
    color: var(--fqf-text);
}

.fqf-success-state p {
    font-size: 16px;
    color: var(--fqf-text-secondary);
    margin: 0 0 24px;
}

.fqf-success-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 300px;
    margin: 0 auto;
}

/* Loading state */
.fqf-loading-state {
    text-align: center;
    padding: 60px 20px;
}

.fqf-loading-state p {
    font-size: 16px;
    color: var(--fqf-text-secondary);
    margin: 16px 0 0;
}

/* Social proof */
.fqf-social-proof {
    margin-top: 24px;
    text-align: center;
}

.fqf-testimonial {
    display: none;
    font-size: 14px;
    color: var(--fqf-text-secondary);
    font-style: italic;
}

.fqf-testimonial.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

/* Resume banner */
.fqf-resume-banner {
    background: var(--fqf-brand-green);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    text-align: center;
}

.fqf-resume-banner a {
    color: white;
    text-decoration: underline;
    font-weight: 600;
}

/* Mobile responsiveness */
@media (max-width: 767px) {
    .fqf-v2-wrapper {
        padding: 16px;
    }
    
    .fqf-header {
        padding: 20px;
    }
    
    .fqf-form {
        padding: 16px;
    }
    
    /* Ensure full width inputs on mobile */
    .fqf-input,
    .fqf-textarea,
    .fqf-field select {
        width: 100% !important;
        box-sizing: border-box !important;
        max-width: 100% !important;
    }
    
    .fqf-field {
        width: 100% !important;
    }
    
    .fqf-input-wrapper {
        width: 100% !important;
        display: block !important;
    }
    
    /* Fix review text overflow on mobile */
    .fqf-review-list {
        font-size: 14px;
        grid-template-columns: minmax(80px, auto) minmax(0, 1fr);
    }
    
    .fqf-review-list dd {
        font-size: 13px;
        word-break: break-all;
    }
    
    /* Stack date and boxy vertically on mobile */
    .fqf-date-boxy-row {
        flex-direction: column;
        align-items: center;
    }
    
    .fqf-date-boxy-row .fqf-field {
        width: 100%;
    }
    
    /* Center boxy on mobile */
    .fqf-boxy-container {
        margin: 0 auto 20px;
    }
    
    .fqf-trust-badges {
        flex-direction: column;
    }
    
    .fqf-badge {
        width: 100%;
        justify-content: center;
    }
    
    .fqf-btn-group {
        flex-direction: column;
    }
    
    .fqf-success-actions {
        width: 100%;
    }
}

/* Contact step field styling */
.fqf-step[data-step="3"] .fqf-field {
    width: 100%;
    margin-bottom: 20px;
    display: block;
}

.fqf-input-wrapper {
    position: relative;
    width: 100%;
    display: block;
}

.fqf-step[data-step="3"] .fqf-input {
    width: 100%;
    box-sizing: border-box;
    padding-right: 40px; /* Make room for checkmark */
}

/* Ensure full width on all devices */
.fqf-step .fqf-input,
.fqf-step .fqf-textarea,
.fqf-step select {
    width: 100%;
    box-sizing: border-box;
}

/* Grid layout for email/phone on desktop - REMOVED to keep full width */
/* Fields stay full width on all screen sizes for better usability */

/* Accessibility */
.fqf-input:focus-visible,
.fqf-btn:focus-visible {
    outline: 2px solid var(--fqf-brand-green);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .fqf-progress-bar,
    .fqf-btn,
    .fqf-social-proof {
        display: none;
    }
}

/* Fix Google Places Autocomplete dropdown visibility */
.pac-container {
    z-index: 99999 !important;
    background: white !important;
    border: 1px solid #ccc !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3) !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.pac-container:after {
    display: none !important;
}

.pac-item {
    padding: 10px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    background: white !important;
}

.pac-item:hover {
    background-color: #f5f5f5 !important;
}

.pac-item-query {
    font-size: 14px !important;
}

/* Ensure autocomplete dropdown appears above other elements */
.fqf-v2-wrapper {
    position: relative;
    overflow: visible !important;
}

/* Removed duplicate overflow properties - handled above in main styles */

.fqf-place-input {
    position: relative;
    z-index: 1;
}

/* Hard-disable any progress "fill" - COMPLETE OVERRIDE */
#fqf-v2-form #progress-fill,
#fqf-v2-form .fqf-progress-fill,
.fqf-progress-fill,
#progress-fill,
[id*="progress-fill"],
[class*="progress-fill"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    position: static !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Tidy progress chip padding/height */
#fqf-v2-form .fqf-progress-bar {
    min-height: 42px;
    padding: 10px 14px;
}

#fqf-v2-form .fqf-progress-text {
    line-height: 1.2;
    white-space: nowrap;
}

/* Remove any horizontal rules that might be causing lines */
#fqf-v2-form hr,
.fqf-v2-wrapper hr,
.fqf-form hr {
    display: none !important;
}
/* Fix: Remove phantom grey lines in V2 form */
.fqf-form-v2 dt,
.fqf-form-v2 dd,
.fqf-review-list dt,
.fqf-review-list dd,
.fqf-review-section dt,
.fqf-review-section dd {
    border: none !important;
    border-top: none !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
    box-shadow: none !important;
    background-image: none !important;
}

/* Remove any borders from review section */
.fqf-review-section,
.fqf-review-section * {
    border-bottom: none !important;
    border-top: none !important;
}

/* Ensure no borders on form groups */
.fqf-form-group {
    border: none !important;
    box-shadow: none !important;
}

/* Remove borders from sidebar specific version */
.widget .fqf-form-v2 dt,
.widget .fqf-form-v2 dd,
.sidebar .fqf-form-v2 dt,
.sidebar .fqf-form-v2 dd {
    border: none !important;
}

/* Additional fixes for theme interference */
.fqf-form-v2 dl,
.fqf-form-v2 dl dt,
.fqf-form-v2 dl dd,
.fqf-review-list,
.fqf-review-list > * {
    outline: none !important;
    text-decoration: none !important;
    border-style: none !important;
}

/* Fix potential ::before and ::after pseudo elements */
.fqf-form-v2 dt::before,
.fqf-form-v2 dt::after,
.fqf-form-v2 dd::before,
.fqf-form-v2 dd::after,
.fqf-review-list dt::before,
.fqf-review-list dt::after,
.fqf-review-list dd::before,
.fqf-review-list dd::after {
    display: none !important;
}

/* Ensure review section has clean background */
.fqf-review-section {
    background-image: none !important;
    background: var(--fqf-bg) !important;
}

/* AGGRESSIVE FIX: Remove ALL grey lines from form elements */
.fqf-form-v2 *,
.fqf-form-v2 *::before,
.fqf-form-v2 *::after {
    border-image: none !important;
    outline: none !important;
}

/* Specifically target textareas and inputs */
.fqf-form-v2 textarea,
.fqf-form-v2 input[type="text"],
.fqf-form-v2 input[type="email"],
.fqf-form-v2 input[type="tel"],
.fqf-form-v2 input[type="date"],
.fqf-form-v2 select {
    border: 1px solid var(--fqf-border) !important;
    border-image: none !important;
    box-shadow: none !important;
    background-image: none !important;
    outline: none !important;
}

/* Remove bottom borders that appear as grey lines */
.fqf-form-v2 .fqf-form-group,
.fqf-form-v2 .fqf-form-group *,
.fqf-form-v2 fieldset,
.fqf-form-v2 fieldset * {
    border-bottom: none !important;
    border-top: none !important;
    border-image: none !important;
    text-decoration: none !important;
}

/* Target the step container specifically */
.fqf-step {
    border: none !important;
    box-shadow: none !important;
    background-image: none !important;
}

/* Remove any HR elements if they exist */
.fqf-form-v2 hr {
    display: none !important;
}

/* Ensure labels don't have underlines */
.fqf-form-v2 label,
.fqf-form-v2 .fqf-label {
    text-decoration: none !important;
    border-bottom: none !important;
}

/* Target sidebar/widget version more aggressively */
.widget .fqf-form-v2 *,
.sidebar .fqf-form-v2 *,
#secondary .fqf-form-v2 * {
    border-image: none !important;
    text-decoration: none !important;
}

/* Remove any fieldset borders */
.fqf-form-v2 fieldset {
    border: 0 !important;
    padding: 0;
    margin: 0;
}

/* Override any theme-specific textarea styles */
body .fqf-form-v2 textarea,
html body .fqf-form-v2 textarea {
    background: var(--fqf-white) !important;
    border: 1px solid var(--fqf-border) !important;
    border-radius: 6px !important;
    box-shadow: none !important;
}

/* Remove lines from parent containers */
.fqf-form-wrapper,
.fqf-form-container,
.fqf-ab-test-wrapper {
    border: none !important;
    box-shadow: none !important;
    background-image: none !important;
}

/* Nuclear option: Remove ALL borders from ALL elements in form */
.fqf-form-v2,
.fqf-form-v2 * {
    border-style: none !important;
}

/* Then re-add ONLY the borders we want */
.fqf-form-v2 textarea,
.fqf-form-v2 input:not([type="submit"]):not([type="button"]),
.fqf-form-v2 select {
    border-style: solid !important;
    border-width: 1px !important;
    border-color: #E5E7EB !important;
}

/* Focus states */
.fqf-form-v2 textarea:focus,
.fqf-form-v2 input:focus,
.fqf-form-v2 select:focus {
    border-color: var(--fqf-primary) !important;
    outline: none !important;
}

/* Ensure step progress has its border */
.fqf-progress {
    border-style: solid !important;
    border-width: 1px !important;
    border-color: var(--fqf-border) !important;
}

/* Fix buttons */
.fqf-btn {
    border-style: none !important;
}

/* COMPREHENSIVE FIX: Remove ALL grey phantom lines from V2 form */
/* Version 4 - Complete override of unwanted borders */

/* First, remove ALL borders from everything */
.fqf-v2-wrapper *,
.fqf-v2-wrapper *::before,
.fqf-v2-wrapper *::after {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Remove any background lines or images */
.fqf-field,
.fqf-input-wrapper,
.fqf-textarea,
.fqf-step {
    background-image: none !important;
}

/* Now add back ONLY the borders we want */
.fqf-form {
    border: 1px solid #E5E7EB !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08) !important;
}

.fqf-input,
.fqf-textarea,
.fqf-field select {
    border: 1px solid #E5E7EB !important;
}

.fqf-input:focus,
.fqf-textarea:focus,
.fqf-field select:focus {
    border-color: #7AB51D !important;
    box-shadow: 0 0 0 3px rgba(122, 181, 29, 0.1) !important;
}

.fqf-progress-bar {
    border: 1px solid #E5E7EB !important;
}

.fqf-btn-secondary,
.fqf-back-btn {
    border: 1px solid #d1d5db !important;
}

.fqf-snippet {
    border: 1px solid #E5E7EB !important;
}

/* Widget/sidebar specific overrides */
.widget .fqf-v2-wrapper,
.widget-area .fqf-v2-wrapper,
#secondary .fqf-v2-wrapper,
aside .fqf-v2-wrapper,
[class*='sidebar'] .fqf-v2-wrapper,
[class*='widget'] .fqf-v2-wrapper {
    border: none !important;
}

.widget .fqf-header,
.widget-area .fqf-header,
#secondary .fqf-header,
aside .fqf-header,
[class*='sidebar'] .fqf-header,
[class*='widget'] .fqf-header {
    border: none !important;
    border-bottom: none !important;
}

/* Remove any divider or separator elements */
.fqf-v2-wrapper hr,
.fqf-v2-wrapper .divider,
.fqf-v2-wrapper .separator,
.fqf-v2-wrapper [class*='divider'],
.fqf-v2-wrapper [class*='separator'] {
    display: none !important;
}

/* Ensure no grey lines under textareas */
#cargo,
textarea.fqf-input,
.fqf-textarea {
    border: 1px solid #E5E7EB !important;
    background: white !important;
}

/* Remove all pseudo-element borders */
.fqf-field::before,
.fqf-field::after,
.fqf-input-wrapper::before,
.fqf-input-wrapper::after {
    display: none !important;
    content: none !important;
}

/* Last resort: force white backgrounds with no borders on field containers */
.fqf-field {
    border: none !important;
    border-bottom: none !important;
    background: transparent !important;
}

/* CSS fix applied: 2025-08-17 */

/* FINAL NUCLEAR OPTION - Target sidebar specifically */
/* Force removal of ALL borders in sidebar contexts */
.widget *,
.widget-area *,
#secondary *,
aside *,
[class*='sidebar'] *,
[class*='widget'] * {
    border-bottom: none !important;
}

/* Then re-add only input borders */
.widget .fqf-input,
.widget .fqf-textarea,
.widget select,
.widget-area .fqf-input,
.widget-area .fqf-textarea,
.widget-area select,
#secondary .fqf-input,
#secondary .fqf-textarea,
#secondary select {
    border: 1px solid #E5E7EB !important;
}

/* Force transparent backgrounds on containers */
.widget .fqf-field,
.widget-area .fqf-field,
#secondary .fqf-field,
.widget .fqf-step,
.widget-area .fqf-step,
#secondary .fqf-step {
    background: transparent !important;
    border: 0 !important;
}

/* Override any inherited styles */
.fqf-v2-wrapper .fqf-field {
    border: 0 !important;
    border-bottom: 0 !important;
    border-top: 0 !important;
}

/* Target the specific step 2 where grey lines appear */
.fqf-step[data-step='2'] .fqf-field {
    border: none !important;
    background: transparent !important;
}

/* Remove borders from labels and help text */
.fqf-field label,
.fqf-help-text,
.fqf-word-counter {
    border: none !important;
    background: transparent !important;
}

/* v4.1 - Fixed 2025-08-17 */

/* Fix for autocomplete dropdown click issues */
.pac-container {
    z-index: 999999 !important;
    position: fixed !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.pac-item {
    cursor: pointer !important;
    pointer-events: auto !important;
    z-index: 999999 !important;
}

.pac-item:hover {
    background-color: #f5f5f5 !important;
}

.pac-item-selected {
    background-color: #e6e6e6 !important;
}

/* Ensure autocomplete is above everything */
.pac-container,
.pac-container * {
    pointer-events: auto !important;
}

/* Fix for widget/sidebar specific issues */
.widget .pac-container,
.widget-area .pac-container,
#secondary .pac-container {
    z-index: 9999999 !important;
    position: fixed !important;
}

/* Remove any overlay that might be blocking */
.fqf-v2-wrapper {
    position: relative;
    z-index: 1;
}

.fqf-form {
    position: relative;
    z-index: 10;
}

.fqf-input {
    position: relative;
    z-index: 100;
}

/* Autocomplete fix v2 */

/* CRITICAL: Override any blocking elements */
.pac-container,
.pac-container *,
.pac-item,
.pac-item * {
    pointer-events: auto !important;
    cursor: pointer !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    position: relative !important;
    z-index: 2147483647 !important; /* Maximum z-index */
}

/* Ensure nothing blocks the autocomplete */
.fqf-v2-wrapper *:not(.pac-container):not(.pac-item) {
    pointer-events: initial !important;
}

/* Remove any overlays */
.fqf-v2-wrapper::before,
.fqf-v2-wrapper::after,
.fqf-form::before,
.fqf-form::after {
    pointer-events: none !important;
    z-index: -1 !important;
}

/* Fix for WordPress admin bar interference */
body.admin-bar .pac-container {
    margin-top: 0 !important;
}

/* Ensure autocomplete is always on top in sidebar */
.widget .pac-container {
    position: fixed !important;
    z-index: 2147483647 !important;
}

/* ================================================
   CLEAN OVERRIDES - Remove phantom lines
   ================================================ */

/* Remove borders from field containers */
.fqf-field,
.fqf-step,
.fqf-input-wrapper {
    border: none !important;
    border-bottom: none !important;
    background-image: none !important;
}

/* Ensure inputs keep their borders */
.fqf-input,
.fqf-textarea,
select {
    border: 1px solid #E5E7EB !important;
}

.fqf-input:focus,
.fqf-textarea:focus,
select:focus {
    border-color: #7AB51D !important;
}

/* Remove any horizontal dividers */
.fqf-v2-wrapper hr {
    display: none !important;
}

/* Force autocomplete dropdown visibility */
.pac-container {
    z-index: 999999 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: absolute !important;
    background: white !important;
    border: 1px solid #ccc !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3) !important;
}

.pac-container:empty {
    display: none !important;
}

/* Fix autocomplete click handling */
.pac-container {
    pointer-events: auto !important;
}

.pac-item {
    cursor: pointer !important;
    padding: 10px !important;
    pointer-events: auto !important;
}

.pac-item:hover {
    background-color: #f5f5f5 !important;
}

.pac-item-selected {
    background-color: #e6e6e6 !important;
}

/* Force hide autocomplete after selection */
.pac-container.hdpi:after {
    display: none !important;
}

body.place-selected .pac-container {
    display: none !important;
    visibility: hidden !important;
}

