/* Import Sofia Sans font */
@import url('https://fonts.googleapis.com/css2?family=Sofia+Sans:wght@400;500;600;700&display=swap');

:root {
    /* Design system colors matching React version */
    --background: hsl(0, 0%, 100%);
    --foreground: hsl(222.2, 84%, 4.9%);
    --primary: #2A60DF;
    --primary-dark: #2A60DF;
    --secondary:#72C046;
    --secondary-dark: #72C046;
    --muted: hsl(210, 40%, 94%);
    --muted-foreground: #747a89;
    --card: hsl(0, 0%, 100%);
    --card-hover: hsl(210, 40%, 98%);
    --border: hsl(214.3, 31.8%, 91.4%);
    --destructive: hsl(0, 84%, 60%);
    --success: #72C046;
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-card-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 0.75rem;
    --radius-large: 1.25rem;
}

* {
    box-sizing: border-box;
}

.savings-calculator {
    font-family: 'Sofia Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    max-width: 100%;
    margin: 0;    
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius);
    padding: 4rem 1.5rem;
    text-align: center;
    margin-bottom: 2rem;
    color: white;
}

.hero-content {
    max-width: 64rem;
    margin: 0 auto;
}

.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
    line-height: 1.1;
}

.hero-section p {
    font-size: 1.25rem;
    opacity: 0.9;
    margin: 0;
}

@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    .hero-section p {
        font-size: 1.1rem;
    }
}

/* Main Grid */
.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 1024px) {
    .calculator-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Input Groups */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.section-header {
    margin-bottom: 1rem;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 0.5rem;
    margin-top: 0;
}

.section-header p {
    color: var(--muted-foreground);
    margin: 0;
    font-size: 0.875rem;
}

.input-group {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.input-group:hover {
    box-shadow: var(--shadow-card-hover);
}

.step-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.step-number {
    width: 2rem;
    height: 2rem;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

.step-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--foreground);
    margin: 0;
}

/* Selection Cards */
.selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
}

.selection-card {
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.selection-card:hover {
    transform: scale(1.05);
    background: var(--card-hover);
}

.selection-card.active {
    border-color: var(--primary);
    background: hsl(214, 100%, 97%);
    box-shadow: 0 0 0 2px var(--primary);
}

.selection-card .icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

.selection-card .title {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--foreground);
    margin-bottom: 0.25rem;
}

.selection-card .desc {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    line-height: 1.3;
}

/* Form Controls */
.form-group {
    margin-bottom: 1.5rem;
}

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

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.slider-label {
    font-weight: 500;
    color: var(--foreground);
    font-size: 0.875rem;
}

.slider-value {
    background: var(--card-hover);
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--foreground);
}

/* Range Sliders */
.range-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 0.5rem;
    border-radius: 0.5rem;
    background: var(--muted);
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.range-slider::-moz-range-thumb {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.range-slider::-moz-range-track {
    height: 0.5rem;
    border-radius: 0.5rem;
    background: var(--muted);
    cursor: pointer;
    border: none;
}

.range-minmax {
    display: flex;
    justify-content: space-between;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

/* Results Section */
.results-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.main-result-card {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    color: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.1), 0 4px 6px -2px rgba(16, 185, 129, 0.05);
}

.main-result {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.result-icon {
    font-size: 2.5rem;
}

.result-content {
    flex: 1;
}

.result-content .result-label {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 0.25rem;
}

.result-content .result-amount {
    font-size: 1.875rem;
    font-weight: 700;
    color: white;
    line-height: 1;
    margin: 0;
}

/* Progress Bar */
.progress-container {
    margin-top: 1rem;
}

.progress-bar {
    width: 100%;
    height: 0.75rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0.375rem;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-fill {
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 0.375rem;
    transition: width 0.5s ease;
}

.progress-text {
    text-align: right;
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
}

/* Cost Breakdown */
.cost-breakdown {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.cost-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-card);
}

.cost-item .cost-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

.cost-item .cost-label {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin-bottom: 0.25rem;
}

.cost-item .cost-amount {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.cost-current {
    color: var(--destructive);
}

.cost-new {
    color: var(--success);
}

/* CTA Card */
.cta-card {
    background: var(--card);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: 0.5rem;
    text-align: center;
    box-shadow: var(--shadow-card);
}

.recommendation {
    margin-bottom: 1rem;
}

.recommendation-label {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin-bottom: 0.5rem;
    display: inline;
    margin-right: 0.5rem;
}

.recommended-model {
    display: inline;
    background: hsl(210, 40%, 96%);
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-weight: 500;
    color: hsl(224, 71%, 4%);
    font-size: 0.875rem;
}

.disclaimer {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    line-height: 1.4;
    margin-top: 0.75rem;
    margin-bottom: 1rem;
    text-align: center;
}

.cta-button {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.cta-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
   
    .hero-section {
        padding: 2rem 1.5rem;
    }
    
    .selection-grid {
        grid-template-columns: 1fr;
    }
    
    .cost-breakdown {
        grid-template-columns: 1fr;
    }
    
    .main-result {
        flex-direction: column;
        text-align: center;
    }
    
    .result-content .result-amount {
        font-size: 2rem;
    }
}