/* =============================================================================
   Onboarding Flow Styles
   TurboTax-inspired step-by-step flow with smooth transitions
   ============================================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--hh-type-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    background: var(--hh-color-base-offWhite, #f8f9fa);
    min-height: 100vh;
    /* Removed align-items: center to allow natural scroll on small screens */
    display: flex;
    justify-content: center;
    overflow-y: auto;
}

.onboarding-container {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    padding: 24px;
    padding-bottom: 100px; /* Extra space for progress dots */
    display: flex;
    flex-direction: column;
}

/* Progress Dots */
.onboarding-progress {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}

.progress-dots {
    display: flex;
    gap: 8px;
}

.progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--hh-color-borders-default, #e0e0e0);
    transition: all 0.3s ease;
}

.progress-dot.active {
    background: var(--hh-color-brand-primary, #F47853);
    width: 24px;
    border-radius: 4px;
}

.progress-dot.completed {
    background: var(--hh-color-brand-primary, #F47853);
}

/* Step Container */
.onboarding-step {
    display: none;
    flex: 1;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

.onboarding-step.active {
    display: flex;
}

@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); }
}

/* Step Header */
.step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.back-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--hh-color-base-white, #fff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
}

.back-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.step-indicator {
    font-size: 14px;
    color: var(--hh-color-text-secondary, #666);
}

/* Step Content */
.step-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-bottom: 24px; /* Reduced - container has extra padding now */
}

.onboarding-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
}

h1 {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 16px;
    color: var(--hh-color-text-primary, #1a1a1a);
}

h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--hh-color-text-primary, #1a1a1a);
}

.step-description {
    font-size: 16px;
    color: var(--hh-color-text-secondary, #666);
    text-align: center;
    line-height: 1.6;
    margin-bottom: 32px;
}

.step-subtext {
    font-size: 14px;
    color: var(--hh-color-text-secondary, #666);
    margin-bottom: 16px;
}

/* Buttons */
.onboarding-btn {
    width: 100%;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    margin-top: auto;
}

.onboarding-btn.primary {
    background: var(--hh-color-brand-primary, #F47853);
    color: white;
}

.onboarding-btn.primary:hover {
    background: var(--hh-color-brand-primary-600, #e06640);
    transform: translateY(-1px);
}

.onboarding-btn.secondary {
    background: var(--hh-color-base-white, #fff);
    color: var(--hh-color-text-primary, #1a1a1a);
    border: 1.5px solid var(--hh-color-borders-default, #e0e0e0);
    margin-top: 12px;
}

.onboarding-btn.secondary:hover {
    background: var(--hh-color-base-cloud, #f5f5f5);
}

.onboarding-btn.text {
    background: transparent;
    color: var(--hh-color-text-secondary, #666);
    margin-top: 16px;
}

.onboarding-btn.text:hover {
    color: var(--hh-color-text-primary, #1a1a1a);
}

/* Input Styles */
.input-group {
    position: relative;
    margin-bottom: 16px;
}

.onboarding-input {
    width: 100%;
    padding: 16px;
    border: 1.5px solid var(--hh-color-borders-default, #e0e0e0);
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.2s ease;
}

.onboarding-input:focus {
    outline: none;
    border-color: var(--hh-color-brand-primary, #F47853);
    box-shadow: 0 0 0 3px rgba(244, 120, 83, 0.1);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    z-index: 100;
    max-height: 280px;
    overflow-y: auto;
    /* Use opacity/visibility for smooth transitions (compatible with location-autocomplete.js) */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

/* Support both .active (legacy) and .visible (location-autocomplete.js) classes */
.search-results.active,
.search-results.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-result-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: var(--hh-color-base-cloud, #f5f5f5);
}

/* Market Chips */
.section-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--hh-color-text-secondary, #666);
    margin-bottom: 12px;
}

.market-chips,
.amenity-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.market-chip,
.amenity-chip {
    padding: 10px 16px;
    border: 1.5px solid var(--hh-color-borders-default, #e0e0e0);
    border-radius: 100px;
    background: var(--hh-color-base-white, #fff);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.market-chip:hover,
.amenity-chip:hover {
    border-color: var(--hh-color-brand-primary, #F47853);
}

.market-chip.selected,
.amenity-chip.selected {
    background: var(--hh-color-brand-primary, #F47853);
    border-color: var(--hh-color-brand-primary, #F47853);
    color: white;
}

.selected-markets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.selected-market-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--hh-color-base-cloud, #f5f5f5);
    border-radius: 100px;
    font-size: 14px;
}

.remove-market {
    width: 16px;
    height: 16px;
    border: none;
    background: var(--hh-color-text-tertiary, #999);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    cursor: pointer;
    margin-bottom: 24px;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--hh-color-brand-primary, #F47853);
}

/* Range Slider */
.range-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 32px;
    font-size: 28px;
    font-weight: 600;
    color: var(--hh-color-brand-primary, #F47853);
}

.range-separator {
    font-size: 16px;
    color: var(--hh-color-text-secondary, #666);
    font-weight: 400;
}

.range-inputs {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 24px;
}

.range-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.range-input-group label {
    font-size: 14px;
    color: var(--hh-color-text-secondary, #666);
}

input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--hh-color-borders-default, #e0e0e0);
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--hh-color-brand-primary, #F47853);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Property Type Cards */
.property-type-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.property-type-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    background: var(--hh-color-base-white, #fff);
    border: 1.5px solid var(--hh-color-borders-default, #e0e0e0);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.property-type-card:hover {
    border-color: var(--hh-color-brand-primary, #F47853);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.property-type-card.selected {
    border-color: var(--hh-color-brand-primary, #F47853);
    background: rgba(244, 120, 83, 0.05);
}

.property-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.property-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--hh-color-text-primary, #1a1a1a);
}

.property-desc {
    font-size: 13px;
    color: var(--hh-color-text-secondary, #666);
    margin-top: 4px;
}

/* Tip Box */
.tip-box {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: rgba(244, 120, 83, 0.08);
    border-radius: 12px;
    margin-bottom: 24px;
}

.tip-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.tip-box p {
    font-size: 14px;
    color: var(--hh-color-text-primary, #1a1a1a);
    line-height: 1.5;
}

/* Education Cards */
.edu-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.edu-card {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: var(--hh-color-base-white, #fff);
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.edu-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.edu-text h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--hh-color-text-primary, #1a1a1a);
}

.edu-text p {
    font-size: 14px;
    color: var(--hh-color-text-secondary, #666);
    line-height: 1.5;
}

/* Complete Step */
.complete-step {
    text-align: center;
    align-items: center;
}

.complete-icon {
    width: 80px;
    height: 80px;
    background: var(--hh-color-success, #22c55e);
    color: white;
    font-size: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    animation: scaleIn 0.4s ease;
}

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

.summary-card {
    width: 100%;
    padding: 20px;
    background: var(--hh-color-base-white, #fff);
    border-radius: 16px;
    text-align: left;
    margin-bottom: 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.summary-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--hh-color-text-secondary, #666);
    margin-bottom: 12px;
}

.summary-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--hh-color-text-primary, #1a1a1a);
}

.summary-item::before {
    content: "•";
    color: var(--hh-color-brand-primary, #F47853);
}

.complete-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Single Selected Market */
.selected-market {
    margin-bottom: 16px;
}

/* Beds/Baths Selectors */
.beds-baths-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 32px;
}

.selector-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.selector-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--hh-color-text-secondary, #666);
}

.number-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.selector-btn {
    padding: 12px 16px;
    border: 1.5px solid var(--hh-color-borders-default, #e0e0e0);
    border-radius: 8px;
    background: var(--hh-color-base-white, #fff);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 48px;
    text-align: center;
}

.selector-btn:hover {
    border-color: var(--hh-color-brand-primary, #F47853);
}

.selector-btn.selected {
    background: var(--hh-color-brand-primary, #F47853);
    border-color: var(--hh-color-brand-primary, #F47853);
    color: white;
}

/* Metric Cards (Education Step) */
.metric-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.metric-card {
    background: var(--hh-color-base-white, #fff);
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
}

.metric-header {
    padding: 16px 20px;
    background: var(--hh-color-brand-slate, #1e293b);
    color: white;
}

.metric-label {
    font-size: 16px;
    font-weight: 600;
}

.metric-body {
    padding: 20px;
}

.metric-body p {
    font-size: 14px;
    color: var(--hh-color-text-secondary, #666);
    line-height: 1.5;
    margin-bottom: 12px;
}

.metric-list {
    list-style: none;
    padding: 0;
    margin: 0 0 12px 0;
}

.metric-list li {
    font-size: 14px;
    color: var(--hh-color-text-primary, #1a1a1a);
    padding: 6px 0 6px 20px;
    position: relative;
}

.metric-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--hh-color-brand-primary, #F47853);
}

.metric-note {
    font-size: 13px !important;
    font-style: italic;
    color: var(--hh-color-text-tertiary, #999) !important;
    margin-bottom: 0 !important;
}

/* Large Button */
.onboarding-btn.large {
    padding: 20px 24px;
    font-size: 18px;
}

/* Summary Label/Value */
.summary-label {
    color: var(--hh-color-text-secondary, #666);
}

.summary-value {
    font-weight: 500;
    color: var(--hh-color-text-primary, #1a1a1a);
}

.summary-item::before {
    display: none;
}

/* Disabled Button */
.onboarding-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Note: Financial Settings styles (Step 5) moved to onboarding-education.css */

/* Responsive - Desktop */
@media (min-width: 768px) {
    .onboarding-container {
        min-height: auto;
        padding: 48px 24px;
    }

    .step-content {
        padding-bottom: 48px;
    }

    .onboarding-progress {
        bottom: 48px;
    }
}

/* Mobile - Progress bar below button instead of fixed footer */
@media (max-width: 767px) {
    .onboarding-container {
        display: flex;
        flex-direction: column;
        padding-bottom: 24px; /* Remove extra padding since progress is inline */
    }

    .onboarding-progress {
        position: static;
        transform: none;
        margin-top: 24px;
        display: flex;
        justify-content: center;
        order: 99; /* Move to end of flex container (below steps/buttons) */
    }

    .onboarding-step.active {
        order: 1; /* Keep steps above progress bar */
    }

    /* Bedroom/bathroom buttons - 3 columns on mobile */
    .number-selector {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .selector-btn {
        min-width: auto;
        padding: 12px 8px;
    }
}
