:root {
    --primary: #7F7FD5;
    --secondary: #86A8E7;
    --accent: #91EAE4;
    --light: #f8f9fa;
    --dark: #343a40;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --border-radius: 10px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(to right, #91EAE4, #86A8E7, #7F7FD5);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 2rem;
    width: 100%;
}

h1 {
    font-family: 'Kaushan Script', 'Brush Script MT', cursive;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    /* Efeito de texto em gradiente */
    background: linear-gradient(to right, #6a6ac0, var(--dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.app-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media (min-width: 768px) {
    .app-container {
        flex-direction: row;
        align-items: flex-start;
    }
}

.calculator-section {
    flex: 1;
    background-color: rgba(255, 255, 255, 0.75);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--box-shadow);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.table-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.table-container {
    background-color: rgba(255, 255, 255, 0.75);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
    max-width: 500px;
}

.imc-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.imc-table th, .imc-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.imc-table th {
    background-color: var(--primary);
    color: white;
}

.imc-table tr:hover {
    background-color: rgba(127, 127, 213, 0.1);
}

.step {
    display: none;
    animation: fadeIn 0.6s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
}

.step.active {
    display: block;
}

/* Animação de entrada mais suave */
@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-title {
    margin-bottom: 1.5rem;
    color: var(--primary);
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

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

.input-group {
    display: flex;
    align-items: center;
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
}

.input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(127, 127, 213, 0.25);
}

.input-group input {
    flex: 1;
    border: none;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    outline: none;
}

.input-group .unit {
    padding: 0 1rem;
    background-color: #f8f9fa;
    color: #6c757d;
    font-weight: 500;
}

.btn {
    display: inline-block;
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    box-shadow: var(--box-shadow);
}

.btn:hover {
    background-color: #6a6ac0;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.result-container {
    text-align: center;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin: 1.5rem 0;
    background-color: #f8f9fa;
}

.result-value {
    font-size: 3rem;
    font-weight: 700;
    margin: 1rem 0;
    animation: zoomIn 0.5s ease-out;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.result-classification {
    font-size: 1.5rem;
    font-weight: 600;
}

.error {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

.input-error {
    border-color: var(--danger) !important;
}

.progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background-color: #e9ecef;
    transform: translateY(-50%);
    z-index: 1;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: var(--progress-percent, 0%);
    height: 4px;
    background-color: var(--primary);
    transform: translateY(-50%);
    z-index: 2;
    transition: var(--transition);
}

.progress-step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    position: relative;
    z-index: 3;
    transition: var(--transition);
}

.progress-step.active {
    background-color: var(--primary);
    color: white;
}

.progress-step:nth-child(2).active ~ .progress-bar::after {
    width: 50%;
}

.progress-step:nth-child(3).active ~ .progress-bar::after {
    width: 100%;
}

footer {
    margin-top: 2rem;
    text-align: center;
    color: rgba(0, 0, 0, 0.7);
    font-size: 0.875rem;
    width: 100%;
}

/* Cores para as classificações de IMC */
.abaixo-peso { color: var(--warning); }
.normal { color: var(--success); }
.sobrepeso { color: #fd7e14; }
.obesidade-1 { color: var(--danger); }
.obesidade-2 { color: #a71e2d; }
.obesidade-3 { color: #721c24; }

/* Responsividade para mobile */
@media (max-width: 767px) {
    .app-container {
        gap: 1rem;
    }
    
    .calculator-section,
    .table-container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .step-title {
        font-size: 1.4rem;
    }
    
    .result-value {
        font-size: 2.5rem;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .imc-table {
        font-size: 0.9rem;
    }
    
    .imc-table th,
    .imc-table td {
        padding: 0.5rem;
    }
}