/* --- ESTILOS CSS --- */
:root {
    --bg-color: #f5f5f7;
    --card-bg: #ffffff;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --accent-color: #0071e3;
    --accent-hover: #0077ed;
    --input-bg: #f5f5f7;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    --radius: 20px;
    --radius-sm: 12px;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 40px 20px;
}

.container {
    width: 100%;
    max-width: 900px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    flex: 1;
}

/* Ajustes Responsivos */
@media (min-width: 768px) {
    .container {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 767px) {
    body {
        padding: 20px 15px;
    }
    .card {
        padding: 25px;
    }
    h1 {
        font-size: 32px;
    }
    .result-value.large {
        font-size: 28px;
    }
}

/* Header */
.header-section {
    grid-column: 1 / -1;
    text-align: center;
    margin-bottom: 20px;
}

/* Aviso de seguridad / confianza */
.trust-banner {
    background: linear-gradient(135deg, #fff8e6 0%, #fff0c2 100%);
    border: 1px solid #ffd54f;
    border-radius: 16px;
    padding: 16px 20px;
    margin: 24px auto 0;
    max-width: 720px;
    font-size: 14px;
    line-height: 1.5;
    color: #5c4813;
    text-align: center;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.12);
}

.trust-banner strong {
    display: block;
    margin-bottom: 6px;
    font-size: 15px;
}

h1 {
    font-size: 48px;
    font-weight: 600;
    letter-spacing: -0.003em;
    margin-bottom: 10px;
}

p.subtitle {
    font-size: 21px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Estilos de Tarjeta */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px;
    transition: transform 0.3s ease;
    position: relative;
}

h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
}

/* Inputs */
.input-group {
    margin-bottom: 20px;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Botón pequeño de UF */
.btn-mini {
    background: rgba(0, 113, 227, 0.1);
    color: var(--accent-color);
    border: none;
    border-radius: 12px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-mini:hover {
    background: rgba(0, 113, 227, 0.2);
}

.btn-mini:disabled {
    opacity: 0.5;
    cursor: default;
}

input {
    width: 100%;
    padding: 16px;
    font-size: 17px;
    border: 1px solid transparent;
    background-color: var(--input-bg);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    transition: all 0.2s ease;
    outline: none;
    -webkit-appearance: none;
}

input:focus {
    background-color: #fff;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

/* --- GRUPO DE BOTONES (CALCULAR Y LIMPIAR) --- */
.button-group {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

/* Botón Calcular */
.btn-calculate {
    flex: 2;
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 18px;
    font-size: 17px;
    font-weight: 500;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn-calculate:hover {
    background-color: var(--accent-hover);
}

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

/* Botón Limpiar */
.btn-clear {
    flex: 1;
    background-color: transparent;
    color: var(--text-secondary);
    border: 2px solid #e5e5e5;
    padding: 18px;
    font-size: 17px;
    font-weight: 500;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn-clear:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.btn-clear:active {
    background-color: #f5f5f7;
}

/* Botón Descarga */
.btn-download {
    width: 100%;
    background-color: transparent;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
    padding: 12px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 20px;
    display: none;
    -webkit-tap-highlight-color: transparent;
}

.btn-download:hover {
    background-color: rgba(0, 113, 227, 0.05);
}

.btn-download.visible {
    display: block;
}

/* Sección de Resultados */
.results-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    opacity: 0.5;
    filter: blur(4px);
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.results-container.active {
    opacity: 1;
    filter: blur(0);
    pointer-events: auto;
}

.result-item {
    background-color: var(--input-bg);
    padding: 20px;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.result-item.highlight {
    background-color: rgba(0, 113, 227, 0.05);
    border: 1px solid rgba(0, 113, 227, 0.1);
}

.result-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 4px;
}

.result-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.result-value.large {
    font-size: 32px;
    color: var(--accent-color);
}

.result-sub {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Footer */
.footer {
    margin-top: 60px;
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.6;
}

.footer p {
    margin-bottom: 8px;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-note {
    max-width: 600px;
    margin: 12px auto 0;
    font-size: 12px;
    color: #a1a1a6;
}