:root {
    --bg-color:#f4f4f9;
    --card-bg:#ffffff;
    --text-main:#333333;
    --accent: #005f73;
    --accent-hover: #0a9396;
    --error: #ae2012;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    color: var(--text-main);
}

.calculator-container {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 800px;
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 30px;
    padding: 30px;
}

.inputs-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative; 
    padding-bottom: 20px;
}

label {
    font-weight: 600;
    font-size: 0.9rem;
}

input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}
input[type="number"]:focus, button:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 95, 115, 0.2);
}

.tip-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.tip-btn {
    padding: 12px;
    background: #e0e0e0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    transition: background 0.2s, color 0.2s;
}

.tip-btn:hover {
    background: #d0d0d0;
}

.tip-btn.active {
    background: var(--accent);
    color: white;
}

.error-msg {
    color: var(--error);
    font-size: 0.8rem;
    position: absolute;
    bottom: 0;
    left: 0;
}

.hidden {
    display: none;
}

.results-section {
    background: var(--accent);
    color: white;
    border-radius: 12px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.result-row.highlight {
    font-size: 1.5rem;
    font-weight: bold;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.2);
}

#reset-btn {
    width: 100%;
    padding: 15px;
    background: white;
    color: var(--accent);
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    text-transform: uppercase;
    margin-top: 30px;
}

#reset-btn:hover {
    background: #f0f0f0;
}

@media (max-width: 768px) {
    .calculator-container {
        grid-template-columns: 1fr; 
        padding: 20px;
    }
    
    .results-section {
        padding: 20px;
    }
}