/* ========================================= */
/*      TEMA MINIMALISTA OSCURO V1.0         */
/* ========================================= */

/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #e0e0e0; /* Texto principal claro */
    background-color: #121212; /* Fondo principal muy oscuro */
    min-height: 100vh;
}

/* Contenedor principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    color: #ffffff;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    text-shadow: none; /* Eliminado el shadow para un look más plano */
}

.subtitle {
    font-size: 1.1rem;
    color: #b0b0b0; /* Un gris más suave para el subtítulo */
    font-weight: 300;
}

/* Contenedor de la calculadora */
.calculator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

/* Estilo base para todas las secciones "tarjeta" */
.input-section,
.results-section,
.desglose-section,
.instructions-section {
    background: #1e1e1e; /* Fondo de tarjeta ligeramente más claro */
    padding: 30px;
    border-radius: 10px; /* Bordes un poco menos redondeados */
    border: 1px solid #333; /* Borde sutil para definir la tarjeta */
    box-shadow: none; /* Sin sombras para un diseño plano */
    transition: border-color 0.3s ease;
}

.input-section:hover,
.results-section:hover {
    border-color: #4db6ac; /* Color de acento al pasar el ratón */
}

/* Títulos de sección (H2) */
.input-section h2,
.results-section h2,
.desglose-section h2,
.instructions-section h2 {
    color: #ffffff;
    margin-bottom: 25px;
    font-size: 1.4rem;
    font-weight: 500;
    border-bottom: 2px solid #4db6ac; /* Color de acento para el borde inferior */
    padding-bottom: 10px;
}

/* Grupos de formulario */
.form-group {
    position: relative;
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 400;
    color: #b0b0b0;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 1px solid #444; /* Borde más oscuro */
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #121212; /* Fondo del input igual al body */
    color: #e0e0e0;
}

.form-group input:focus {
    outline: none;
    border-color: #4db6ac;
    background: #1e1e1e; /* Cambia a color de tarjeta al enfocar */
    box-shadow: none;
}

/* Símbolos de moneda y porcentaje */
.currency,
.percentage {
    position: absolute;
    right: 15px;
    top: 55%; /* Ajuste fino de posición */
    transform: translateY(-50%);
    color: #777;
    pointer-events: none;
}

/* Grupo de botones */
.button-group {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Botón Primario (Calcular) */
.btn-primary {
    background: #4db6ac; /* Color de acento */
    color: #121212; /* Texto oscuro para contraste */
}

.btn-primary:hover {
    background: #5dc6bb;
    transform: none; /* Sin movimiento */
    box-shadow: none;
}

/* Botón Secundario (Limpiar) */
.btn-secondary {
    background: #333;
    color: #b0b0b0;
}

.btn-secondary:hover {
    background: #444;
    transform: none;
}

/* Botón Terciario (Desglose) */
.btn-tertiary {
    background: transparent;
    color: #4db6ac;
    border: 1px solid #4db6ac;
    flex: none;
    width: 100%;
}

.btn-tertiary:hover {
    background: rgba(77, 182, 172, 0.1);
    transform: none;
}

.btn:active {
    transform: scale(0.98); /* Pequeña animación al hacer clic */
}

/* Sección de resultados */
.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5px;
    border-bottom: 1px solid #333;
    transition: background-color 0.3s ease;
}

.result-item:last-of-type {
    border-bottom: none;
}

.result-item label {
    font-weight: 400;
    color: #b0b0b0;
}

.result-value {
    font-weight: 600;
    font-size: 1.1rem;
    color: #ffffff;
}

/* Filas destacadas en resultados */
.result-item.highlight {
    background: rgba(77, 182, 172, 0.05); /* Tinte de color de acento muy sutil */
    border-radius: 6px;
    padding: 20px 15px;
    margin: 10px 0;
    border: 1px solid #4db6ac;
}

.result-item.highlight label,
.result-item.highlight .result-value {
    color: #4db6ac;
    font-size: 1.2rem;
}

.desglose-button-container {
    margin-top: 20px;
    border-top: 1px solid #333;
    padding-top: 20px;
}

/* Sección de Desglose */
.desglose-section {
    grid-column: 1 / -1;
}

.desglose-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    font-size: 1rem;
}

.desglose-separator {
    height: 1px;
    background-color: #333;
    margin: 10px 0;
}

.desglose-item.total {
    font-size: 1.2rem;
    color: #4db6ac;
}

/* Sección de instrucciones */
.instructions-section {
    grid-column: 1 / -1;
}

.instructions-content h3 {
    color: #4db6ac;
    margin: 25px 0 15px 0;
    font-size: 1.2rem;
}

/* Mensaje de error */
.error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4d2323; /* Rojo oscuro */
    color: #ffbaba; /* Rojo claro para el texto */
    padding: 15px 20px;
    border-radius: 6px;
    border-left: 4px solid #e53e3e; /* Borde rojo vivo */
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 400px;
    z-index: 1000;
}

.error-message.hidden, .hidden {
    display: none;
}

#close-error {
    background: none;
    border: none;
    color: #ffbaba;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Footer */
footer {
    text-align: center;
    color: #777; /* Gris para el footer */
    margin-top: 40px;
    padding: 20px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 { font-size: 2rem; }
    .calculator-container { grid-template-columns: 1fr; }
    .button-group { flex-direction: column; }
    .error-message { top: 10px; left: 10px; right: 10px; max-width: none; }
}

/* Animaciones de entrada (mantenidas por ser sutiles) */
@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}
.form-group { animation: fadeInUp 0.5s ease forwards; opacity: 0; transform: translateY(15px); }
.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.15s; }
.form-group:nth-child(3) { animation-delay: 0.2s; }
.form-group:nth-child(4) { animation-delay: 0.25s; }
.form-group:nth-child(5) { animation-delay: 0.3s; }
.form-group:nth-child(6) { animation-delay: 0.35s; }
.button-group { animation-delay: 0.4s; }

/* Estado de carga */
.calculating {
    cursor: wait;
    opacity: 0.7;
}

/* Accesibilidad del Focus */
.btn:focus,
.form-group input:focus {
    outline: 2px solid #4db6ac;
    outline-offset: 2px;
}
.form-group input:focus {
    border-color: #4db6ac;
}