.app-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.calculator-panel {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 2rem;
}

.form-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.form-row .input-group {
    flex: 1;
    margin-bottom: 0;
}

@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
        gap: 1rem;
    }
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

input {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

button {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

button:hover {
    background: var(--primary-dark);
}

button:active {
    transform: scale(0.99);
}

.results-panel {
    margin-top: 2rem;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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

.result-card.primary {
    background: var(--primary);
    color: white;
}

.result-card.primary .value,
.result-card.primary h3 {
    color: white;
}

.result-card.secondary {
    background: var(--secondary);
    color: white;
}

.result-card.secondary .value,
.result-card.secondary h3 {
    color: white;
}

.result-card h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.8rem;
    color: var(--text-muted);
}

.result-card .value {
    font-size: 1.8rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
}

.result-card .unit {
    font-size: 0.8rem;
    margin-top: 0.2rem;
}

.chart-container {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.chart-container h3 {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    font-family: 'Outfit', sans-serif;
}

.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 768px) {
    .app-wrapper {
        padding: 1rem 0.75rem;
    }

    header {
        margin-bottom: 1.5rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    header p {
        font-size: 0.95rem;
    }

    .calculator-panel {
        padding: 1.25rem;
        border-radius: 0.75rem;
    }

    .form-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .results-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .result-card {
        padding: 1rem;
    }

    .result-card .value {
        font-size: 1.4rem;
    }

    .chart-container {
        padding: 1rem;
    }

    .chart-container h3 {
        font-size: 1rem;
    }
}

@media (max-width: 400px) {
    h1 {
        font-size: 1.25rem;
    }

    .calculator-panel {
        padding: 1rem;
    }

    button {
        font-size: 1rem;
        padding: 0.8rem;
    }
}