/* BonavistaWP Contact Form Styles - Consistent with Spaciaz Theme */

/* Inherit Elementor Global Variables if available, else fallback */
:root {
    --bv-primary: var(--e-global-color-primary, #1D2227);
    --bv-secondary: var(--e-global-color-secondary, #C8102E);
    --bv-text: var(--e-global-color-text, #646D75);
    --bv-bg: var(--e-global-color-2d3614a, #FFFFFF);
    --bv-border: #e2e8f0;
    --bv-font-primary: var(--e-global-typography-primary-font-family, 'Manrope', sans-serif);
    --bv-font-heading: var(--e-global-typography-secondary-font-family, 'Montserrat', sans-serif);
}

.bv-contact-form-wrapper {
    max-width: 800px;
    margin: 0 auto;
    font-family: var(--bv-font-primary) !important;
    color: var(--bv-text) !important;
    position: relative;
}

/* Reset theme interference */
.bv-contact-form-wrapper * {
    font-family: inherit;
}

.bv-contact-form-container {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.bv-contact-form-container.submitting {
    opacity: 0.6;
    pointer-events: none;
}

/* Form Sections */
.bv-form-section {
    margin-bottom: 30px;
}

.bv-form-section:last-child {
    margin-bottom: 0;
}

/* Labels */
.bv-form-label {
    display: block;
    font-family: var(--bv-font-heading) !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    color: var(--bv-primary) !important;
    margin-bottom: 10px !important;
    line-height: 1.4 !important;
}

.bv-section-title {
    font-size: 1.1rem !important;
    margin-bottom: 16px !important;
}

.bv-required {
    color: var(--bv-secondary) !important;
}

/* Radio Button Cards */
.bv-radio-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

.bv-radio-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.bv-radio-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 20px;
    background: #fff;
    border: 2px solid var(--bv-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
}

.bv-radio-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--bv-secondary) 0%, #a00e26 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.bv-radio-card:hover {
    border-color: var(--bv-secondary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(200, 16, 46, 0.15);
}

.bv-radio-input:checked + .bv-radio-card {
    border-color: var(--bv-secondary);
    background: var(--bv-secondary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(200, 16, 46, 0.25);
}

.bv-radio-input:checked + .bv-radio-card::before {
    opacity: 1;
}

.bv-radio-card-icon {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.bv-radio-input:checked + .bv-radio-card .bv-radio-card-icon {
    background: rgba(255, 255, 255, 0.2);
}

.bv-radio-card-icon svg {
    stroke: var(--bv-primary);
    fill: none !important;
    transition: stroke 0.3s ease;
}

.bv-radio-input:checked + .bv-radio-card .bv-radio-card-icon svg {
    stroke: #fff;
    fill: none !important;
}

.bv-radio-card-content {
    position: relative;
    z-index: 1;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bv-radio-card-title {
    font-family: var(--bv-font-heading) !important;
    font-weight: 600 !important;
    font-size: 1.05rem !important;
    color: var(--bv-primary);
    line-height: 1.3 !important;
    transition: color 0.3s ease;
}

.bv-radio-input:checked + .bv-radio-card .bv-radio-card-title {
    color: #fff;
}

.bv-radio-card-desc {
    font-size: 0.85rem;
    color: var(--bv-text);
    line-height: 1.4;
    transition: color 0.3s ease;
}

.bv-radio-input:checked + .bv-radio-card .bv-radio-card-desc {
    color: rgba(255, 255, 255, 0.9);
}

.bv-radio-card-check {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 2px solid var(--bv-border);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.bv-radio-card-check svg {
    stroke: #fff;
    fill: none !important;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.bv-radio-input:checked + .bv-radio-card .bv-radio-card-check {
    background: #fff;
    border-color: #fff;
}

.bv-radio-input:checked + .bv-radio-card .bv-radio-card-check svg {
    stroke: var(--bv-secondary);
    opacity: 1;
    transform: scale(1);
}

/* Compact Radio Buttons (for follow-up preference) */
.bv-radio-buttons {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.bv-radio-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    background: #fff;
    border: 2px solid var(--bv-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--bv-primary);
}

.bv-radio-btn:hover:not(.disabled) {
    border-color: var(--bv-primary);
    background: #f8fafc;
}

.bv-radio-input:checked + .bv-radio-btn {
    border-color: var(--bv-secondary);
    background: var(--bv-secondary);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(200, 16, 46, 0.25);
}

.bv-radio-btn-icon {
    stroke: currentColor;
    fill: none !important;
    flex-shrink: 0;
}

.bv-radio-input:disabled + .bv-radio-btn {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Input Fields */
.bv-input,
.bv-form-select,
.bv-textarea {
    width: 100%;
    padding: 14px 20px;
    font-size: 1rem !important;
    border: 1px solid var(--bv-border);
    border-radius: 8px;
    outline: none;
    transition: all 0.2s ease;
    font-family: var(--bv-font-primary) !important;
    color: var(--bv-primary) !important;
    background-color: #fff;
    box-sizing: border-box;
}

/* Input with Icon */
.bv-input-with-icon {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.bv-input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    stroke: var(--bv-text);
    fill: none !important;
    pointer-events: none;
    z-index: 1;
    opacity: 0.6;
}

.bv-input-with-left-icon {
    padding-left: 48px !important;
}

.bv-input-with-icon .bv-input {
    width: 100%;
    padding-right: 45px;
}

.bv-validation-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    z-index: 2;
}

.bv-validation-icon svg {
    position: absolute;
    display: none;
}

.bv-validation-icon.invalid .bv-icon-invalid {
    display: block;
    animation: bv-shake 0.4s ease;
}

@keyframes bv-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Validation Messages */
.bv-validation-message {
    margin-top: 8px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1.4;
    animation: bv-slideDown 0.3s ease;
}

@keyframes bv-slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bv-validation-message.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.bv-validation-message.warning {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.bv-validation-message.success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    display: none !important; /* Hide success messages */
}

.bv-validation-message.suggestion {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.bv-validation-message.suggestion:hover {
    background-color: #fde68a;
}

.bv-validation-message strong {
    font-weight: 600;
}

/* Input States */
.bv-input.validating {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

.bv-input.valid {
    border-color: #22c55e;
    background-color: #f0fdf4;
}

.bv-input.invalid {
    border-color: #ef4444;
    background-color: #fef2f2;
}

/* Contact field animations */
.bv-contact-field {
    animation: bv-slideDown 0.3s ease;
}

.bv-input:focus,
.bv-form-select:focus,
.bv-textarea:focus {
    border-color: var(--bv-primary);
    box-shadow: 0 0 0 3px rgba(29, 34, 39, 0.1);
}

.bv-input:disabled,
.bv-textarea:disabled {
    background-color: #f8fafc;
    color: #94a3b8 !important;
    cursor: not-allowed;
    opacity: 0.6;
}

.bv-textarea {
    resize: vertical;
    min-height: 150px;
    line-height: 1.6;
}

/* Property Search Dropdown */
.bv-search-container {
    position: relative;
}

.bv-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    background: #fff;
    border: 1px solid var(--bv-border);
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    margin: 5px 0 0 0 !important;
    padding: 5px 0 !important;
    padding-inline-start: 0 !important;
    list-style: none;
}

.bv-option {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.1s;
}

.bv-option:last-child {
    border-bottom: none;
}

.bv-option:hover {
    background-color: #f8fafc;
}

.bv-name {
    font-weight: 600 !important;
    color: var(--bv-primary) !important;
    font-size: 0.95rem !important;
}

.bv-address {
    color: #94a3b8 !important;
    font-size: 0.85rem !important;
}

.bv-dropdown-notice {
    padding: 12px 20px !important;
    cursor: default !important;
    background-color: #f8fafc !important;
    color: var(--bv-text) !important;
    font-size: 0.9rem !important;
    text-align: center !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
}

.bv-dropdown-notice:hover {
    background-color: #f8fafc !important;
}

.bv-dropdown-notice strong {
    font-weight: 600 !important;
    color: var(--bv-primary) !important;
}

/* Selected Property Display */
.bv-selected-property {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background-color: #f8fafc;
    border: 1px solid var(--bv-border);
    border-radius: 8px;
    margin-top: 10px;
}

.bv-selected-property .bv-icon {
    stroke: var(--bv-secondary) !important;
    fill: none !important;
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0 !important;
}

.bv-selected-property span {
    flex-grow: 1;
    font-weight: 600 !important;
    color: var(--bv-primary) !important;
    font-size: 0.95rem !important;
}

.bv-clear-btn {
    padding: 6px 14px;
    background: #fff;
    border: 1px solid var(--bv-border);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--bv-text);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--bv-font-primary) !important;
}

.bv-clear-btn:hover {
    background-color: #f8fafc;
    border-color: var(--bv-primary);
    color: var(--bv-primary);
}

/* Submit Button */
.bv-btn-submit {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 16px 40px !important;
    border-radius: 100px !important;
    background-color: var(--bv-secondary) !important;
    color: #fff !important;
    border: 1px solid var(--bv-secondary) !important;
    font-weight: 600 !important;
    font-size: 1.1rem !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    width: 100% !important;
    cursor: pointer !important;
    line-height: 1.2 !important;
    font-family: var(--bv-font-heading) !important;
    letter-spacing: 0.02em !important;
}

.bv-btn-submit:hover:not(:disabled) {
    background-color: #a00e26 !important;
    border-color: #a00e26 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(200, 16, 46, 0.3);
}

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

.bv-btn-submit .bv-btn-icon {
    stroke: currentColor !important;
    fill: none !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    flex-shrink: 0 !important;
    display: block !important;
    stroke-width: 2 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
}

/* Loading State */
.bv-btn-submit.loading {
    position: relative;
    color: transparent !important;
}

.bv-btn-submit.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: bv-spin 0.8s linear infinite;
}

.bv-btn-submit.loading .bv-btn-icon {
    opacity: 0;
}

@keyframes bv-spin {
    to { transform: rotate(360deg); }
}

/* Status Messages */
.bv-status-message {
    margin-top: 20px;
    padding: 16px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.5;
    animation: bv-fadeIn 0.3s ease;
}

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

.bv-status-message.success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.bv-status-message.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Turnstile Widget */
#bv-turnstile-widget {
    display: flex;
    justify-content: center;
}

/* Success Overlay - Keep for backward compatibility but hide by default */
.bv-success-overlay {
    display: none !important;
}

/* Inline Success Message */
.bv-success-inline {
    text-align: center;
    padding: 60px 40px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: bv-fadeInScale 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bv-fadeInScale {
    from { 
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to { 
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.bv-success-checkmark {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
}

.bv-checkmark {
    width: 80px;
    height: 80px;
    display: block;
}

.bv-checkmark-circle {
    stroke: var(--bv-secondary);
    stroke-width: 2.5;
    stroke-miterlimit: 10;
    fill: none;
    animation: bv-strokeCircle 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

@keyframes bv-strokeCircle {
    0% {
        stroke-dasharray: 0 157;
        stroke-dashoffset: 0;
    }
    100% {
        stroke-dasharray: 157 157;
        stroke-dashoffset: 0;
    }
}

.bv-checkmark-check {
    stroke: var(--bv-secondary);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-miterlimit: 10;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: bv-strokeCheck 0.4s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

@keyframes bv-strokeCheck {
    100% {
        stroke-dashoffset: 0;
    }
}

.bv-success-title {
    font-family: var(--bv-font-heading) !important;
    font-size: 1.75rem !important;
    font-weight: 700 !important;
    color: var(--bv-primary) !important;
    margin: 0 0 15px 0 !important;
    line-height: 1.2 !important;
}

.bv-success-text {
    font-size: 1.05rem;
    color: var(--bv-text);
    line-height: 1.6;
    margin: 0 0 30px 0;
}

.bv-btn-close-success {
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 14px 32px !important;
    border-radius: 100px !important;
    background-color: var(--bv-primary) !important;
    color: #fff !important;
    border: none !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    font-family: var(--bv-font-heading) !important;
}

.bv-btn-close-success:hover {
    background-color: #0f1215 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* Responsive - Tablet */
@media (max-width: 900px) {
    .bv-radio-cards {
        grid-template-columns: 1fr;
    }
}

/* Responsive - Mobile */
@media (max-width: 600px) {
    .bv-contact-form-container {
        padding: 30px 20px;
        border-radius: 8px;
    }
    
    .bv-form-section {
        margin-bottom: 25px;
    }
    
    .bv-form-label {
        font-size: 0.95rem !important;
    }
    
    .bv-section-title {
        font-size: 1rem !important;
    }
    
    .bv-radio-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .bv-radio-card {
        padding: 20px 16px;
    }
    
    .bv-radio-card-icon {
        width: 44px;
        height: 44px;
    }
    
    .bv-radio-card-icon svg {
        width: 28px;
        height: 28px;
    }
    
    .bv-radio-card-title {
        font-size: 1rem !important;
    }
    
    .bv-radio-card-desc {
        font-size: 0.8rem;
    }
    
    .bv-radio-buttons {
        flex-direction: column;
    }
    
    .bv-input,
    .bv-textarea {
        padding: 12px 16px;
        font-size: 0.95rem !important;
    }
    
    .bv-btn-submit {
        padding: 14px 32px !important;
        font-size: 1rem !important;
    }
    
    .bv-selected-property {
        flex-wrap: wrap;
    }
    
    .bv-clear-btn {
        width: 100%;
        margin-top: 8px;
    }
    
    .bv-success-inline {
        padding: 40px 20px;
        min-height: 350px;
    }
    
    .bv-success-title {
        font-size: 1.5rem !important;
    }
    
    .bv-success-text {
        font-size: 1rem;
    }
    
    .bv-checkmark {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 400px) {
    .bv-contact-form-container {
        padding: 25px 15px;
    }
    
    .bv-radio-card {
        padding: 16px 12px;
        gap: 12px;
    }
    
    .bv-option {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .bv-checkmark {
        width: 60px;
        height: 60px;
    }
    
    .bv-success-inline {
        padding: 30px 15px;
        min-height: 300px;
    }
}
