/* ===== Variables Globales (Alineadas con el Tema Oscuro Slate/RF) ===== */
:root {
    /* Paleta Oscura Principal */
    --bg-body: #0b1329;        /* Fondo global del body */
    --bg-card: #0f172a;        /* Contenedor de la calculadora y modales (Slate 900) */
    --bg-input: #1e293b;       /* Inputs, campos de texto y tarjetas secundarias (Slate 800) */

    --gold: #b8976a;
    
    --text-primary: #f8fafc;    /* Texto principal de alto contraste */
    --text-secondary: #94a3b8;  /* Texto secundario y etiquetas */
    --border-light: #1e293b;    /* Bordes sutiles para tarjetas e inputs */
    --border-hover: #334155;    /* Bordes interactivos */
    
    --shadow-card: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    --radius-card: 28px;
    --radius-btn: 40px;
    
    --blue-accent: #3b82f6;
    --blue-hover: #2563eb;
    --green-accent: #10b981;
    --green-hover: #059669;
    
    --font: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
    --max-w: 1200px;
    --px: clamp(16px, 4vw, 24px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
}

/* ===== HEADER ===== */
.header {
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
}

.header h1 i {
    color: var(--blue-accent);
}

.header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: 8px;
}

.header a {
    color: var(--blue-accent);
    text-decoration: underline;
    font-weight: bolder;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    gap: 6px;
    margin-top: 10px;
    font-weight: 500;
    transition: color 0.15s;
}

.header a:hover {
    color: var(--gold);
   
}

/* ===== CALCULADORA ===== */
#calculator {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-card);
    padding: 32px;
    box-shadow: var(--shadow-card);
    margin-bottom: 20px;
}

#calculator .form-group {
    margin-bottom: 18px;
}

#calculator .form-group label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: var(--text-primary);
}

#calculator .form-group .help-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

#calculator .form-group input,
#calculator .form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    font-family: var(--font);
    font-size: 0.95rem;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: border-color 0.15s, box-shadow 0.15s;
}

#calculator .form-group input:focus,
#calculator .form-group select:focus {
    outline: none;
    border-color: var(--blue-accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ===== BOTONES ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    border: none;
    border-radius: var(--radius-btn);
    font-family: var(--font);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.15s ease;
    width: 100%;
}

.btn-primary {
    background: var(--blue-accent);
    color: white;
}

.btn-primary:hover {
    background: var(--blue-hover);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -8px rgba(59, 130, 246, 0.5);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-success {
    background: var(--green-accent);
    color: white;
}

.btn-success:hover {
    background: var(--green-hover);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -8px rgba(16, 185, 129, 0.4);
}

/* ===== RESULTADOS ===== */
#resultados {
    display: none;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
}

#resultados .metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

#resultados .metric-card {
    background: var(--bg-input);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 16px;
    border-radius: 16px;
    text-align: center;
}

#resultados .metric-card .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

#resultados .metric-card .value.green {
    color: var(--green-accent);
}

#resultados .metric-card .value.blue {
    color: var(--blue-accent);
}

#resultados .metric-card .label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

#resultados .recomendaciones {
    background: var(--bg-input);
    padding: 16px 20px;
    border-radius: 16px;
    margin-bottom: 16px;
    border-left: 4px solid var(--blue-accent);
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    border-right: 1px solid rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

#resultados .recomendaciones h4 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

#resultados .recomendaciones ul {
    margin: 0;
    padding-left: 20px;
}

#resultados .recomendaciones li {
    margin-bottom: 4px;
    color: var(--text-secondary);
}

#resultados .btn-success {
    margin-top: 8px;
}

/* ===== SPINNER ===== */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== FOOTER ===== */
.footer {
    margin-top: 40px;
    padding: 20px 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-light);
}

.footer a {
    color: var(--blue-accent);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Ajustes de iconos en labels y headers */
.form-group label .material-icons,
.recomendaciones h4 .material-icons {
    font-size: 20px;
    color: var(--blue-accent);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    #resultados .metrics-grid {
        grid-template-columns: 1fr;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    #calculator {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 12px;
    }
    .header h1 {
        font-size: 1.4rem;
    }
    #calculator {
        padding: 16px;
    }
}
