/**
 * Lead Generation Tools Styles
 *
 * CMA Request, Property Alerts, Tour Scheduling, Mortgage Calculator
 * Matches glass-morphism design from Phase 1
 *
 * @package flavor_flavor_flavor
 * @version 1.4.0
 */

/* ==========================================================================
   CSS Custom Properties
   ========================================================================== */

:root {
    --bne-color-primary: #4a60a1;       /* Unified with main theme (was: #1e40af) */
    --bne-color-primary-light: #6b80b8; /* Unified with main theme (was: #3b82f6) */
    --bne-color-secondary: #475569;
    --bne-color-accent: #0ea5e9;
    --bne-color-success: #10b981;
    --bne-color-warning: #f59e0b;
    --bne-color-error: #ef4444;
    --bne-color-info: #6366f1;
    --bne-glass-bg: rgba(255, 255, 255, 0.95);
    --bne-glass-border: rgba(255, 255, 255, 0.3);
    --bne-shadow-soft: 0 4px 30px rgba(0, 0, 0, 0.08);
    --bne-shadow-hover: 0 8px 40px rgba(0, 0, 0, 0.12);
    --bne-radius: 16px;
    --bne-radius-sm: 8px;
    --bne-transition: all 0.3s ease;
}

/* ==========================================================================
   Lead Section Base
   ========================================================================== */

.bne-lead-section {
    padding: 80px 0;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.bne-lead-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.bne-lead-section .section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.bne-lead-section .section-header {
    text-align: center;
    margin-bottom: 48px;
}

.bne-lead-section .section-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 16px;
    line-height: 1.2;
}

.bne-lead-section .section-subtitle {
    font-size: 1.125rem;
    color: #64748b;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ==========================================================================
   Glass Card Container
   ========================================================================== */

.bne-glass-card {
    background: var(--bne-glass-bg);
    border: 1px solid var(--bne-glass-border);
    border-radius: var(--bne-radius);
    box-shadow: var(--bne-shadow-soft);
    backdrop-filter: blur(10px);
    padding: 32px;
    transition: var(--bne-transition);
}

.bne-glass-card:hover {
    box-shadow: var(--bne-shadow-hover);
}

/* ==========================================================================
   Form Base Styles
   ========================================================================== */

.bne-lead-form {
    max-width: 600px;
    margin: 0 auto;
}

.bne-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.bne-form-row.single {
    grid-template-columns: 1fr;
}

@media (max-width: 600px) {
    .bne-form-row {
        grid-template-columns: 1fr;
    }
}

.bne-form-group {
    margin-bottom: 20px;
}

.bne-form-group label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
    font-size: 0.9375rem;
}

.bne-form-group label .required {
    color: var(--bne-color-error);
    margin-left: 2px;
}

.bne-form-group input,
.bne-form-group select,
.bne-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: var(--bne-radius-sm);
    background: #fff;
    transition: var(--bne-transition);
    font-family: inherit;
}

.bne-form-group input:focus,
.bne-form-group select:focus,
.bne-form-group textarea:focus {
    outline: none;
    border-color: var(--bne-color-primary-light);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.bne-form-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* Floating Labels */
.bne-float-label {
    position: relative;
}

.bne-float-label label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    padding: 0 4px;
    color: #94a3b8;
    pointer-events: none;
    transition: var(--bne-transition);
    font-weight: 400;
    margin-bottom: 0;
}

.bne-float-label textarea + label {
    top: 24px;
}

.bne-float-label.focused label,
.bne-float-label.has-value label {
    top: 0;
    font-size: 0.75rem;
    color: var(--bne-color-primary);
    font-weight: 500;
}

/* Honeypot field - hidden */
.bne-hp-field {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

/* ==========================================================================
   Submit Button
   ========================================================================== */

.bne-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 32px;
    font-size: 1.0625rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--bne-color-primary), var(--bne-color-primary-light));
    border: none;
    border-radius: var(--bne-radius-sm);
    cursor: pointer;
    transition: var(--bne-transition);
    text-transform: none;
    letter-spacing: 0;
}

.bne-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 64, 175, 0.3);
}

.bne-submit-btn:active {
    transform: translateY(0);
}

.bne-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.bne-submit-btn svg {
    width: 20px;
    height: 20px;
}

/* ==========================================================================
   Form Feedback
   ========================================================================== */

.bne-form-feedback {
    margin-top: 16px;
    padding: 14px 18px;
    border-radius: var(--bne-radius-sm);
    font-size: 0.9375rem;
    display: none;
}

.bne-form-feedback.success,
.bne-form-feedback.error {
    display: block;
}

.bne-form-feedback.success {
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.bne-form-feedback.error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ==========================================================================
   Property Type Selector (CMA Form)
   ========================================================================== */

.bne-property-types {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

@media (max-width: 600px) {
    .bne-property-types {
        grid-template-columns: repeat(2, 1fr);
    }
}

.bne-property-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: var(--bne-radius-sm);
    cursor: pointer;
    transition: var(--bne-transition);
    font-size: 0.8125rem;
    color: #64748b;
}

.bne-property-type-btn:hover {
    border-color: var(--bne-color-primary-light);
    background: #eff6ff;
}

.bne-property-type-btn.active {
    border-color: var(--bne-color-primary);
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.05), rgba(59, 130, 246, 0.1));
    color: var(--bne-color-primary);
}

.bne-property-type-btn svg {
    width: 28px;
    height: 28px;
    stroke-width: 1.5;
}

/* ==========================================================================
   City Tags (Property Alerts)
   ========================================================================== */

.bne-city-input-wrapper {
    position: relative;
}

.bne-city-input {
    padding-right: 40px !important;
}

.bne-city-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.bne-city-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--bne-color-primary), var(--bne-color-primary-light));
    color: #fff;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.bne-tag-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    line-height: 1;
    transition: var(--bne-transition);
}

.bne-tag-remove:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* ==========================================================================
   Price Range Slider (Property Alerts)
   ========================================================================== */

.bne-price-range {
    padding: 20px 0;
}

.bne-range-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-weight: 500;
}

.bne-min-price-display,
.bne-max-price-display {
    color: var(--bne-color-primary);
    font-size: 1.125rem;
}

.bne-range-track {
    display: flex;
    gap: 20px;
    align-items: center;
}

.bne-range-track input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    outline: none;
}

.bne-range-track input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--bne-color-primary), var(--bne-color-primary-light));
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.3);
    transition: var(--bne-transition);
}

.bne-range-track input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

/* ==========================================================================
   Tour Type Cards (Schedule Showing)
   ========================================================================== */

.bne-tour-types {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 600px) {
    .bne-tour-types {
        grid-template-columns: 1fr;
    }
}

.bne-tour-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 16px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: var(--bne-radius);
    cursor: pointer;
    transition: var(--bne-transition);
    text-align: center;
}

.bne-tour-type-card:hover {
    border-color: var(--bne-color-primary-light);
    background: #eff6ff;
}

.bne-tour-type-card.selected {
    border-color: var(--bne-color-primary);
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.05), rgba(59, 130, 246, 0.1));
}

.bne-tour-type-card .icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bne-color-primary), var(--bne-color-primary-light));
    border-radius: 50%;
    color: #fff;
}

.bne-tour-type-card .icon svg {
    width: 24px;
    height: 24px;
}

.bne-tour-type-card h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.bne-tour-type-card p {
    font-size: 0.8125rem;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}

/* Time Slots */
.bne-time-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.bne-time-slot {
    padding: 10px 16px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: var(--bne-transition);
}

.bne-time-slot:hover {
    border-color: var(--bne-color-primary-light);
}

.bne-time-slot.selected {
    border-color: var(--bne-color-primary);
    background: var(--bne-color-primary);
    color: #fff;
}

/* ==========================================================================
   Mortgage Calculator
   ========================================================================== */

.bne-mortgage-calculator {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

@media (max-width: 900px) {
    .bne-mortgage-calculator {
        grid-template-columns: 1fr;
    }
}

.bne-calc-inputs {
    padding-right: 20px;
}

.bne-calc-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Calculator Input Styles */
.bne-calc-group {
    margin-bottom: 24px;
}

.bne-calc-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    color: #374151;
    margin-bottom: 10px;
}

.bne-calc-group .value-display {
    color: var(--bne-color-primary);
    font-weight: 600;
}

.bne-calc-input-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.bne-calc-input-row input {
    flex: 1;
}

.bne-currency-input {
    position: relative;
}

.bne-currency-input::before {
    content: '$';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-weight: 500;
}

.bne-currency-input input {
    padding-left: 28px;
}

.bne-percent-input {
    position: relative;
}

.bne-percent-input::after {
    content: '%';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-weight: 500;
}

.bne-percent-input input {
    padding-right: 36px;
}

/* Loan Term Buttons */
.bne-term-buttons {
    display: flex;
    gap: 12px;
}

.bne-term-btn {
    flex: 1;
    padding: 12px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: var(--bne-radius-sm);
    font-size: 0.9375rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: var(--bne-transition);
}

.bne-term-btn:hover {
    border-color: var(--bne-color-primary-light);
}

.bne-term-btn.active {
    background: var(--bne-color-primary);
    border-color: var(--bne-color-primary);
    color: #fff;
}

/* Down Payment Slider */
.bne-down-payment-slider {
    width: 100%;
    margin-top: 12px;
}

/* Payment Results Display */
.bne-payment-display {
    text-align: center;
    margin-bottom: 32px;
}

.bne-payment-label {
    font-size: 0.9375rem;
    color: #64748b;
    margin-bottom: 8px;
}

.bne-monthly-payment {
    font-size: 3rem;
    font-weight: 700;
    color: var(--bne-color-primary);
    line-height: 1;
}

.bne-payment-period {
    font-size: 0.875rem;
    color: #94a3b8;
    margin-top: 4px;
}

/* Payment Chart (CSS Pie) */
.bne-payment-chart-container {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
}

.bne-payment-chart {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    position: relative;
    transition: var(--bne-transition);
}

.bne-payment-chart::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    background: #fff;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Payment Breakdown Legend */
.bne-payment-legend {
    text-align: left;
}

.bne-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.875rem;
}

.bne-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.bne-legend-color.principal { background: var(--bne-color-primary); }
.bne-legend-color.interest { background: var(--bne-color-accent); }
.bne-legend-color.taxes { background: var(--bne-color-warning); }
.bne-legend-color.insurance { background: var(--bne-color-info); }
.bne-legend-color.hoa { background: var(--bne-color-secondary); }

.bne-legend-label {
    color: #64748b;
    flex: 1;
}

.bne-legend-value {
    font-weight: 600;
    color: #1e293b;
}

/* Total Loan Info */
.bne-loan-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    width: 100%;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
}

.bne-loan-info-item {
    text-align: center;
}

.bne-loan-info-label {
    font-size: 0.8125rem;
    color: #64748b;
    margin-bottom: 4px;
}

.bne-loan-info-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
}

/* ==========================================================================
   Two Column Layout
   ========================================================================== */

.bne-two-col-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}

@media (max-width: 900px) {
    .bne-two-col-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

.bne-col-content {
    padding-right: 24px;
}

.bne-col-content h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 16px;
}

.bne-col-content p {
    color: #64748b;
    line-height: 1.7;
    margin-bottom: 24px;
}

.bne-benefits-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.bne-benefits-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    color: #475569;
}

.bne-benefits-list li svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--bne-color-success);
    margin-top: 2px;
}

/* ==========================================================================
   Frequency Selector (Property Alerts)
   ========================================================================== */

.bne-frequency-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.bne-frequency-option {
    flex: 1;
}

.bne-frequency-option input {
    display: none;
}

.bne-frequency-option label {
    display: block;
    padding: 14px 16px;
    text-align: center;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: var(--bne-radius-sm);
    cursor: pointer;
    transition: var(--bne-transition);
    font-weight: 500;
    margin-bottom: 0;
}

.bne-frequency-option input:checked + label {
    border-color: var(--bne-color-primary);
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.05), rgba(59, 130, 246, 0.1));
    color: var(--bne-color-primary);
}

/* ==========================================================================
   Section Backgrounds
   ========================================================================== */

.bne-lead-section.bg-gradient {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.bne-lead-section.bg-primary {
    background: linear-gradient(135deg, var(--bne-color-primary), var(--bne-color-primary-light));
}

.bne-lead-section.bg-primary .section-title,
.bne-lead-section.bg-primary .section-subtitle,
.bne-lead-section.bg-primary h3,
.bne-lead-section.bg-primary p,
.bne-lead-section.bg-primary li {
    color: #fff;
}

.bne-lead-section.bg-primary .bne-glass-card {
    background: rgba(255, 255, 255, 0.98);
}

.bne-lead-section.bg-primary .bne-benefits-list li svg {
    color: #fff;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
    .bne-lead-section {
        padding: 60px 0;
    }

    .bne-lead-section .section-title {
        font-size: 1.75rem;
    }

    .bne-glass-card {
        padding: 24px;
    }

    .bne-monthly-payment {
        font-size: 2.25rem;
    }

    .bne-payment-chart-container {
        flex-direction: column;
    }

    .bne-payment-chart {
        width: 140px;
        height: 140px;
    }

    .bne-col-content {
        padding-right: 0;
    }
}

/* ==========================================================================
   Animation Classes
   ========================================================================== */

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.bne-loading {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes checkmark {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.bne-success-icon {
    animation: checkmark 0.4s ease-out;
}
