:root {
    --bg-card-light: #35151A;
}

body { overflow-x: hidden; line-height: 1.6; }

/* NAVBAR (la base está en /css/navbar.css; aquí la transición y los enlaces son algo distintos) */
.navbar { transition: all 0.4s; }
.nav-links a { font-weight: 400; }

/* HERO */
.hero {
    min-height: 60vh; display: flex; align-items: center;
    justify-content: center; position: relative;
    padding: 8rem 2rem 3rem; overflow: hidden;
}
.hero-bg {
    position: absolute; inset: 0; z-index: 0;
}
.hero-bg::before {
    content: ''; position: absolute; top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(ellipse at 30% 20%, rgba(123, 45, 53, 0.15) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 60%, rgba(201, 168, 76, 0.05) 0%, transparent 50%);
    animation: heroBgMove 20s ease-in-out infinite alternate;
}
@keyframes heroBgMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-2%, -1%); }
}
.hero-content { position: relative; z-index: 1; text-align: center; max-width: 800px; }
.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5vw, 3.5rem); font-weight: 600;
    line-height: 1.1; margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: clamp(0.95rem, 1.8vw, 1.15rem); color: var(--cream);
    opacity: 0.6; max-width: 600px; margin: 0 auto;
    font-weight: 300; line-height: 1.7;
}

/* MAIN CALCULATOR */
.calculator-section {
    padding: 2rem 2rem 6rem; position: relative;
}
.calc-container {
    max-width: 1300px; margin: 0 auto;
    display: grid; grid-template-columns: 1fr 1fr; gap: 2rem;
}

/* PANELS */
.panel {
    background: rgba(42, 16, 21, 0.7);
    border: 1px solid rgba(123, 45, 53, 0.25);
    border-radius: 20px; padding: 2rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
}
.panel:hover { border-color: rgba(123, 45, 53, 0.4); }
.panel-title {
    font-family: var(--font-display);
    font-size: 1.3rem; font-weight: 600;
    margin-bottom: 0.3rem; display: flex;
    align-items: center; gap: 0.6rem;
}
.panel-subtitle {
    font-size: 0.85rem; color: var(--cream); opacity: 0.55;
    margin-bottom: 1.8rem;
}

/* INPUT GROUPS */
.input-group {
    margin-bottom: 1.5rem;
}
.input-label {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 0.6rem;
}
.input-label-text {
    font-size: 0.85rem; font-weight: 500; color: var(--cream); opacity: 0.8;
}
.input-label-text small {
    font-weight: 300; opacity: 0.7; margin-left: 0.3rem;
}
.input-value-display {
    font-family: var(--font-num); font-variant-numeric: tabular-nums;
    font-size: 0.85rem; font-weight: 500;
    color: var(--gold); background: rgba(201, 168, 76, 0.08);
    padding: 0.2rem 0.6rem; border-radius: 6px;
    border: 1px solid rgba(201, 168, 76, 0.15);
}

/* CUSTOM RANGE SLIDER */
.slider-container {
    position: relative; padding: 0.5rem 0;
}
input[type="range"] {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 6px;
    background: rgba(123, 45, 53, 0.3);
    border-radius: 3px; outline: none;
    cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 22px; height: 22px;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    border-radius: 50%; cursor: pointer;
    box-shadow: 0 2px 10px rgba(201, 168, 76, 0.4);
    transition: transform 0.2s;
}
input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}
input[type="range"]::-moz-range-thumb {
    width: 22px; height: 22px;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    border-radius: 50%; cursor: pointer; border: none;
    box-shadow: 0 2px 10px rgba(201, 168, 76, 0.4);
}

/* FIRE TIERS */
.fire-tiers {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.fire-tier {
    padding: 1rem; border-radius: 12px;
    border: 1px solid rgba(123, 45, 53, 0.2);
    background: rgba(26, 10, 14, 0.4);
    cursor: pointer; transition: all 0.3s;
    text-align: center;
}
.fire-tier:hover { border-color: rgba(201, 168, 76, 0.3); }
.fire-tier.active {
    border-color: var(--gold);
    background: rgba(201, 168, 76, 0.08);
    box-shadow: 0 0 20px rgba(201, 168, 76, 0.1);
}
.fire-tier-icon { font-size: 1.5rem; margin-bottom: 0.3rem; }
.fire-tier-name {
    font-family: var(--font-display);
    font-size: 0.9rem; font-weight: 600; margin-bottom: 0.2rem;
}
.fire-tier-desc {
    font-size: 0.7rem; color: var(--cream); opacity: 0.55;
}
.fire-tier-amount {
    font-family: var(--font-num); font-variant-numeric: tabular-nums;
    font-size: 0.8rem; color: var(--gold);
    margin-top: 0.4rem; font-weight: 500;
}

/* RESULTS */
.results-panel {
    position: static;
}
.result-hero {
    text-align: center; padding: 2rem 1rem;
    background: linear-gradient(135deg, rgba(123, 45, 53, 0.2), rgba(201, 168, 76, 0.05));
    border-radius: 16px; margin-bottom: 1.5rem;
    border: 1px solid rgba(201, 168, 76, 0.15);
}
.result-hero-label {
    font-size: 0.8rem; text-transform: uppercase;
    letter-spacing: 2px; color: var(--cream); opacity: 0.55;
    margin-bottom: 0.5rem;
}
.result-hero-value {
    font-family: var(--font-display);
    font-size: 3rem; font-weight: 600;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.result-hero-sub {
    font-size: 0.9rem; color: var(--cream); opacity: 0.6;
    margin-top: 0.3rem;
}

.result-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.result-card {
    padding: 1rem; border-radius: 12px;
    background: rgba(26, 10, 14, 0.5);
    border: 1px solid rgba(123, 45, 53, 0.15);
    text-align: center;
}
.result-card-value {
    font-family: var(--font-num); font-variant-numeric: tabular-nums;
    font-size: 1.3rem; font-weight: 600;
    margin-bottom: 0.2rem;
}
.result-card-label {
    font-size: 0.75rem; color: var(--cream); opacity: 0.55;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.result-card-value.gold { color: var(--gold); }
.result-card-value.green { color: var(--success); }
.result-card-value.blue { color: var(--blue); }

/* PROGRESS BAR */
.fire-progress {
    margin-bottom: 1.5rem;
}
.fire-progress-header {
    display: flex; justify-content: space-between;
    margin-bottom: 0.5rem;
}
.fire-progress-label {
    font-size: 0.85rem; font-weight: 500;
}
.fire-progress-percent {
    font-family: var(--font-num); font-variant-numeric: tabular-nums;
    font-size: 0.85rem; color: var(--gold);
}
.fire-progress-bar {
    width: 100%; height: 12px;
    background: rgba(123, 45, 53, 0.2);
    border-radius: 6px; overflow: hidden;
}
.fire-progress-fill {
    height: 100%; border-radius: 6px;
    background: linear-gradient(90deg, var(--burgundy), var(--gold));
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.fire-progress-fill::after {
    content: ''; position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 2s infinite;
}
@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* CHART */
.chart-panel {
    grid-column: 1 / -1;
}
.chart-wrapper {
    position: relative; height: 350px;
}
.chart-wrapper canvas {
    width: 100%; height: 100%;
}
.chart-legend {
    display: flex; gap: 1.5rem; justify-content: center;
    margin-top: 1rem; flex-wrap: wrap;
}
.chart-legend-item {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.8rem; color: var(--cream); opacity: 0.7;
}
.chart-legend-dot {
    width: 10px; height: 10px; border-radius: 3px;
}

/* z-index contenedores */
.hero, .calculator-section, .tips-section, section { position: relative; }

/* YEARLY TABLE */
.yearly-section {
    grid-column: 1 / -1;
}
.yearly-table-wrapper {
    max-height: 400px; overflow-y: auto;
    border-radius: 12px;
}
.yearly-table {
    width: 100%; border-collapse: collapse;
    font-size: 0.85rem;
}
.yearly-table thead th {
    position: sticky; top: 0;
    padding: 0.8rem 1rem; text-align: right;
    font-size: 0.75rem; text-transform: uppercase;
    letter-spacing: 1px; color: var(--cream); opacity: 0.55;
    font-weight: 500;
    background: rgba(42, 16, 21, 0.95);
    border-bottom: 1px solid rgba(123, 45, 53, 0.2);
}
.yearly-table thead th:first-child { text-align: left; }
.yearly-table tbody td {
    padding: 0.6rem 1rem; text-align: right;
    font-family: var(--font-num); font-variant-numeric: tabular-nums;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(123, 45, 53, 0.08);
}
.yearly-table tbody td:first-child {
    text-align: left;
    font-family: var(--font-sans);
    color: var(--cream); opacity: 0.6;
}
.yearly-table tbody tr.fire-year {
    background: rgba(201, 168, 76, 0.08);
}
.yearly-table tbody tr.fire-year td {
    color: var(--gold); font-weight: 500;
}
.yearly-table tbody tr:hover {
    background: rgba(123, 45, 53, 0.1);
}
.yearly-table .positive { color: var(--success); }

/* TIPS SECTION */
.tips-section {
    grid-column: 1 / -1;
}
.tips-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
}
.tip-card {
    padding: 1.5rem; border-radius: 12px;
    background: rgba(26, 10, 14, 0.5);
    border: 1px solid rgba(123, 45, 53, 0.15);
    transition: all 0.3s;
}
.tip-card:hover { border-color: rgba(201, 168, 76, 0.3); transform: translateY(-2px); }
.tip-icon { font-size: 1.5rem; margin-bottom: 0.8rem; }
.tip-title {
    font-family: var(--font-display);
    font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem;
}
.tip-text {
    font-size: 0.85rem; color: var(--cream); opacity: 0.55; line-height: 1.6;
}

/* SCROLLBAR for table */
.yearly-table-wrapper::-webkit-scrollbar { width: 6px; }
.yearly-table-wrapper::-webkit-scrollbar-track { background: transparent; }
.yearly-table-wrapper::-webkit-scrollbar-thumb { background: var(--burgundy); border-radius: 3px; }

/* ===== FOOTER ===== */
.footer { position: relative; z-index: 1; }

/* RESPONSIVE */
@media (max-width: 1024px) {
    .calc-container { grid-template-columns: 1fr; }
    .results-panel { position: static; }
    .chart-panel, .yearly-section, .tips-section { grid-column: 1; }
    .tips-grid { grid-template-columns: 1fr 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .fire-tiers { grid-template-columns: 1fr 1fr; }
    .result-grid { grid-template-columns: 1fr 1fr; }
    .tips-grid { grid-template-columns: 1fr; }
    .hero-title { font-size: 2rem; }
    .result-hero-value { font-size: 2.2rem; }
}
@media (max-width: 480px) {
    /* en el móvil se aprovecha el ancho: menos margen y tarjetas de 2 en 2 */
    .calculator-section { padding-left: 1rem; padding-right: 1rem; }
    .calc-container { gap: 1rem; }
    .panel { padding: 1.25rem; border-radius: 16px; }
    .fire-tiers { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
    .result-grid { grid-template-columns: 1fr 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* ANIMATIONS */
.reveal {
    opacity: 0; transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Tooltip */
.info-tip {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: rgba(123, 45, 53, 0.3); font-size: 0.6rem;
    cursor: help; position: relative; margin-left: 0.3rem;
    vertical-align: middle;
}
.info-tip:hover::after {
    content: attr(data-tip);
    position: absolute; bottom: 100%; left: 50%;
    transform: translateX(-50%); padding: 0.5rem 0.8rem;
    background: var(--bg-card-light); border: 1px solid rgba(123, 45, 53, 0.3);
    border-radius: 8px; font-size: 0.75rem; white-space: nowrap;
    color: var(--cream); opacity: 1; z-index: 10;
    font-family: var(--font-sans); font-weight: 400;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Divider */
.divider {
    height: 1px; background: rgba(123, 45, 53, 0.2);
    margin: 1.5rem 0;
}

/* Milestone badges */
.milestones {
    display: flex; gap: 0.5rem; flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.milestone {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.4rem 0.8rem; border-radius: 8px;
    font-size: 0.75rem; font-weight: 500;
    border: 1px solid;
}
.milestone.achieved {
    background: rgba(74, 158, 110, 0.1);
    border-color: rgba(74, 158, 110, 0.3);
    color: var(--success);
}
.milestone.pending {
    background: rgba(123, 45, 53, 0.1);
    border-color: rgba(123, 45, 53, 0.2);
    color: var(--cream); opacity: 0.55;
}

/* Móvil: que los paneles no se salgan de la pantalla (antes la tabla anual los ensanchaba y se cortaban). */
.calc-container > * { min-width: 0; }
.yearly-table-wrapper { overflow-x: auto; }
