/* ===== Home Value Form Styles ===== */
.hv-form-wrap {
    position: relative;
    overflow: hidden;
}

/* Progress Bar */
.hv-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}
.hv-progress__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-gray-400);
    transition: background 0.3s ease, transform 0.3s ease;
}
.hv-progress__dot--active {
    background: var(--color-accent);
    transform: scale(1.3);
}
.hv-progress__dot--complete {
    background: var(--color-primary);
}
.hv-progress__line {
    width: 40px;
    height: 2px;
    background: var(--color-gray-300);
    transition: background 0.3s ease;
}
.hv-progress__line--complete {
    background: var(--color-primary);
}

/* Steps */
.hv-step {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.hv-step--active {
    display: block;
}
.hv-step--visible {
    opacity: 1;
    transform: translateY(0);
}

/* Step 1 - Hero */
.hv-hero-input {
    max-width: 640px;
    margin: 2rem auto 0;
}
.hv-hero-input input {
    width: 100%;
    padding: 1.125rem 1.5rem;
    font-size: 1.125rem;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: var(--radius-lg);
    background: rgba(255,255,255,0.1);
    color: #fff;
    outline: none;
    transition: border-color 0.3s ease, background 0.3s ease;
    font-family: var(--font-body);
    box-sizing: border-box;
}
.hv-hero-input input::placeholder {
    color: rgba(255,255,255,0.6);
}
.hv-hero-input input:focus {
    border-color: var(--color-accent);
    background: rgba(255,255,255,0.15);
}
.hv-hero-input .btn {
    margin-top: 1.25rem;
    width: 100%;
}

/* Step 2 - Property Details */
.hv-card {
    max-width: 720px;
    margin: 0 auto;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
}
.hv-card h2 {
    text-align: center;
    margin-bottom: 0.5rem;
}
.hv-card__sub {
    text-align: center;
    color: var(--color-gray-600);
    margin-bottom: 2rem;
}
.hv-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}
.hv-field {
    display: flex;
    flex-direction: column;
}
.hv-field--full {
    grid-column: 1 / -1;
}
.hv-field label {
    font-weight: 600;
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
    color: var(--color-gray-700);
}
.hv-field input,
.hv-field select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: var(--font-body);
    transition: border-color 0.2s;
    background: #fff;
    box-sizing: border-box;
}
.hv-field input:focus,
.hv-field select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(27,54,93,0.1);
}

/* Radio & Checkbox Groups */
.hv-radio-group,
.hv-check-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
}
.hv-radio-group label,
.hv-check-group label {
    font-weight: 400;
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    user-select: none;
}
.hv-radio-group label:hover,
.hv-check-group label:hover {
    border-color: var(--color-primary-light);
}
.hv-radio-group input,
.hv-check-group input {
    display: none;
}
.hv-radio-group label:has(input:checked),
.hv-check-group label:has(input:checked) {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.hv-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2rem;
    gap: 1rem;
}
.hv-back {
    background: none;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    font-size: 0.95rem;
    font-family: var(--font-body);
    padding: 0.5rem;
    text-decoration: underline;
}
.hv-back:hover {
    color: var(--color-primary-light);
}

/* Step 3 - Contact */
.hv-contact-card {
    max-width: 520px;
    margin: 0 auto;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    text-align: center;
}
.hv-contact-card .hv-field {
    text-align: left;
    margin-bottom: 1rem;
}
.hv-fine-print {
    font-size: 0.8rem;
    color: var(--color-gray-500);
    margin-top: 1rem;
}
.hv-hp-field {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
}

/* Step 4 - CMA Report */
.hv-report {
    max-width: 900px;
    margin: 0 auto;
}
.hv-report__value-wrap {
    text-align: center;
    margin-bottom: 2.5rem;
}
.hv-report__label {
    font-size: 1.125rem;
    color: var(--color-gray-600);
    margin-bottom: 0.5rem;
}
.hv-report__value {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--color-primary);
    font-family: var(--font-heading);
    line-height: 1.1;
}
.hv-report__confidence {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.35rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}
.hv-report__confidence--high {
    background: #dcfce7;
    color: #166534;
}
.hv-report__confidence--medium {
    background: #fef9c3;
    color: #854d0e;
}
.hv-report__confidence--low {
    background: #fee2e2;
    color: #991b1b;
}

/* Value Range Bar */
.hv-range {
    max-width: 600px;
    margin: 0 auto 2.5rem;
    padding: 0 1rem;
}
.hv-range__bar {
    height: 8px;
    background: linear-gradient(90deg, var(--color-gray-200), var(--color-accent), var(--color-gray-200));
    border-radius: 4px;
    position: relative;
    margin: 1.5rem 0 0.5rem;
}
.hv-range__marker {
    position: absolute;
    top: -8px;
    width: 24px;
    height: 24px;
    background: var(--color-primary);
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    transform: translateX(-50%);
    transition: left 0.6s ease;
}
.hv-range__labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--color-gray-500);
}
.hv-range__labels span:nth-child(2) {
    font-weight: 600;
    color: var(--color-primary);
}

/* Stats Grid */
.hv-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2.5rem;
}
.hv-stat {
    background: #fff;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    text-align: center;
}
.hv-stat__num {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-primary);
    font-family: var(--font-heading);
}
.hv-stat__label {
    font-size: 0.8rem;
    color: var(--color-gray-500);
    margin-top: 0.25rem;
}

/* Comp Cards */
.hv-subject {
    background: var(--color-primary);
    color: #fff;
    border-radius: var(--radius-md);
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
}
.hv-subject__title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.7;
    margin-bottom: 0.5rem;
}
.hv-subject__address {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}
.hv-subject__details {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.hv-subject__detail {
    text-align: center;
}
.hv-subject__detail-value {
    font-size: 1.1rem;
    font-weight: 700;
}
.hv-subject__detail-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.7;
}
.hv-comps-section {
    margin-bottom: 2.5rem;
}
.hv-comps-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-gray-200);
}
.hv-comps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}
.hv-comp-card {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--color-gray-200);
    display: flex;
    flex-direction: column;
    height: 100%;
}
.hv-comp-card__img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: var(--color-gray-200);
    display: block;
}
.hv-comp-card__body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.hv-comp-card__price-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-accent);
    font-weight: 600;
    margin-bottom: 0.1rem;
}
.hv-comp-card__price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.25rem;
}
.hv-comp-card__address {
    font-size: 0.9rem;
    color: var(--color-gray-700);
    margin-bottom: 0.5rem;
}
.hv-comp-card__details {
    font-size: 0.8rem;
    color: var(--color-gray-500);
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.hv-comp-card__adj {
    font-size: 0.8rem;
    color: var(--color-accent);
    margin-top: 0.5rem;
    font-weight: 600;
}
a.hv-comp-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
a.hv-comp-card-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
a.hv-comp-card-link:hover .hv-comp-card {
    border-color: var(--color-accent);
}
.hv-comp-card__sold-date {
    font-size: 0.75rem;
    color: var(--color-gray-400);
    margin-top: 0.25rem;
}

/* Report Actions */
.hv-report__actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

/* Fallback (no CMA data) */
.hv-fallback {
    text-align: center;
    padding: 2rem;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    max-width: 600px;
    margin: 0 auto;
}
.hv-fallback h3 {
    margin-bottom: 1rem;
}
.hv-fallback p {
    color: var(--color-gray-600);
    margin-bottom: 1.5rem;
}

/* Loading spinner */
.hv-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: hv-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 0.5rem;
}
@keyframes hv-spin {
    to { transform: rotate(360deg); }
}

/* Error */
.hv-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    display: none;
}
.hv-error--visible {
    display: block;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hv-grid {
        grid-template-columns: 1fr;
    }
    .hv-stats {
        grid-template-columns: 1fr 1fr;
    }
    .hv-report__value {
        font-size: 2.5rem;
    }
    .hv-actions {
        flex-direction: column-reverse;
    }
    .hv-actions .btn {
        width: 100%;
    }
    .hv-card,
    .hv-contact-card {
        padding: 1.5rem;
        margin: 0 0.5rem;
    }
    .hv-report__actions {
        flex-direction: column;
    }
    .hv-report__actions .btn {
        width: 100%;
    }
    .hv-comps-grid {
        grid-template-columns: 1fr;
    }
    .section > .container > div[style*="grid-template-columns: repeat(3, 1fr)"] {
        grid-template-columns: 1fr !important;
    }
}
@media (max-width: 480px) {
    .hv-stats {
        grid-template-columns: 1fr;
    }
    .hv-hero-input input {
        font-size: 1rem;
        padding: 1rem;
    }
}
