/* Variables CSS para los colores de la marca */
:root {
    --primary-color: #9fd30c;
    --secondary-color: #ed7419;
    --accent-color: #9fd30c;
    --danger-color: #ed7419;
    --success-color: #9fd30c;
    --warning-color: #ed7419;
    --info-color: #9fd30c;
    --light-bg: rgba(255, 255, 255, 0.95);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --border-radius: 15px;
}

/* Reset y configuración básica */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, rgba(159, 211, 12, 0.8) 0%, rgba(237, 116, 25, 0.8) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8ZGVmcz4KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0iZ3JhZGllbnQiIHgxPSIwJSIgeTE9IjAlIiB4Mj0iMTAwJSIgeTI9IjEwMCUiPgogICAgICA8c3RvcCBvZmZzZXQ9IjAlIiBzdHlsZT0ic3RvcC1jb2xvcjojOWZkMzBjO3N0b3Atb3BhY2l0eTowLjEiLz4KICAgICAgPHN0b3Agb2Zmc2V0PSIxMDAlIiBzdHlsZT0ic3RvcC1jb2xvcjojZWQ3NDE5O3N0b3Atb3BhY2l0eTowLjEiLz4KICAgIDwvbGluZWFyR3JhZGllbnQ+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZGllbnQpIi8+CiAgPGc+CiAgICA8cGF0aCBkPSJNMjAsMjAgQzMwLDEwIDUwLDMwIDcwLDIwIEMxMDAsMTAgMTIwLDUwIDEzMCw0MCBDMTU0LDI4IDE4MCw2MCAxODAsODBDMTgwLDEyMCAxNDAsMTQwIDEyMCwxMjAgQzEwMCwxMDAgODAsMTEwIDYwLDEwMEM0MCwxMzAgMjAsMTAwIDIwLDIwWiIgZmlsbD0iIzlmZDMwYyIgZmlsbC1vcGFjaXR5PSIwLjA1Ii8+CiAgPC9nPgo8L3N2Zz4='), 
                     linear-gradient(rgba(159, 211, 12, 0.1), rgba(237, 116, 25, 0.05));
    background-size: cover, cover;
    background-position: center, center;
    background-repeat: no-repeat, no-repeat;
    opacity: 0.4;
    z-index: -1;
}

/* Contenedor principal */
.calculator {
    max-width: 600px;
    width: 100%;
    background: var(--light-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 25px;
    animation: fadeInUp 0.6s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.2);
    /* max-height: 95vh; */
    /* overflow-y: auto; */
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Logo */
.logo-container {
    text-align: center;
    margin-bottom: 20px;
    animation: fadeIn 0.8s ease-out 0.2s both;
}

.logo-container img {
    max-width: 180px;
    height: auto;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

.logo-container img:hover {
    transform: scale(1.05);
}

/* Título */
.calculator h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #333;
    font-weight: 600;
    font-size: 1.8rem;
    animation: fadeIn 0.8s ease-out 0.4s both;
}

/* Grupos de inputs */
.input-group {
    margin-bottom: 15px;
    animation: slideInLeft 0.6s ease-out;
    animation-fill-mode: both;
}

.input-group:nth-child(1) { animation-delay: 0.1s; }
.input-group:nth-child(2) { animation-delay: 0.2s; }
.input-group:nth-child(3) { animation-delay: 0.3s; }

.calculator label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.02em;
    white-space: normal;
    word-break: break-word;
}

/* Controles de formulario */
.form-control {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(159, 211, 12, 0.25);
    background: white;
    transform: translateY(-1px);
}

.form-control:hover {
    border-color: #ccc;
    transform: translateY(-1px);
}

/* Botones */
.btn-calculate {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-color), #8bc34a);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
    position: relative;
    overflow: hidden;
    animation: slideInUp 0.6s ease-out 0.4s both;
}

.btn-calculate:hover {
    background: linear-gradient(135deg, #8bc34a, var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(159, 211, 12, 0.3);
}

.btn-calculate:active {
    transform: translateY(0);
}

.btn-calculate::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transition: all 0.3s ease;
    transform: translate(-50%, -50%);
}

.btn-calculate:active::before {
    width: 300px;
    height: 300px;
}

.btn-home {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    font-weight: 500;
    border: 2px solid var(--secondary-color);
    border-radius: 10px;
    background: transparent;
    color: var(--secondary-color);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-home:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(237, 116, 25, 0.3);
    text-decoration: none;
}

/* Resultados */
.result, .weight-levels {
    display: none;
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.result.show, .weight-levels.show {
    display: block;
    animation: slideInUp 0.5s ease-out;
}

/* Layout compacto para resultados */
.results-container {
    display: grid;
    gap: 15px;
    margin-top: 15px;
}

@media (min-width: 768px) {
    .results-container {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
}

/* Alertas */
.alert {
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
    border: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.alert-info {
    background: linear-gradient(135deg, var(--info-color), #8bc34a);
    color: white;
}

.alert-success {
    background: linear-gradient(135deg, var(--success-color), #8bc34a);
    color: white;
}

.alert-warning {
    background: linear-gradient(135deg, var(--warning-color), #ff5722);
    color: white;
}

.alert-danger {
    background: linear-gradient(135deg, var(--danger-color), #ff5722);
    color: white;
}

.bmi-result-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #555;
    margin-bottom: 0;
}

/* Tabla de niveles de peso */
.weight-levels h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-weight: 600;
    text-align: center;
    font-size: 1.2rem;
}

.table {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 0;
    font-size: 0.85rem;
}

.table th {
    background: linear-gradient(135deg, var(--primary-color), #8bc34a);
    color: white;
    font-weight: 600;
    border: none;
    padding: 10px;
    font-size: 0.8rem;
}

.table td {
    padding: 8px 10px;
    border: none;
    border-bottom: 1px solid #f0f0f0;
}

.table tbody tr:hover {
    background-color: rgba(159, 211, 12, 0.1);
    transform: translateX(3px);
    transition: all 0.3s ease;
}

/* Iconos en inputs */
.input-icon {
    position: relative;
}

.input-icon i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    transition: color 0.3s ease;
}

.form-control:focus + i {
    color: var(--primary-color);
}

/* Animación de carga */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

/* Estilos para elementos de la marca */
.text-primary-brand {
    color: var(--primary-color) !important;
}

.text-secondary-brand {
    color: var(--secondary-color) !important;
}

.border-brand {
    border-color: var(--primary-color) !important;
}

/* Enlaces dentro de los resultados */
.bmi-result-text a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: underline;
    transition: all 0.3s ease;
}

.bmi-result-text a:hover {
    color: var(--secondary-color);
    text-decoration: none;
    transform: translateX(2px);
}

/* Botón de acción adicional */
.action-button {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary-color), #8bc34a);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: none;
}

.action-button:hover {
    background: linear-gradient(135deg, var(--secondary-color), #ff7043);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(159, 211, 12, 0.3);
}

/* Mejoras adicionales */
.calculator::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--border-radius);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.calculator:hover::before {
    opacity: 0.1;
}

/* Responsive */
@media (max-width: 576px) {
    .calculator {
        margin: 10px;
        padding: 15px;
        /* max-height: 90vh; */
    }
    
    .calculator h2 {
        font-size: 1.4rem;
        margin-bottom: 20px;
    }
    
    .logo-container img {
        max-width: 150px;
    }
    
    .logo-container {
        margin-bottom: 15px;
    }
    
    .input-group {
        margin-bottom: 12px;
    }
    
    .form-control {
        padding: 10px;
        font-size: 14px;
    }
    
    .table {
        font-size: 0.8rem;
    }
    
    .table th, .table td {
        padding: 6px 8px;
    }
    
    .results-container {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}
.calculator label[for="unitSystem"] {
    min-width: 180px;
    display: inline-block;
    vertical-align: middle;
}
#unitSystem {
    min-width: 260px;
    padding: 6px 12px;
    font-size: 1rem;
    vertical-align: middle;
}
.calculator .form-group {
    display: flex;
    align-items: center;
    gap: 10px;
}