* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f5f5;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 40px auto;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,.08);
}

h1 {
    margin-bottom: 25px;
    text-align: center;
}

form {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(220px,1fr));
    gap: 20px;
}

.field {
    display: flex;
    flex-direction: column;
}

label {
    margin-bottom: 8px;
    font-weight: bold;
}

select,
input {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 15px;
}

button {
    grid-column: 1 / -1;
    padding: 12px;
    border: none;
    border-radius: 5px;
    background: #0077ff;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.2s ease, opacity 0.2s ease;
}

button:hover {
    background: #005fd1;
}

button:disabled {
    cursor: progress;
    opacity: 0.85;
}

.spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

#calculate.loading .spinner {
    display: inline-block;
}

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

hr {
    margin: 35px 0;
}

#results {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(220px,1fr));
    gap: 20px;
}

.result-card {
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 18px;
}

.result-card h3 {
    margin-bottom: 10px;
}

.result-card p {
    margin: 5px 0;
}