:root {
    --bg: #0a0a0f;
    --panel: #12121a;
    --card: #1a1a24;
    --border: #26263a;
    --orange: #FF6B00;
    --orange-2: #FF8C00;
    --text: #E8E8E8;
    --text-dim: #9a9aaa;
    --success: #00C851;
    --danger: #FF4444;
    --warning: #FFB300;
    --radius: 8px;
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    background: radial-gradient(circle at 50% 20%, #1a1020 0%, var(--bg) 60%);
    color: var(--text);
    font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
}
a { color: var(--orange); text-decoration: none; }
a:hover { color: var(--orange-2); text-decoration: underline; }
h1, h2, h3 { color: var(--text); font-weight: 700; margin-bottom: 0.6em; }
h1 { font-size: 2.2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; color: var(--orange); margin-top: 1.5em; }
p { margin-bottom: 1em; }

.site-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    background: rgba(10,10,15,0.9); backdrop-filter: blur(10px);
    position: sticky; top: 0; z-index: 100;
}
.brand { display: flex; align-items: center; gap: 0.7rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.1; }
.brand-txt strong { color: var(--orange); font-size: 1rem; }
.brand-txt span { color: var(--text-dim); font-size: 0.75rem; }
.site-header nav { display: flex; gap: 1.5rem; }
.site-header nav a { color: var(--text-dim); font-size: 0.9rem; }
.site-header nav a:hover { color: var(--orange); }

main { max-width: 1100px; margin: 0 auto; padding: 2rem 1rem; }

.hero { text-align: center; padding: 2rem 0 1rem; }
.hero h1 {
    background: linear-gradient(135deg, var(--orange), var(--orange-2));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.lead { color: var(--text-dim); font-size: 1.1rem; max-width: 700px; margin: 0 auto; }

.calc-wrap { display: grid; gap: 1.2rem; margin: 2rem 0; }
@media (min-width: 900px) { .calc-wrap { grid-template-columns: 1fr 1fr; }
    .result-card { grid-column: 1 / -1; }
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}
.card h2 { display: flex; align-items: center; gap: 0.5rem; }
.card h2::before { content: ""; width: 4px; height: 24px; background: var(--orange); border-radius: 2px; }

label { display: block; margin-bottom: 1rem; color: var(--text-dim); font-size: 0.9rem; }
input, select {
    display: block; width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    margin-top: 0.4rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus {
    outline: none; border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(255,107,0,0.15);
}
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.rules-box {
    background: rgba(255,107,0,0.08);
    border-left: 3px solid var(--orange);
    padding: 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-top: 1rem;
}
.rules-box ul { list-style: none; margin-top: 0.5rem; }
.rules-box li { padding: 0.2rem 0; }
.rules-box span { color: var(--orange); font-weight: bold; font-family: 'Consolas', monospace; }
.hidden { display: none !important; }

.result-card { border-color: var(--orange); }
.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}
.result-box {
    background: var(--panel);
    padding: 1.2rem;
    border-radius: 6px;
    text-align: center;
    border: 1px solid var(--border);
}
.result-box.highlight { border-color: var(--orange); background: linear-gradient(180deg, rgba(255,107,0,0.15), var(--panel)); }
.rlabel { display: block; color: var(--text-dim); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.4rem; }
.rvalue { display: block; color: var(--orange); font-size: 2rem; font-weight: 800; font-family: 'Consolas', monospace; }
.rsub { display: block; color: var(--text-dim); font-size: 0.75rem; margin-top: 0.3rem; }

.warning {
    background: rgba(255,68,68,0.1);
    border: 1px solid var(--danger);
    color: #ff9999;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 0.95rem;
    font-family: inherit;
    transition: transform 0.1s, box-shadow 0.2s;
}
.btn-primary {
    background: linear-gradient(135deg, var(--orange), var(--orange-2));
    color: white;
    box-shadow: 0 4px 12px rgba(255,107,0,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(255,107,0,0.5); text-decoration: none; color: white; }
.btn-secondary {
    background: transparent; color: var(--orange); border: 1px solid var(--orange);
    margin-top: 1rem;
}
.btn-secondary:hover { background: rgba(255,107,0,0.1); }

.explanation, .cta {
    margin: 3rem 0;
    padding: 2rem;
    background: var(--panel);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.explanation pre {
    background: var(--bg);
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    font-family: 'Consolas', monospace;
    color: var(--orange);
    font-size: 0.9rem;
    border-left: 3px solid var(--orange);
}
.callout {
    background: rgba(255,140,0,0.08);
    border-left: 3px solid var(--orange);
    padding: 1rem 1.2rem;
    border-radius: 4px;
    margin-top: 1.5rem;
}

.cta { text-align: center; }
.cta h2 { color: var(--orange); }

.ad-slot {
    margin: 2rem auto;
    padding: 0.5rem;
    text-align: center;
    min-height: 90px;
    background: rgba(255,255,255,0.02);
    border: 1px dashed var(--border);
    border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-dim);
    font-size: 0.75rem;
}
.ad-slot::before { content: "publicidad"; opacity: 0.4; }
.ad-slot:has(ins) { border: none; background: transparent; }
.ad-slot:has(ins)::before { display: none; }

.site-footer {
    margin-top: 4rem;
    background: var(--panel);
    border-top: 1px solid var(--border);
    padding: 2rem 1rem 1rem;
}
.foot-grid {
    max-width: 1100px; margin: 0 auto;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}
.foot-grid strong { color: var(--orange); display: block; margin-bottom: 0.6rem; }
.foot-grid ul { list-style: none; }
.foot-grid li { padding: 0.2rem 0; }
.foot-grid a { color: var(--text-dim); font-size: 0.9rem; }
.foot-grid a:hover { color: var(--orange); }
.foot-bar {
    max-width: 1100px; margin: 2rem auto 0;
    padding-top: 1rem; border-top: 1px solid var(--border);
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
    color: var(--text-dim); font-size: 0.8rem;
}

@media (max-width: 600px) {
    .site-header { padding: 1rem; }
    .site-header nav { gap: 1rem; }
    main { padding: 1rem 0.8rem; }
    .hero h1 { font-size: 1.6rem; }
    .row-2 { grid-template-columns: 1fr; }
    .rvalue { font-size: 1.5rem; }
    .foot-bar { flex-direction: column; text-align: center; }
}
