* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    color: #333;
}

.container {
    width: 100%;
    max-width: 500px;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 0.5rem;
}

header p {
    color: #4a5568;
    font-size: 0.95rem;
}

.card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05), inset 0 0 0 1px rgba(255,255,255,0.5);
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #4a5568;
}

.select-wrapper {
    position: relative;
}

select {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    appearance: none;
}

select:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

.select-wrapper::after {
    content: "▼";
    font-size: 0.8rem;
    color: #a0aec0;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

button {
    width: 100%;
    padding: 14px;
    background: #3182ce;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

button:hover:not(:disabled) {
    background: #2b6cb0;
}

button:active:not(:disabled) {
    transform: scale(0.98);
}

button:disabled {
    background: #a0aec0;
    cursor: not-allowed;
}

.hidden {
    display: none !important;
}

.result-card {
    border-top: 4px solid #48bb78;
    animation: fadeIn 0.4s ease forwards;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #edf2f7;
}

.result-header h2 {
    font-size: 1.2rem;
    color: #2d3748;
}

.badge {
    background: #c6f6d5;
    color: #22543d;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.tolerancias-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.tol-item {
    background: #f7fafc;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.tol-label {
    display: block;
    font-size: 0.75rem;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.tol-val {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
}

.error-state {
    background: #fed7d7;
    color: #9b2c2c;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    border: 1px solid #feb2b2;
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
