:root {
    --hyundai-blue: #002D5B;
    --hyundai-accent: #00A0E9;
    --dark-gray: #2D2D2D;
    --medium-gray: #5A5A5A;
    --light-gray: #F5F7FA;
    --white: #FFFFFF;
    --card-blue: #4E79FF;
    --card-green: #59B75C;
    --card-orange: #FF9F40;
    --card-purple: #A15CFF;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--light-gray);
    color: var(--dark-gray);
    line-height: 1.6;
}

.calculator-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.calculator-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
    background: linear-gradient(135deg, var(--hyundai-blue) 0%, #004080 100%);
    border-radius: 15px;
    padding: 20px;
    color: white;
    box-shadow: 0 10px 20px rgba(0, 45, 91, 0.2);
}

.brand-logo {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.brand-logo img {
    height: 40px;
    margin-right: 15px;
}

.brand-logo h1 {
    font-weight: 600;
    font-size: 28px;
}

.brand-logo h1 span {
    font-weight: 300;
    opacity: 0.9;
}

.car-image img {
    width: 100%;
    max-width: 600px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    margin-top: 10px;
}

.calculator-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.input-section {
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.input-section h2 {
    color: var(--hyundai-blue);
    margin-bottom: 25px;
    font-size: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--medium-gray);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-with-icon {
    position: relative;
}

.input-with-icon .input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--hyundai-blue);
    font-weight: bold;
}

.input-group input {
    width: 100%;
    padding: 15px 15px 15px 40px;
    border: 2px solid #E0E5EC;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
    background-color: #F9FAFC;
}

.input-group input:focus {
    outline: none;
    border-color: var(--hyundai-accent);
    box-shadow: 0 0 0 3px rgba(0, 160, 233, 0.1);
}

.tenure-group {
    position: relative;
}

.tenure-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.toggle-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: #E0E5EC;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    flex: 1;
}

.toggle-btn.active {
    background: var(--hyundai-blue);
    color: white;
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.btn {
    padding: 15px 25px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 16px;
    flex: 1;
}

.btn i {
    font-size: 18px;
}

.calculate-btn {
    background: var(--hyundai-blue);
    color: white;
}

.calculate-btn:hover {
    background: #004080;
    transform: translateY(-2px);
}

.reset-btn {
    background: var(--medium-gray);
    color: white;
}

.reset-btn:hover {
    background: #424242;
    transform: translateY(-2px);
}

.result-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.result-card {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
}

.result-card:hover {
    transform: translateY(-5px);
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 24px;
    color: white;
}

.blue { background: var(--card-blue); }
.green { background: var(--card-green); }
.orange { background: var(--card-orange); }
.purple { background: var(--card-purple); }

.result-card h3 {
    color: var(--medium-gray);
    font-size: 16px;
    margin-bottom: 10px;
    font-weight: 500;
}

.result-card p {
    color: var(--dark-gray);
    font-size: 24px;
    font-weight: 600;
}

.emi-breakdown {
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    margin-top: 30px;
}

.emi-breakdown h3 {
    color: var(--hyundai-blue);
    margin-bottom: 20px;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.breakdown-chart {
    margin-top: 20px;
}

.chart {
    height: 30px;
    border-radius: 15px;
    background: #E0E5EC;
    overflow: hidden;
    display: flex;
    margin-bottom: 15px;
}

.chart-principal {
    background: var(--card-blue);
    height: 100%;
}

.chart-interest {
    background: var(--card-orange);
    height: 100%;
}

.chart-legend {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.chart-legend div {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.legend-principal {
    display: inline-block;
    width: 15px;
    height: 15px;
    border-radius: 3px;
    background: var(--card-blue);
}

.legend-interest {
    display: inline-block;
    width: 15px;
    height: 15px;
    border-radius: 3px;
    background: var(--card-orange);
}

@media (max-width: 768px) {
    .calculator-header {
        text-align: center;
        padding: 20px 15px;
    }
    
    .brand-logo {
        flex-direction: column;
    }
    
    .brand-logo img {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .input-section {
        padding: 20px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .result-section {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .result-section {
        grid-template-columns: 1fr;
    }
}