:root {
    /* Paleta de colores solicitada */
    --cream: #FDFBF7;
    --cream-dark: #F0EDE5;
    --wine-dark: #4A0E17;
    --wine-light: #6E1624;
    --gold: #C5A059;
    --gold-light: #D0AF6A;
    
    /* Variables adicionales de diseño */
    --text-dark: #333333;
    --text-light: #ffffff;
    --shadow: 0 8px 30px rgba(74, 14, 23, 0.12);
    --border-radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--cream);
    background-image: linear-gradient(90deg, rgba(74, 14, 23, 0.04), transparent 18%, transparent 82%, rgba(74, 14, 23, 0.04));
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.main-header {
    background-color: var(--wine-dark);
    color: var(--text-light);
    padding: 2.5rem 1rem;
    text-align: center;
    border-bottom: 5px solid var(--gold);
}

.logo-container {
    margin-bottom: 1.5rem;
}

.logo {
    max-width: 520px;
    width: min(82vw, 520px);
    height: auto;
    display: inline-block;
}

.main-header h1 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: 0.35px;
    line-height: 1.2;
}

.gold-text {
    color: var(--gold-light);
}

/* Main Container */
.calculator-container {
    flex: 1;
    max-width: 1180px;
    width: min(94%, 1180px);
    margin: -2rem auto 3rem;
    padding: 2rem;
    background-color: #ffffff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    position: relative;
    z-index: 10;
}

.calculator-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
    gap: 1.5rem;
    align-items: start;
}

.calculator-panel,
.info-card {
    border: 1px solid var(--cream-dark);
    border-radius: var(--border-radius);
    background-color: #ffffff;
    box-shadow: 0 8px 24px rgba(74, 14, 23, 0.06);
}

.form-panel {
    padding: 1.6rem;
}

.calculator-form {
    display: grid;
    gap: 1.1rem;
}

.result-column {
    display: grid;
    gap: 1rem;
    position: sticky;
    top: 1rem;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.6rem;
    padding-bottom: 1.2rem;
    border-bottom: 2px solid var(--cream-dark);
}

.section-heading span {
    display: block;
    margin-bottom: 0.35rem;
    color: #9a8c7d;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.section-heading h2 {
    color: var(--wine-dark);
    font-size: 1.2rem;
}

.section-heading strong {
    flex: 0 0 auto;
    padding: 0.65rem 0.9rem;
    border-radius: 8px;
    background-color: var(--wine-dark);
    color: var(--gold-light);
    font-size: 0.9rem;
}

.helper-text {
    margin-top: 0.75rem;
    color: #6f645c;
    font-size: 0.9rem;
    line-height: 1.55;
}

.info-banner {
    display: flex;
    gap: 1rem;
    margin-top: 1.25rem;
    padding: 1.25rem;
    border: 1px solid var(--cream-dark);
    border-radius: 12px;
    background-color: #faf9f6;
}

.info-banner + .edades-container,
.info-banner + .form-group {
    margin-top: 1.8rem;
}

.info-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 2px solid var(--gold);
    border-radius: 50%;
    color: var(--wine-dark);
    font-size: 0.85rem;
    font-weight: 800;
}

.info-banner p {
    color: #4e4540;
    font-size: 0.94rem;
    line-height: 1.75;
    text-align: justify;
}

.info-banner strong {
    color: var(--wine-dark);
}

.info-card {
    padding: 1.35rem;
    border-left: 4px solid var(--gold);
}

.info-card-compact {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 0.9rem;
    align-items: start;
    padding: 1.15rem;
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s, background-color 0.25s;
}

.info-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: var(--wine-dark);
    color: var(--gold-light);
    font-size: 0.9rem;
    font-weight: 800;
}

.info-card h2 {
    color: var(--wine-dark);
    font-size: 1rem;
    margin-bottom: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-card p {
    color: #5e554f;
    font-size: 0.9rem;
    line-height: 1.55;
}

.help-card {
    padding: 1.5rem;
    border-radius: var(--border-radius);
    background: linear-gradient(135deg, #1c080d, var(--wine-dark));
    color: var(--text-light);
    box-shadow: 0 14px 34px rgba(74, 14, 23, 0.22);
    text-align: center;
}

.help-card h2 {
    margin-bottom: 0.75rem;
    color: var(--gold-light);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
}

.help-card p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.92rem;
    line-height: 1.65;
}

.help-card strong {
    color: var(--gold-light);
}

.resultado-help-card {
    margin-top: 1.25rem;
    padding: 1.25rem;
    border: 1px solid rgba(208, 175, 106, 0.28);
    background: rgba(20, 4, 8, 0.34);
    box-shadow: none;
}

.resultado-help-card h2 {
    margin-bottom: 0.55rem;
    font-size: 0.95rem;
}

.resultado-help-card p {
    max-width: 520px;
    margin: 0 auto;
    font-size: 0.9rem;
    line-height: 1.55;
}

.resultado-help-card .btn-ayuda {
    margin-top: 0.95rem;
}

.result-column:has(.resultado-container:not(.hidden)) .help-card-standalone {
    display: none;
}

.btn-ayuda {
    display: block;
    width: 100%;
    margin-top: 1.2rem;
    padding: 1rem;
    border-radius: 8px;
    background-color: var(--gold);
    color: var(--wine-dark);
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-decoration: none;
    text-transform: uppercase;
    box-shadow: 0 8px 20px rgba(197, 160, 89, 0.25);
    transition: transform 0.3s, background-color 0.3s;
}

.btn-ayuda:hover {
    background-color: var(--gold-light);
    transform: translateY(-2px);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.35rem;
}

.form-step {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 1rem;
    padding: 1.1rem;
    border: 1px solid var(--cream-dark);
    border-radius: 12px;
    background: #fffdfa;
    transition: border-color 0.25s, box-shadow 0.25s, background-color 0.25s;
}

.form-step.guide-active {
    border-color: rgba(197, 160, 89, 0.68);
    background: #fffaf0;
    box-shadow: 0 10px 26px rgba(94, 11, 21, 0.08);
}

.info-card-compact.guide-active {
    border-color: rgba(197, 160, 89, 0.75);
    background: #fffaf0;
    box-shadow: 0 14px 32px rgba(94, 11, 21, 0.12);
    transform: translateY(-2px);
}

.info-card-compact.guide-active .info-number,
.form-step.guide-active .step-badge {
    background-color: var(--gold);
    color: var(--wine-dark);
}

.form-step .form-group:last-child,
.form-step .checkbox-group:last-child,
.form-step .edades-container:last-child {
    margin-bottom: 0;
}

.step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background-color: var(--wine-dark);
    color: var(--gold-light);
    font-size: 0.95rem;
    font-weight: 800;
    position: sticky;
    top: 1rem;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.65rem;
    color: var(--wine-dark);
    font-size: 0.98rem;
}

input[type="number"], input[type="text"], select {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 2px solid var(--cream-dark);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background-color: #faf9f6;
}

input[type="number"]:focus, input[type="text"]:focus, select:focus {
    outline: none;
    border-color: var(--gold);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.2);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.currency {
    position: absolute;
    left: 1.2rem;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 1.1rem;
}

.input-wrapper input {
    padding-left: 2.5rem;
}

/* Dynamic Ages */
.edades-container {
    background-color: var(--cream);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.8rem;
    border: 1px solid var(--cream-dark);
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.edades-container h3 {
    font-size: 1.1rem;
    color: var(--wine-dark);
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--cream-dark);
    padding-bottom: 0.5rem;
}

.edad-item {
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid var(--cream-dark);
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.72);
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.edad-item:last-child {
    margin-bottom: 0;
}

.hijo-numero {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background-color: var(--wine-dark);
    color: var(--gold-light);
    font-weight: 800;
}

.hijo-campos {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 1rem;
}

.hijo-campos label {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #8f8173;
}

.hijo-campos input,
.hijo-campos select {
    padding: 0.85rem;
    font-size: 0.95rem;
}

.hidden {
    display: none !important;
}

/* Checkbox */
.checkbox-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background-color: var(--cream);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--cream-dark);
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: var(--wine-dark);
    margin-bottom: 0;
}

.checkbox-label input {
    margin-right: 0.8rem;
    width: 20px;
    height: 20px;
    accent-color: var(--gold);
    cursor: pointer;
}

.discapacidad-detalle {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--cream-dark);
    animation: fadeIn 0.3s ease-in-out;
}

.discapacidad-detalle label {
    font-size: 0.95rem;
}

.discapacidad-hijo {
    grid-column: 2;
    margin-top: 0;
    padding: 0.9rem;
    background-color: rgba(255, 255, 255, 0.65);
    border: 1px solid var(--cream-dark);
    border-radius: 8px;
}

.discapacidad-hijo-label {
    font-size: 0.95rem;
}

/* Button */
.btn-calcular {
    width: 100%;
    padding: 1.2rem;
    background-color: var(--gold);
    color: var(--wine-dark);
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 1rem;
    box-shadow: 0 4px 15px rgba(197, 160, 89, 0.4);
}

.btn-calcular:hover {
    background-color: var(--gold-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(197, 160, 89, 0.6);
}

.btn-calcular:active {
    transform: translateY(0);
}

/* Results */
.resultado-container {
    margin-top: 0;
    padding: 2rem;
    background: linear-gradient(135deg, var(--wine-dark), var(--wine-light));
    color: var(--text-light);
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: 0 10px 30px rgba(74, 14, 23, 0.2);
    animation: fadeIn 0.5s ease-out;
}

.resultado-hero {
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem;
    padding: 1.65rem 1rem;
    border: 1px solid rgba(208, 175, 106, 0.28);
    border-radius: 18px;
    background:
        radial-gradient(circle at 50% 20%, rgba(208, 175, 106, 0.22), transparent 42%),
        linear-gradient(145deg, rgba(94, 11, 21, 0.96), rgba(116, 31, 44, 0.9));
    box-shadow: 0 18px 38px rgba(20, 4, 8, 0.22), 0 0 34px rgba(197, 160, 89, 0.12);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.resultado-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    transform: translateX(-100%);
    transition: transform 0.55s ease;
}

.resultado-hero:hover {
    transform: translateY(-3px) scale(1.01);
    border-color: rgba(208, 175, 106, 0.58);
    box-shadow: 0 24px 48px rgba(20, 4, 8, 0.28), 0 0 42px rgba(197, 160, 89, 0.22);
}

.resultado-hero:hover::before {
    transform: translateX(100%);
}

.resultado-container h2 {
    position: relative;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    color: var(--gold-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.resultado-valor {
    position: relative;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.resultado-detalles {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 0 0 1.5rem;
    text-align: left;
    font-size: 0.95rem;
    line-height: 1.6;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.resultado-detalles ul {
    list-style-type: none;
    padding: 0;
}

.resultado-detalles li {
    margin-bottom: 0.5rem;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.2);
    padding-bottom: 0.5rem;
    display: grid;
    grid-template-columns: minmax(125px, 0.42fr) minmax(0, 1fr);
    align-items: start;
    gap: 1rem;
}

.resultado-detalles li:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.resultado-detalles strong {
    color: var(--gold-light);
    font-weight: 600;
    min-width: 0;
    overflow-wrap: anywhere;
    text-align: right;
}

.resultado-detalles li > span {
    min-width: 0;
}

.resultado-detalles .li-desglose-hijos {
    align-items: flex-start;
    display: grid;
    grid-template-columns: minmax(125px, 0.42fr) minmax(0, 1fr);
}

.resultado-detalles .li-desglose-hijos > strong {
    display: grid;
    gap: 0.65rem;
    width: 100%;
    min-width: 0;
}

.hijo-resumen {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.35rem 0.75rem;
    align-items: baseline;
    padding: 0.7rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.035);
}

.hijo-resumen:last-child {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hijo-resumen span {
    color: var(--gold-light);
    min-width: 0;
    overflow-wrap: anywhere;
}

.hijo-resumen strong {
    color: var(--gold-light);
    white-space: nowrap;
    text-align: right;
}

.hijo-resumen small {
    grid-column: 1 / -1;
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.82rem;
    line-height: 1.35;
}

@media (max-width: 1100px) {
    .resultado-detalles .li-desglose-hijos {
        grid-template-columns: 1fr;
    }

    .resultado-detalles .li-desglose-hijos > strong {
        text-align: left;
    }
}

.resultado-fuente {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.82rem;
    line-height: 1.5;
    text-align: center;
}

.btn-descargar-calculo {
    width: 100%;
    margin: 1.25rem 0 0.25rem;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.04);
    color: var(--gold-light);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: background-color 0.25s, border-color 0.25s, transform 0.25s;
}

.btn-descargar-calculo::before {
    content: "↓";
    margin-right: 0.7rem;
    font-size: 1.1rem;
}

.btn-descargar-calculo:hover {
    background-color: rgba(197, 160, 89, 0.12);
    border-color: rgba(208, 175, 106, 0.55);
    transform: translateY(-1px);
}

.nota-legal {
    font-size: 0.85rem;
    opacity: 0.85;
    line-height: 1.5;
    font-style: italic;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1rem;
}

/* Official Table */
.tabla-oficial-container {
    margin-top: 2.5rem;
    border: 1px solid var(--cream-dark);
    border-radius: var(--border-radius);
    overflow: hidden;
    background-color: #ffffff;
    box-shadow: 0 8px 24px rgba(74, 14, 23, 0.08);
}

.precision-banner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1.5rem;
    align-items: center;
    margin-top: 2rem;
    padding: 2rem;
    border-left: 8px solid var(--gold);
    border-radius: var(--border-radius);
    background-color: #ffffff;
    box-shadow: 0 10px 28px rgba(74, 14, 23, 0.1);
}

.precision-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(145deg, #fffaf0, #f1e4cb);
    color: var(--wine-dark);
    border: 1px solid rgba(197, 160, 89, 0.38);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.45);
}

.precision-icon svg {
    width: 38px;
    height: 38px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.precision-banner h2 {
    margin-bottom: 0.65rem;
    color: var(--wine-dark);
    font-size: 1.25rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.precision-banner p {
    color: #4e4540;
    font-size: 1rem;
    line-height: 1.75;
}

.precision-banner strong {
    color: var(--wine-dark);
}

.tabla-oficial-header {
    background-color: var(--wine-dark);
    color: var(--text-light);
    text-align: center;
    padding: 1.4rem 1rem;
}

.tabla-oficial-header h2 {
    font-size: 1.05rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.tabla-oficial-header p {
    margin-top: 0.35rem;
    color: var(--gold-light);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
}

.tabla-oficial {
    padding: 1.25rem;
}

.nivel-tabla {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    border: 1px solid var(--cream-dark);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
    background-color: #fff;
}

.nivel-tabla:last-child {
    margin-bottom: 0;
}

.nivel-tabla-encabezado {
    padding: 1.4rem;
    text-align: left;
    background-color: #faf9f6;
    border-right: 1px solid var(--cream-dark);
    border-bottom: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.nivel-tabla-encabezado h3 {
    color: var(--wine-dark);
    font-size: 1.45rem;
    text-transform: uppercase;
    margin-bottom: 0.45rem;
}

.nivel-tabla-encabezado p {
    font-size: 0.95rem;
    line-height: 1.5;
}

.nivel-tabla-encabezado strong {
    color: var(--wine-dark);
}

.nivel-tabla-encabezado span {
    display: block;
    margin-top: 0.45rem;
    color: #7c6f63;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.nivel-discapacidad {
    margin-top: 0.9rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(94, 11, 21, 0.12);
}

.nivel-discapacidad p {
    margin: 0 0 0.4rem;
    color: var(--wine-dark);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.nivel-discapacidad span {
    display: flex;
    justify-content: space-between;
    gap: 0.7rem;
    margin-top: 0.25rem;
    color: #5e554f;
    font-size: 0.73rem;
    line-height: 1.25;
    text-transform: none;
}

.nivel-discapacidad strong {
    color: inherit;
    font-weight: 700;
}

.nivel-tabla-activo {
    border-color: var(--gold);
    box-shadow: 0 16px 38px rgba(94, 11, 21, 0.14);
}

.nivel-tabla-activo .nivel-tabla-encabezado,
.nivel-tabla-activo:first-child .nivel-tabla-encabezado {
    background-color: var(--wine-light);
    color: #ffffff;
}

.nivel-tabla-activo .nivel-tabla-encabezado h3,
.nivel-tabla-activo:first-child .nivel-tabla-encabezado h3,
.nivel-tabla-activo .nivel-tabla-encabezado strong,
.nivel-tabla-activo:first-child .nivel-tabla-encabezado strong {
    color: var(--gold-light);
}

.nivel-tabla-activo .nivel-tabla-encabezado span,
.nivel-tabla-activo:first-child .nivel-tabla-encabezado span {
    color: rgba(255, 255, 255, 0.78);
}

.nivel-tabla-activo .nivel-discapacidad {
    border-top-color: rgba(255, 255, 255, 0.22);
}

.nivel-tabla-activo .nivel-discapacidad p,
.nivel-tabla-activo .nivel-discapacidad strong,
.nivel-tabla-activo .nivel-discapacidad span {
    color: rgba(255, 255, 255, 0.92);
}

.nivel-tabla-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
}

.tabla-celda {
    padding: 0.95rem 0.6rem;
    border-right: 1px solid var(--cream-dark);
    border-bottom: 1px solid var(--cream-dark);
    text-align: center;
    font-size: 0.92rem;
    color: var(--wine-dark);
}

.tabla-celda:nth-child(3n) {
    border-right: none;
}

.tabla-celda:nth-last-child(-n + 3) {
    border-bottom: none;
}

.tabla-celda-titulo,
.tabla-celda-hijos {
    font-weight: 700;
}

.tabla-celda-titulo {
    background-color: var(--cream);
    text-transform: uppercase;
    font-size: 0.82rem;
}

.nivel-tabla-activo .tabla-celda-titulo {
    background-color: #f5eddc;
    color: var(--wine-dark);
}

.tabla-fila-activa {
    background-color: #fbf5e8;
    color: var(--wine-dark);
    font-weight: 800;
}

.tabla-celda-activa {
    background-color: var(--wine-light);
    color: var(--gold-light);
    font-weight: 900;
    box-shadow: inset 0 0 0 2px rgba(197, 160, 89, 0.45);
}

/* WhatsApp Button */
.whatsapp-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #25D366;
    color: white;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
}

.whatsapp-btn:hover {
    transform: scale(1.15) rotate(-5deg);
}

/* Footer */
.main-footer {
    background: linear-gradient(135deg, #140508, #050303);
    color: var(--text-light);
    padding: 3rem 1rem 1.1rem;
    margin-top: auto;
    border-top: 5px solid var(--gold);
}

.footer-content {
    max-width: 1160px;
    margin: 0 auto 2.2rem;
    display: grid;
    grid-template-columns: 0.9fr 0.9fr 1.4fr;
    gap: 2.25rem;
    align-items: center;
}

.footer-brand {
    display: flex;
    justify-content: center;
}

.footer-brand img {
    max-width: 205px;
    width: 100%;
    height: auto;
}

.footer-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.footer-link-block {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 0.8rem;
    align-items: center;
    margin-bottom: 0.9rem;
    color: var(--text-light);
    text-decoration: none;
    transition: transform 0.25s, color 0.25s;
}

.footer-link-block:hover {
    transform: translateX(4px);
}

.footer-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 40px;
    width: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.06);
    color: var(--gold-light);
}

.footer-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.footer-link-block strong {
    display: block;
    color: #ffffff;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.footer-link-block small {
    display: block;
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.9rem;
    line-height: 1.35;
}

.footer-phone-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem 1rem;
}

.footer-social {
    margin-top: 1.4rem;
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-right: 0.55rem;
    margin-bottom: 0.55rem;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    transition: background-color 0.25s, color 0.25s;
}

.footer-social svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.footer-social a:nth-of-type(2) svg,
.footer-social a:nth-of-type(3) svg {
    fill: currentColor;
    stroke: none;
}

.footer-social a:hover {
    background-color: rgba(197, 160, 89, 0.16);
    color: var(--gold-light);
}

.footer-bottom {
    text-align: center;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 1px;
}

.print-report {
    display: none;
}

.print-page {
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    padding: 18mm;
    background: #ffffff;
    color: #231416;
    font-family: 'Montserrat', Arial, sans-serif;
}

.print-header {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 1.3rem;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 4px solid var(--wine);
}

.print-header img {
    width: 118px;
    height: auto;
    justify-self: center;
}

.print-header h1 {
    margin: 0 0 0.25rem;
    color: var(--wine);
    font-size: 1.65rem;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.print-header p,
.print-summary span,
.print-total span {
    margin: 0;
    color: #8a7a76;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.print-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 1.1rem 0;
}

.print-summary div,
.print-iess-detail div,
.print-total,
.print-notes {
    border: 1px solid #eadfd8;
    border-radius: 12px;
    background: #fbf8f4;
    padding: 1rem;
}

.print-summary strong {
    display: block;
    margin-top: 0.4rem;
    color: var(--wine);
    font-size: 1.15rem;
}

.print-iess-detail {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
    margin: -0.35rem 0 1rem;
}

.print-iess-detail-simple {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.print-iess-detail div {
    padding: 0.75rem;
}

.print-iess-detail span {
    display: block;
    color: #8a7a76;
    font-size: 0.64rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.print-iess-detail strong {
    display: block;
    margin-top: 0.25rem;
    color: var(--wine-dark);
    font-size: 0.82rem;
    line-height: 1.25;
}

.print-section {
    margin-top: 1rem;
}

.print-section h2,
.print-notes h2 {
    margin: 0 0 0.7rem;
    color: var(--wine);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.print-section table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border: 1px solid #eadfd8;
    border-radius: 12px;
    font-size: 0.74rem;
}

.print-section th {
    background: #fbf8f4;
    color: var(--wine-dark);
    padding: 0.75rem 0.55rem;
    text-align: left;
    text-transform: uppercase;
    border-top: 2px solid var(--wine-dark);
    border-bottom: 2px solid var(--wine-dark);
    font-size: 0.68rem;
    letter-spacing: 0.6px;
}

.print-section td {
    padding: 0.7rem 0.55rem;
    border-top: 1px solid #eadfd8;
    color: #392327;
    font-weight: 600;
}

.print-money {
    display: block;
    color: var(--wine-dark);
    font-weight: 800;
}

.print-section td small {
    display: block;
    margin-top: 0.16rem;
    color: #8a7a76;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.25;
}

.print-muted {
    color: #8a7a76;
    font-weight: 700;
}

.print-total {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: center;
    width: min(390px, 100%);
    margin: 1.5rem 0 0 auto;
    border-left: 6px solid var(--gold);
}

.print-total p,
.print-notes p {
    margin: 0.35rem 0 0;
    color: #55464a;
    line-height: 1.45;
}

.print-total strong {
    color: var(--wine);
    font-size: 2rem;
}

.print-notes {
    margin-top: 1rem;
}

.print-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 0.7rem;
    border-top: 1px solid #eadfd8;
    color: #8a7a76;
    font-size: 0.78rem;
    font-weight: 700;
}

.print-table-page {
    page-break-before: always;
}

.print-header-centered {
    grid-template-columns: 150px 1fr;
}

.print-applied-reference {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
    margin: 0.9rem 0;
}

.print-applied-reference div {
    padding: 0.75rem 0.85rem;
    border: 1px solid #eadfd8;
    border-radius: 10px;
    background: #fbf8f4;
}

.print-applied-reference span {
    display: block;
    color: #8a7a76;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.print-applied-reference strong {
    display: block;
    margin-top: 0.25rem;
    color: var(--wine);
    font-size: 1rem;
}

.print-official-tables {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.9rem;
}

.print-table-level {
    display: grid;
    grid-template-columns: 155px 1fr;
    overflow: hidden;
    border: 1px solid #eadfd8;
    border-radius: 10px;
    background: #ffffff;
}

.print-table-level-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0.75rem;
    background: #fbf8f4;
    border-right: 1px solid #eadfd8;
}

.print-table-level-info h3 {
    margin: 0 0 0.3rem;
    color: var(--wine-dark);
    font-size: 1.1rem;
    line-height: 1;
    text-transform: uppercase;
}

.print-table-level-info p {
    margin: 0;
    color: #36252a;
    font-size: 0.68rem;
    line-height: 1.3;
}

.print-table-level-info strong {
    color: var(--wine-dark);
}

.print-table-level-info span {
    margin-top: 0.3rem;
    color: #7c6f63;
    font-size: 0.58rem;
    font-weight: 800;
    line-height: 1.25;
    text-transform: uppercase;
}

.print-table-disability {
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border-top: 1px solid #eadfd8;
}

.print-table-disability p {
    margin: 0 0 0.18rem;
    color: var(--wine-dark);
    font-size: 0.52rem;
    font-weight: 900;
    letter-spacing: 0.4px;
    line-height: 1.1;
    text-transform: uppercase;
}

.print-table-disability span {
    display: flex;
    justify-content: space-between;
    gap: 0.35rem;
    margin-top: 0.12rem;
    color: #55464a;
    font-size: 0.5rem;
    font-weight: 800;
    line-height: 1.15;
    text-transform: none;
}

.print-table-disability strong {
    color: inherit;
    font-weight: 900;
}

.print-table-level table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.68rem;
}

.print-table-level th,
.print-table-level td {
    padding: 0.45rem 0.4rem;
    border-right: 1px solid #eadfd8;
    border-bottom: 1px solid #eadfd8;
    text-align: center;
    color: var(--wine-dark);
}

.print-table-level th:last-child,
.print-table-level td:last-child {
    border-right: none;
}

.print-table-level tr:last-child td {
    border-bottom: none;
}

.print-table-level th {
    background: #fbf8f4;
    font-weight: 800;
    text-transform: uppercase;
}

.print-table-level td:first-child {
    font-weight: 800;
}

.print-table-level-active {
    border-color: var(--gold);
    box-shadow: 0 6px 18px rgba(94, 11, 21, 0.12);
}

.print-table-level-active .print-table-level-info {
    background: var(--wine-light);
    color: #ffffff;
}

.print-table-level-active .print-table-level-info h3,
.print-table-level-active .print-table-level-info strong {
    color: var(--gold-light);
}

.print-table-level-active .print-table-level-info p {
    color: #ffffff;
}

.print-table-level-active .print-table-level-info span {
    color: rgba(255, 255, 255, 0.78);
}

.print-table-level-active .print-table-disability {
    border-top-color: rgba(255, 255, 255, 0.24);
}

.print-table-level-active .print-table-disability p,
.print-table-level-active .print-table-disability span,
.print-table-level-active .print-table-disability strong {
    color: rgba(255, 255, 255, 0.92);
}

.print-table-row-active td {
    background: #fbf5e8;
    font-weight: 900;
}

.print-table-cell-active {
    background: var(--wine-light) !important;
    color: var(--gold-light) !important;
    box-shadow: inset 0 0 0 2px rgba(197, 160, 89, 0.45);
}

/* Responsive */
@media (max-width: 768px) {
    .whatsapp-btn {
        right: 18px;
        bottom: 18px;
        width: 56px;
        height: 56px;
    }

    .whatsapp-btn svg {
        width: 30px;
        height: 30px;
    }

    .calculator-container {
        margin: -1.5rem auto 2rem;
        padding: 1.5rem;
        width: 95%;
    }

    .calculator-grid {
        grid-template-columns: 1fr;
    }

    .result-column {
        position: static;
    }

    .form-step,
    .info-card-compact {
        grid-template-columns: 1fr;
    }

    .step-badge,
    .info-number {
        position: static;
    }

    .section-heading {
        flex-direction: column;
    }

    .info-banner {
        padding: 1rem;
    }

    .info-banner p {
        text-align: left;
    }
    
    .main-header {
        padding-bottom: 3.5rem;
    }
    
    .resultado-valor {
        font-size: 2.5rem;
    }

    .resultado-detalles li {
        align-items: flex-start;
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .resultado-detalles li > strong {
        text-align: left;
    }

    .resultado-detalles .li-desglose-hijos {
        grid-template-columns: 1fr;
    }

    .resultado-detalles .li-desglose-hijos > strong {
        width: 100%;
    }

    .hijo-resumen {
        grid-template-columns: minmax(0, 1fr);
    }

    .hijo-resumen strong {
        text-align: left;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        align-items: start;
    }

    .footer-brand {
        justify-content: flex-start;
    }

    .footer-brand img {
        max-width: 190px;
    }

    .footer-phone-grid {
        grid-template-columns: 1fr;
    }

    .tabla-celda {
        padding: 0.75rem 0.35rem;
        font-size: 0.82rem;
    }

    .edad-item {
        grid-template-columns: 1fr;
    }

    .hijo-numero {
        width: 34px;
        height: 34px;
    }

    .hijo-campos {
        grid-template-columns: 1fr;
    }

    .discapacidad-hijo {
        grid-column: 1;
    }

    .nivel-tabla {
        grid-template-columns: 1fr;
    }

    .nivel-tabla-encabezado {
        text-align: center;
        border-right: none;
        border-bottom: 1px solid var(--cream-dark);
    }

    .nivel-tabla-encabezado h3 {
        font-size: 1.15rem;
    }

    .precision-banner {
        grid-template-columns: 1fr;
        padding: 1.5rem;
        text-align: center;
    }

    .precision-icon {
        margin: 0 auto;
    }
}

@media print {
    @page {
        size: A4;
        margin: 12mm;
    }

    html,
    body {
        width: auto;
        min-height: auto;
        margin: 0;
        padding: 0;
        background: #ffffff !important;
    }

    body > *:not(.print-report) {
        display: none !important;
    }

    .print-report {
        display: block !important;
    }

    .print-page {
        display: block;
        width: 100%;
        min-height: auto;
        margin: 0;
        padding: 0;
        box-shadow: none;
        color: #231416;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .print-header,
    .print-summary,
    .print-section,
    .print-total,
    .print-notes,
    .print-footer,
    .print-applied-reference,
    .print-table-level {
        break-inside: avoid;
    }

    .print-header {
        grid-template-columns: 140px 1fr;
    }

    .print-header img {
        width: 105px;
    }

    .print-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .print-iess-detail {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 5pt;
        margin: -3pt 0 8pt;
    }

    .print-iess-detail-simple {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .print-iess-detail div {
        padding: 6pt;
    }

    .print-section table {
        font-size: 9.5pt;
    }

    .print-section th,
    .print-section td {
        padding: 7pt 6pt;
    }

    .print-total strong {
        font-size: 22pt;
    }

    .print-table-page {
        page-break-before: always;
    }

    .print-applied-reference {
        grid-template-columns: repeat(3, 1fr);
        margin: 8pt 0;
        gap: 6pt;
    }

    .print-applied-reference div {
        padding: 7pt;
    }

    .print-official-tables {
        gap: 5pt;
        margin-top: 8pt;
    }

    .print-table-level {
        grid-template-columns: 145px 1fr;
    }

    .print-table-level-info {
        padding: 7pt;
    }

    .print-table-level-info h3 {
        font-size: 12pt;
    }

    .print-table-level-info p,
    .print-table-level table {
        font-size: 7.4pt;
    }

    .print-table-level-info span {
        font-size: 6.2pt;
    }

    .print-table-disability {
        margin-top: 3pt;
        padding-top: 3pt;
    }

    .print-table-disability p {
        font-size: 5.2pt;
    }

    .print-table-disability span {
        font-size: 5pt;
    }

    .print-table-level th,
    .print-table-level td {
        padding: 5pt 4pt;
    }
}
