/**
 * HEAR Rebates Calculator Styles
 * Premium, sophisticated design with thoughtful spacing and layout
 */

:root {
    /* Colors */
    --hear-primary: #0066cc;
    --hear-primary-dark: #0052a3;
    --hear-primary-light: #f0f7ff;
    --hear-success: #10b981;
    --hear-success-light: #d1fae5;
    --hear-text-primary: #1a1a1a;
    --hear-text-secondary: #666;
    --hear-text-muted: #999;
    --hear-border: #e0e0e0;
    --hear-border-light: #f0f0f0;
    --hear-bg: #ffffff;
    --hear-bg-light: #f8f9fa;
    
    /* Shadows */
    --hear-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --hear-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
    --hear-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --hear-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --hear-shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);
    
    /* Border Radius */
    --hear-radius-sm: 8px;
    --hear-radius: 12px;
    --hear-radius-md: 16px;
    --hear-radius-lg: 20px;
    --hear-radius-xl: 24px;
    
    /* Spacing System (4px base - tighter) */
    --space-xs: 0.25rem;   /* 4px */
    --space-sm: 0.5rem;    /* 8px */
    --space-md: 0.75rem;   /* 12px */
    --space-lg: 1rem;      /* 16px */
    --space-xl: 1.5rem;    /* 24px */
    --space-2xl: 2rem;     /* 32px */
    --space-3xl: 2.5rem;   /* 40px */
    --space-4xl: 3rem;      /* 48px */
    
    /* Typography Scale */
    --text-xs: 0.75rem;    /* 12px */
    --text-sm: 0.875rem;   /* 14px */
    --text-base: 1rem;     /* 16px */
    --text-lg: 1.125rem;  /* 18px */
    --text-xl: 1.25rem;   /* 20px */
    --text-2xl: 1.5rem;   /* 24px */
    --text-3xl: 1.875rem; /* 30px */
    --text-4xl: 2.25rem;  /* 36px */
    --text-5xl: 3rem;     /* 48px */
}

/* Base Reset & Typography */
* {
    box-sizing: border-box;
}

.hear-rebates-calculator-wrapper {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: var(--space-lg) var(--space-md);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    text-rendering: optimizeLegibility;
    line-height: 1.5;
}

/* Container */
.hear-calculator-container {
    background: var(--hear-bg);
    border-radius: var(--hear-radius-md);
    box-shadow: var(--hear-shadow-lg);
    padding: var(--space-2xl) var(--space-xl);
    transition: box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.04);
    min-height: 400px;
}

.hear-calculator-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--hear-primary) 0%, var(--hear-primary-dark) 100%);
    z-index: 1;
}

/* Title Header */
.hear-title-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    gap: var(--space-lg);
}

/* Title */
.hear-calculator-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--hear-text-primary);
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.04em;
    font-feature-settings: 'ss01', 'cv02', 'cv03', 'cv04';
    flex: 1;
    min-width: 0;
}

/* Mode Toggle - Modern Switch */
.hear-mode-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.hear-mode-label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--hear-text-secondary);
    letter-spacing: -0.01em;
    font-feature-settings: 'cv02', 'cv03';
}

.hear-mode-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.hear-mode-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.hear-mode-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--hear-border);
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 24px;
}

.hear-mode-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hear-mode-switch input:checked + .hear-mode-slider {
    background-color: var(--hear-primary);
}

.hear-mode-switch input:checked + .hear-mode-slider:before {
    transform: translateX(20px);
}

.hear-mode-switch input:focus + .hear-mode-slider {
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* Mode Content */
.hear-mode-content {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    will-change: opacity, transform;
}

.hear-mode-content.hear-mode-hidden {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 0;
    visibility: hidden;
}

/* Mobile: Reduce transition time for better performance */
@media (max-width: 768px) {
    .hear-mode-content {
        transition: opacity 0.25s ease, transform 0.25s ease;
    }
}

/* Advanced Inputs Row */
.hear-advanced-inputs-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    align-items: end;
}

.hear-advanced-input-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

/* Sections */
.hear-section {
    margin-bottom: var(--space-2xl);
}

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

/* Labels */
.hear-label {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-weight: 600;
    color: var(--hear-text-primary);
    font-size: var(--text-xs);
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-feature-settings: 'tnum', 'cv02', 'cv03';
    opacity: 0.9;
}

/* Tooltip */
.hear-tooltip-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    margin-left: var(--space-xs);
    color: var(--hear-text-secondary);
    transition: color 0.2s ease;
}

.hear-tooltip-trigger:hover {
    color: var(--hear-primary);
}

.hear-info-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.hear-tooltip-trigger:hover .hear-info-icon {
    opacity: 1;
    transform: scale(1.1);
}

.hear-tooltip-trigger::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + var(--space-sm));
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    background: var(--hear-text-primary);
    color: #fff;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--hear-radius-sm);
    font-size: var(--text-xs);
    font-weight: 400;
    white-space: normal;
    width: 280px;
    max-width: calc(100vw - var(--space-xl));
    text-align: left;
    line-height: 1.5;
    letter-spacing: 0;
    text-transform: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1000;
    box-shadow: var(--hear-shadow-lg);
    word-wrap: break-word;
}

.hear-tooltip-trigger::before {
    content: '';
    position: absolute;
    bottom: calc(100% + var(--space-xs));
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    border: 6px solid transparent;
    border-top-color: var(--hear-text-primary);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1001;
}

.hear-tooltip-trigger:hover::after,
.hear-tooltip-trigger:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Mobile: Show tooltip on click/tap */
@media (hover: none) and (pointer: coarse) {
    .hear-tooltip-trigger.active::after,
    .hear-tooltip-trigger.active::before {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* County Selection */
.hear-county-selection {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    align-items: center;
}

.hear-county-btn {
    padding: 6px 12px;
    border: 1px solid var(--hear-border);
    border-radius: var(--hear-radius-sm);
    background: var(--hear-bg);
    color: var(--hear-text-primary);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
    box-shadow: var(--hear-shadow-xs);
    letter-spacing: -0.01em;
    font-feature-settings: 'cv02', 'cv03';
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    line-height: 1;
}

.hear-county-flag {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.hear-county-name {
    font-size: var(--text-sm);
    font-weight: 600;
}

.hear-county-btn:hover {
    border-color: var(--hear-primary);
    background: var(--hear-primary-light);
    color: var(--hear-primary);
    box-shadow: var(--hear-shadow-sm);
}

.hear-county-btn.active {
    background: var(--hear-primary);
    color: #fff;
    border-color: var(--hear-primary);
    box-shadow: 0 2px 4px rgba(0, 102, 204, 0.25);
}

.hear-county-btn.active .hear-county-flag {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Custom Dropdown */
.hear-county-dropdown-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.hear-county-dropdown-input {
    padding: 6px 12px;
    padding-right: calc(12px + 16px + var(--space-xs));
    border: 1px solid var(--hear-border);
    border-radius: 8px;
    background: var(--hear-bg);
    color: var(--hear-text-primary);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    box-shadow: var(--hear-shadow-xs);
    letter-spacing: -0.01em;
    font-feature-settings: 'cv02', 'cv03';
    min-height: 32px;
    line-height: 1;
    width: auto;
    min-width: 120px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    outline: none;
}

.hear-county-dropdown-input:hover {
    border-color: var(--hear-primary);
    background: var(--hear-primary-light);
    color: var(--hear-primary);
    box-shadow: var(--hear-shadow-sm);
}

.hear-county-dropdown-input:focus {
    outline: none;
    border-color: var(--hear-primary);
    background: var(--hear-primary-light);
    color: var(--hear-primary);
    box-shadow: var(--hear-shadow-sm);
}

.hear-county-dropdown-input.active,
.hear-county-dropdown-input.open {
    background: var(--hear-primary);
    color: #fff;
    border-color: var(--hear-primary);
    box-shadow: 0 2px 6px rgba(0, 102, 204, 0.2);
}

.hear-county-dropdown-input.active::placeholder,
.hear-county-dropdown-input.open::placeholder {
    color: rgba(255, 255, 255, 0.8);
}

.hear-county-dropdown-input::placeholder {
    color: var(--hear-text-secondary);
    font-weight: 600;
}

.hear-dropdown-icon {
    position: absolute;
    right: var(--space-sm);
    font-size: 10px;
    transition: transform 0.2s ease;
    opacity: 0.7;
    flex-shrink: 0;
    pointer-events: none;
}

.hear-county-dropdown-wrapper:has(.hear-county-dropdown-input.open) .hear-dropdown-icon,
.hear-county-dropdown-input.open ~ .hear-dropdown-icon {
    transform: rotate(180deg);
}

.hear-county-dropdown-menu {
    position: absolute;
    top: calc(100% + var(--space-xs));
    left: 0;
    min-width: 200px;
    max-width: 300px;
    background: var(--hear-bg);
    border: 1.5px solid var(--hear-border);
    border-radius: var(--hear-radius);
    box-shadow: var(--hear-shadow-lg);
    z-index: 1000;
    overflow: hidden;
    margin-top: 2px;
}

.hear-dropdown-search-wrapper {
    padding: var(--space-md);
    border-bottom: 1px solid var(--hear-border-light);
    background: var(--hear-bg-light);
    position: relative;
}

.hear-dropdown-search-wrapper::before {
    content: '🔍';
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    font-size: var(--text-sm);
    opacity: 0.5;
    pointer-events: none;
    z-index: 1;
}

.hear-dropdown-search {
    width: 100%;
    padding: var(--space-sm) var(--space-sm) var(--space-sm) calc(var(--space-md) + var(--space-lg));
    border: 1.5px solid var(--hear-border);
    border-radius: var(--hear-radius-sm);
    font-size: var(--text-sm);
    font-weight: 500;
    background: var(--hear-bg);
    color: var(--hear-text-primary);
    transition: all 0.2s ease;
    box-shadow: var(--hear-shadow-xs);
}

.hear-dropdown-search::placeholder {
    color: var(--hear-text-muted);
    font-weight: 400;
}

.hear-dropdown-search:focus {
    outline: none;
    border-color: var(--hear-primary);
    background: var(--hear-bg);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1), var(--hear-shadow-sm);
}

.hear-dropdown-list {
    max-height: 200px;
    overflow-y: auto;
    padding: var(--space-xs);
}

.hear-dropdown-item {
    width: 100%;
    padding: var(--space-xs) var(--space-sm);
    border: none;
    background: transparent;
    color: var(--hear-text-primary);
    font-size: 0.75rem !important;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    border-radius: var(--hear-radius-sm);
    transition: all 0.15s ease;
    display: block;
    letter-spacing: -0.01em;
    line-height: 1.4;
    font-family: inherit;
}

/* Ensure button elements inside dropdown don't inherit large button styles */
button.hear-dropdown-item {
    font-size: 0.75rem !important;
    line-height: 1.4;
}

.hear-dropdown-item:hover {
    background: var(--hear-primary-light);
    color: var(--hear-primary);
}

.hear-dropdown-item:active {
    background: var(--hear-primary);
    color: #fff;
}

/* Household Size Controls */
.hear-household-control {
    display: inline-flex;
    align-items: center;
    gap: var(--space-md);
    background: var(--hear-bg-light);
    border-radius: var(--hear-radius);
    padding: var(--space-xs);
    border: 1px solid var(--hear-border-light);
}

.hear-control-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--hear-radius-sm);
    background: var(--hear-bg);
    color: var(--hear-primary);
    font-size: var(--text-lg);
    font-weight: 300;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--hear-shadow-xs);
    line-height: 1;
    flex-shrink: 0;
}

.hear-control-btn:hover {
    background: var(--hear-primary);
    color: #fff;
    transform: scale(1.05);
    box-shadow: var(--hear-shadow-sm);
}

.hear-control-btn:active {
    transform: scale(0.95);
}

.hear-household-value {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--hear-text-primary);
    min-width: 40px;
    text-align: center;
    letter-spacing: -0.04em;
    font-feature-settings: 'tnum', 'cv02', 'cv03';
}

/* Income Range Display - Premium & Prominent */
.hear-income-range-section {
    margin-bottom: var(--space-2xl);
}

.hear-income-range-display {
    background: transparent;
    border-radius: var(--hear-radius);
    padding: 0;
}

.hear-range-placeholder {
    color: var(--hear-text-muted);
    font-style: italic;
    padding: var(--space-xl) var(--space-lg);
    text-align: center;
    background: var(--hear-bg-light);
    border-radius: var(--hear-radius);
    border: 2px dashed var(--hear-border);
    font-size: var(--text-sm);
}

.hear-range-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* Income Range Cards */
.hear-range-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--hear-radius);
    background: var(--hear-bg);
    border: 1.5px solid var(--hear-border-light);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--hear-shadow-sm);
    gap: var(--space-md);
    position: relative;
    overflow: hidden;
}

.hear-range-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent 0%, currentColor 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.hear-range-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--hear-shadow-xl);
    border-color: var(--hear-border);
}

.hear-range-card:hover::before {
    opacity: 0.3;
}

.hear-range-card-100 {
    background: linear-gradient(135deg, #f0f7ff 0%, #e6f2ff 50%, #dbeafe 100%);
    border-color: rgba(0, 102, 204, 0.25);
    box-shadow: 0 4px 16px rgba(0, 102, 204, 0.12), var(--hear-shadow-sm);
}

.hear-range-card-100:hover {
    box-shadow: 0 8px 32px rgba(0, 102, 204, 0.2), var(--hear-shadow-md);
    border-color: rgba(0, 102, 204, 0.4);
}

.hear-range-card-50 {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 50%, #fcd34d 100%);
    border-color: rgba(245, 158, 11, 0.25);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.12), var(--hear-shadow-sm);
}

.hear-range-card-50:hover {
    box-shadow: 0 8px 32px rgba(245, 158, 11, 0.2), var(--hear-shadow-md);
    border-color: rgba(245, 158, 11, 0.4);
}

.hear-range-card-content {
    flex: 1;
    min-width: 0;
}

.hear-range-card-label {
    font-weight: 600;
    color: var(--hear-text-primary);
    font-size: var(--text-xs);
    margin-bottom: var(--space-xs);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-feature-settings: 'cv02', 'cv03';
    opacity: 0.85;
}

.hear-range-card-value {
    font-weight: 800;
    color: var(--hear-text-primary);
    font-size: var(--text-2xl);
    letter-spacing: -0.05em;
    font-feature-settings: 'tnum', 'cv02', 'cv03', 'cv04', 'ss01';
    line-height: 1.1;
    display: flex;
    align-items: baseline;
    gap: var(--space-xs);
    flex-wrap: wrap;
}

.hear-range-currency {
    font-size: var(--text-lg);
    font-weight: 700;
    opacity: 0.7;
    vertical-align: baseline;
}

.hear-range-amount {
    font-size: var(--text-2xl);
    font-weight: 800;
    letter-spacing: -0.06em;
}

.hear-range-separator {
    font-size: var(--text-lg);
    font-weight: 500;
    opacity: 0.6;
    margin: 0 var(--space-xs);
}

.hear-range-suffix {
    font-size: var(--text-base);
    font-weight: 500;
    opacity: 0.7;
    margin-left: var(--space-xs);
    letter-spacing: 0;
}

.hear-range-badge {
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--hear-radius-sm);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    font-feature-settings: 'cv02', 'cv03';
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.hear-range-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.hear-range-card:hover .hear-range-badge::before {
    left: 100%;
}

.hear-range-badge-100 {
    background: linear-gradient(135deg, var(--hear-primary) 0%, var(--hear-primary-dark) 100%);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hear-range-badge-50 {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hear-range-error {
    color: #dc2626;
    font-size: var(--text-base);
    padding: var(--space-md);
    background: #fef2f2;
    border-radius: var(--hear-radius);
    border: 1px solid #fecaca;
}

/* Income Input Field */
.hear-income-input {
    width: 100%;
    padding: var(--space-sm) var(--space-lg);
    border: 1.5px solid var(--hear-border);
    border-radius: var(--hear-radius-md);
    background: var(--hear-bg-light);
    color: var(--hear-text-primary);
    font-size: var(--text-xl);
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--hear-shadow-xs);
    letter-spacing: -0.01em;
    font-feature-settings: 'tnum', 'cv02', 'cv03';
    text-align: center;
    min-height: 56px;
    appearance: none;
    -webkit-appearance: none;
}

.hear-income-input:hover {
    border-color: var(--hear-primary);
    background: var(--hear-bg);
    box-shadow: var(--hear-shadow-sm);
}

.hear-income-input:focus {
    outline: none;
    border-color: var(--hear-primary);
    background: var(--hear-bg);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1), var(--hear-shadow-md);
    transform: translateY(-1px);
}

.hear-income-input::placeholder {
    color: var(--hear-text-muted);
    font-weight: 500;
    opacity: 0.7;
}

/* Remove number input spinners */
.hear-income-input::-webkit-inner-spin-button,
.hear-income-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.hear-income-input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Eligibility Status */
.hear-eligibility-status {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--hear-radius);
    margin-bottom: var(--space-lg);
    font-size: var(--text-base);
    font-weight: 500;
    border: 1.5px solid;
}

.hear-eligibility-status.eligible {
    background: var(--hear-success-light);
    color: var(--hear-success);
    border-color: var(--hear-success);
}

.hear-eligibility-status.not-eligible {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

/* Advanced Results */
.hear-advanced-results {
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 2px solid var(--hear-border-light);
    animation: fadeInUp 0.5s ease;
}

/* Total Display */
.hear-total-display {
    margin-top: var(--space-lg);
    padding: var(--space-lg);
    background: linear-gradient(135deg, var(--hear-primary-light) 0%, #e6f2ff 100%);
    border-radius: var(--hear-radius);
    border: 1.5px solid rgba(0, 102, 204, 0.2);
    text-align: center;
}

.hear-total-label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--hear-text-secondary);
    margin-bottom: var(--space-xs);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.hear-total-amount {
    font-size: var(--text-3xl);
    font-weight: 800;
    color: var(--hear-primary);
    letter-spacing: -0.05em;
    font-feature-settings: 'tnum', 'cv02', 'cv03', 'cv04', 'ss01';
    margin-bottom: var(--space-xs);
}

.hear-total-note {
    font-size: var(--text-xs);
    color: var(--hear-text-muted);
    font-style: italic;
}

/* Rebates Section */
.hear-rebates-section {
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 2px solid var(--hear-border-light);
    animation: fadeInUp 0.5s ease;
}

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

/* Rebates Header with Toggle */
.hear-rebates-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
    gap: var(--space-sm);
}

/* Modern Toggle Switch */
.hear-bracket-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    position: relative;
}

.hear-toggle-label-text {
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--hear-text-secondary);
    white-space: nowrap;
}

.hear-toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--hear-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    padding: 0;
    outline: none;
}

.hear-toggle-switch:focus {
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.hear-toggle-switch.active {
    background: var(--hear-primary);
}

.hear-toggle-switch::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hear-toggle-switch.active::before {
    transform: translateX(20px);
}

.hear-toggle-switch-label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--hear-text-primary);
    margin-left: var(--space-xs);
}

/* Compact Rebates Grid */
.hear-rebates-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

/* Individual Rebate Card */
.hear-rebate-card {
    background: var(--hear-bg);
    border: 1.5px solid var(--hear-border-light);
    border-radius: var(--hear-radius);
    padding: var(--space-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--hear-shadow-sm);
    position: relative;
    overflow: hidden;
}

.hear-rebate-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--hear-primary) 0%, var(--hear-primary-dark) 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.hear-rebate-card:hover {
    border-color: var(--hear-primary);
    box-shadow: var(--hear-shadow-md);
    transform: translateY(-2px);
}

.hear-rebate-card:hover::before {
    transform: scaleX(1);
}

.hear-rebate-card.active-100::before {
    background: linear-gradient(90deg, #0052a3 0%, #0066cc 100%);
    transform: scaleX(1);
}

.hear-rebate-card.active-50::before {
    background: linear-gradient(90deg, #4a9eff 0%, #66b3ff 100%);
    transform: scaleX(1);
}

.hear-rebate-card-header {
    margin-bottom: var(--space-md);
}

.hear-rebate-label {
    font-size: var(--text-sm);
    color: var(--hear-text-primary);
    line-height: 1.4;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.hear-rebate-card-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

/* Rebate Option (100% or 50%) */
.hear-rebate-option {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    padding: var(--space-md);
    border-radius: var(--hear-radius-sm);
    border: 1.5px solid var(--hear-border-light);
    background: var(--hear-bg-light);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.hear-rebate-option-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.hear-rebate-option:hover {
    border-color: var(--hear-border);
    background: var(--hear-bg);
}

.hear-rebate-option.active {
    border-color: transparent;
    box-shadow: var(--hear-shadow-sm);
}

.hear-rebate-option-100.active {
    background: linear-gradient(135deg, #0052a3 0%, #0066cc 100%);
    color: #fff;
}

.hear-rebate-option-50.active {
    background: linear-gradient(135deg, #4a9eff 0%, #66b3ff 100%);
    color: #fff;
}

.hear-rebate-option-label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--hear-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.hear-rebate-option.active .hear-rebate-option-label {
    color: rgba(255, 255, 255, 0.95);
}

.hear-rebate-option-amount {
    font-size: var(--text-xl);
    font-weight: 800;
    color: var(--hear-text-primary);
    letter-spacing: -0.03em;
    font-feature-settings: 'tnum', 'cv02', 'cv03', 'cv04';
}

.hear-rebate-option.active .hear-rebate-option-amount {
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hear-rebate-option-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 24px;
    padding: 0 var(--space-sm);
    background: rgba(0, 102, 204, 0.1);
    border: 1px solid rgba(0, 102, 204, 0.2);
    border-radius: 12px;
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--hear-primary);
}

.hear-rebate-option.active .hear-rebate-option-badge {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Single Family Homes Disclosure */
.hear-single-family-disclosure {
    margin-top: var(--space-lg);
    padding: var(--space-sm) var(--space-md);
    background: var(--hear-bg-light);
    border-left: 3px solid var(--hear-primary);
    border-radius: var(--hear-radius-sm);
    font-size: var(--text-xs);
    color: var(--hear-text-secondary);
    line-height: 1.5;
}

.hear-single-family-disclosure p {
    margin: 0;
}

.hear-single-family-disclosure strong {
    color: var(--hear-text-primary);
    font-weight: 600;
}

/* Call to Action Section */
.hear-cta-section {
    margin-top: var(--space-2xl);
    padding: var(--space-xl);
    background: linear-gradient(135deg, var(--hear-primary) 0%, var(--hear-primary-dark) 100%);
    border-radius: var(--hear-radius);
    box-shadow: var(--hear-shadow-lg);
    text-align: center;
}

.hear-cta-content {
    max-width: 600px;
    margin: 0 auto;
}

.hear-cta-title {
    font-size: var(--text-xl);
    font-weight: 700;
    color: #fff;
    margin-bottom: var(--space-sm);
    letter-spacing: -0.02em;
}

.hear-cta-description {
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: var(--space-lg);
    line-height: 1.6;
}

.hear-cta-button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    background: #fff;
    color: var(--hear-primary);
    font-size: var(--text-base);
    font-weight: 700;
    text-decoration: none;
    border-radius: var(--hear-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: -0.01em;
}

.hear-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    background: #f8f9fa;
}

.hear-cta-button:active {
    transform: translateY(0);
}

.hear-cta-arrow {
    font-size: var(--text-lg);
    transition: transform 0.3s ease;
}

.hear-cta-button:hover .hear-cta-arrow {
    transform: translateX(4px);
}

/* Eligibility Information (Collapsible) */
.hear-eligibility-wrapper {
    margin-top: var(--space-xl);
}

.hear-eligibility-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    width: 100%;
    padding: var(--space-xs) var(--space-sm);
    border: none;
    background: transparent;
    color: var(--hear-text-secondary);
    font-size: var(--text-xs);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    border-radius: var(--hear-radius-sm);
}

.hear-eligibility-toggle:hover {
    color: var(--hear-primary);
    background: var(--hear-bg-light);
}

.hear-eligibility-toggle.active {
    color: var(--hear-primary);
}

.hear-eligibility-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 1px solid currentColor;
    border-radius: 3px;
    font-size: var(--text-xs);
    font-weight: 600;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.hear-eligibility-toggle:hover .hear-eligibility-toggle-icon,
.hear-eligibility-toggle.active .hear-eligibility-toggle-icon {
    background: var(--hear-primary);
    border-color: var(--hear-primary);
    color: #fff;
    transform: rotate(45deg);
}

.hear-eligibility-toggle-text {
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-size: 10px;
}

.hear-eligibility-info {
    margin-top: var(--space-sm);
    padding: var(--space-md);
    background: var(--hear-bg-light);
    border-radius: var(--hear-radius);
    border: 1px solid var(--hear-border-light);
    animation: slideDown 0.3s ease;
}

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

.hear-eligibility-title {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--hear-text-primary);
    margin-bottom: var(--space-sm);
    letter-spacing: -0.01em;
}

.hear-eligibility-info p {
    font-size: var(--text-xs);
    color: var(--hear-text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-sm);
}

.hear-eligibility-info p:last-child {
    margin-bottom: 0;
}

/* Disclaimer */
.hear-disclaimer {
    margin-top: var(--space-2xl);
    padding-top: var(--space-xl);
    border-top: 2px solid var(--hear-border-light);
}

.hear-disclaimer p {
    font-size: var(--text-xs);
    color: var(--hear-text-muted);
    line-height: 1.6;
    margin: 0;
    font-style: italic;
    max-width: 65ch;
}

/* Responsive Design - Tablet */
@media (max-width: 1024px) {
    .hear-rebates-calculator-wrapper {
        padding: var(--space-md) var(--space-sm);
    }
    
    .hear-calculator-container {
        padding: var(--space-xl) var(--space-lg);
    }
    
    .hear-calculator-title {
        font-size: var(--text-2xl);
        margin-bottom: var(--space-xl);
    }
    
    .hear-section {
        margin-bottom: var(--space-xl);
    }
    
    .hear-range-card {
        padding: var(--space-md) var(--space-lg);
    }
    
    .hear-range-card-value {
        font-size: var(--text-2xl);
    }
    
    .hear-rebates-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: var(--space-sm);
    }
}

/* Responsive Design - Mobile */
@media (max-width: 768px) {
    .hear-rebates-calculator-wrapper {
        padding: var(--space-sm);
    }
    
    .hear-calculator-container {
        padding: var(--space-lg) var(--space-md);
        border-radius: var(--hear-radius);
    }
    
    .hear-title-header {
        flex-wrap: wrap;
    }
    
    .hear-calculator-title {
        font-size: var(--text-xl);
        margin-bottom: 0;
        line-height: 1.2;
    }
    
    .hear-mode-toggle-wrapper {
        width: 100%;
        justify-content: center;
    }
    
    .hear-county-btn,
    .hear-county-dropdown-btn,
    .hear-county-dropdown-input {
        min-height: 32px;
        padding: 8px 14px;
    }
    
    .hear-advanced-inputs-row {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
    
    .hear-section {
        margin-bottom: var(--space-lg);
    }
    
    .hear-income-range-section {
        margin-bottom: var(--space-xl);
    }
    
    .hear-county-selection {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-xs);
    }
    
    .hear-county-btn,
    .hear-county-select-wrapper {
        width: 100%;
    }
    
    .hear-county-select {
        width: 100%;
    }
    
    .hear-household-control {
        width: 100%;
        justify-content: center;
        gap: var(--space-md);
    }
    
    .hear-range-card {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
        padding: var(--space-sm) var(--space-md);
    }
    
    .hear-range-card-value {
        font-size: var(--text-lg);
    }
    
    .hear-range-amount {
        font-size: var(--text-lg);
    }
    
    .hear-range-badge {
        align-self: stretch;
        text-align: center;
        padding: var(--space-xs) var(--space-sm);
    }
    
    .hear-county-dropdown-menu {
        left: 0;
        right: 0;
        min-width: 100%;
    }
    
    .hear-rebates-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .hear-bracket-toggle {
        width: 100%;
        justify-content: space-between;
    }
    
    .hear-toggle-option {
        flex: 1;
        justify-content: center;
    }
    
    .hear-rebates-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }
    
    .hear-rebate-card {
        padding: var(--space-sm);
    }
    
    .hear-rebate-option {
        padding: var(--space-sm);
    }
    
    .hear-rebate-option-amount {
        font-size: var(--text-lg);
    }
}

/* Responsive Design - Small Mobile */
@media (max-width: 480px) {
    .hear-rebates-calculator-wrapper {
        padding: var(--space-xs);
    }
    
    .hear-calculator-container {
        padding: var(--space-md) var(--space-sm);
        border-radius: var(--hear-radius);
    }
    
    .hear-title-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }
    
    .hear-calculator-title {
        font-size: var(--text-lg);
        margin-bottom: var(--space-md);
    }
    
    .hear-section {
        margin-bottom: var(--space-md);
    }
    
    .hear-range-card {
        padding: var(--space-sm) var(--space-md);
    }
    
    .hear-range-card-value {
        font-size: var(--text-lg);
    }
    
    .hear-range-amount {
        font-size: var(--text-lg);
    }
    
    .hear-rebates-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .hear-bracket-toggle {
        width: 100%;
        margin-top: var(--space-xs);
    }
    
    .hear-rebates-grid {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }
    
    .hear-rebate-card {
        padding: var(--space-sm);
    }
    
    .hear-rebate-option {
        padding: var(--space-sm);
    }
    
    .hear-rebate-option-amount {
        font-size: var(--text-base);
    }
    
    .hear-rebate-option-badge {
        min-width: 40px;
        height: 22px;
        font-size: 10px;
    }
    
    .hear-cta-section {
        padding: var(--space-lg);
    }
    
    .hear-cta-title {
        font-size: var(--text-lg);
    }
    
    .hear-cta-description {
        font-size: var(--text-xs);
    }
    
    .hear-cta-button {
        padding: var(--space-sm) var(--space-lg);
        font-size: var(--text-sm);
        width: 100%;
        justify-content: center;
    }
    
    .hear-eligibility-info {
        padding: var(--space-md);
    }
    
    .hear-eligibility-title {
        font-size: var(--text-base);
    }
    
    .hear-eligibility-info p {
        font-size: var(--text-xs);
    }
    
    .hear-eligibility-toggle {
        padding: var(--space-xs);
    }
    
    .hear-eligibility-toggle-text {
        font-size: 9px;
    }
}

/* Touch optimizations */
@media (hover: none) and (pointer: coarse) {
    .hear-control-btn {
        min-width: 48px;
        min-height: 48px;
    }
    
    .hear-county-btn,
    .hear-county-select {
        min-height: 48px;
    }
    
    
    .hear-range-card:hover {
        transform: none;
    }
}

/* Print styles */
@media print {
    .hear-calculator-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .hear-county-btn,
    .hear-county-select,
    .hear-control-btn {
        border: 1px solid #ddd;
    }
}
