/* --- Estilos Base --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #f4f7f6;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.app-container {
    background: #ffffff;
    width: 100%;
    max-width: 450px;
    padding: 30px 20px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* --- Cabecera e Idioma --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
}

h1 {
    font-size: 1.4rem;
    color: #1a1a1a;
}

.language-switch button {
    background: #e0e0e0;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    color: #555;
    transition: all 0.2s ease;
}

.language-switch button.active {
    background: #2ecc71;
    color: white;
}

.subtitle {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.4;
}

/* --- Gestión de Vistas (Navegación SPA) --- */
.view-hidden {
    display: none;
}

.view-active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

/* --- Vista Landing --- */
.landing-content {
    text-align: center;
    padding: 10px 0;
}

.landing-content h2 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.nav-btn {
    width: 100%;
    padding: 16px;
    margin-bottom: 15px;
    border-radius: 12px;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: transform 0.1s ease, filter 0.2s ease;
}

.nav-btn:active {
    transform: scale(0.98);
}

.primary-btn {
    background: #2ecc71;
    color: white;
}

.secondary-btn {
    background: #3498db;
    color: white;
}

.nav-btn:hover {
    filter: brightness(0.9);
}

/* --- Elementos de Navegación Interior --- */
.back-btn {
    background: none;
    border: none;
    color: #7f8c8d;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-bottom: 15px;
}

.back-btn:hover {
    color: #2c3e50;
}

.view-title {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 5px;
}

/* --- Controles Multimodales (Tramos) --- */
.legs-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 15px;
}

.leg-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 15px;
    position: relative;
    animation: fadeIn 0.3s ease-out;
}

.leg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.leg-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #95a5a6;
    text-transform: uppercase;
}

.delete-leg-btn {
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
}

.add-leg-btn {
    width: 100%;
    padding: 14px;
    background: transparent;
    border: 2px dashed #bdc3c7;
    color: #7f8c8d;
    font-weight: bold;
    border-radius: 12px;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.2s ease;
}

.add-leg-btn:hover {
    border-color: #95a5a6;
    color: #34495e;
    background: #f1f2f6;
}

/* --- Inputs y Formularios --- */
.input-group {
    margin-bottom: 15px;
}

label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #444;
}

input[type="number"], select {
    width: 100%;
    height: 48px;
    padding: 0 12px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: #fff;
}

input[type="number"]:focus, select:focus {
    outline: none;
    border-color: #2ecc71;
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.15);
}

.calculate-btn {
    width: 100%;
    height: 52px;
    background-color: #2ecc71;
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    margin-top: 10px;
}

.calculate-btn:hover {
    background-color: #27ae60;
}

/* --- Sliders Sincronizados --- */
.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.slider-container input[type="range"] {
    flex-grow: 1;
    height: 6px;
    background: #e0e0e0;
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none;
    accent-color: #2ecc71; /* Color verde para navegadores modernos */
}

/* Reducimos el ancho de la caja de número para que el slider respire */
.slider-container input[type="number"] {
    width: 70px;
    height: 44px;
    text-align: center;
    padding: 0 5px;
}

/* --- Tarjeta de Resultados --- */
.result-hidden {
    display: none;
}

.result-visible {
    display: block;
    margin-top: 25px;
    padding: 20px;
    background-color: #f0fdf4;
    border: 2px solid #bbf7d0;
    border-radius: 16px;
    text-align: center;
    animation: fadeIn 0.4s ease-out;
}

.result-visible h2 {
    font-size: 1.1rem;
    color: #166534;
    margin-bottom: 5px;
}

.highlight-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: #15803d;
    margin-bottom: 10px;
}

.context-message {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 15px;
}

/* --- Grid de Equivalencias --- */
.equivalencies-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 15px;
    border-top: 1px solid #bbf7d0;
    padding-top: 15px;
}

.equiv-card {
    background: rgba(255, 255, 255, 0.6);
    padding: 10px 5px;
    border-radius: 8px;
}

.equiv-icon {
    font-size: 1.6rem;
    margin-bottom: 5px;
}

.equiv-val {
    font-size: 1rem;
    font-weight: bold;
    color: #166534;
}

.equiv-label {
    font-size: 0.75rem;
    color: #166534;
    line-height: 1.2;
}

/* --- Pie de Página (Logos) --- */
.partner-logos {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.logo-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-logo {
    max-height: 40px;
    width: auto;
    filter: grayscale(20%);
    opacity: 0.8;
}

/* --- Animaciones --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}