/* Norma RCD */

/* Tonos que el diseño usa solo en esta página */
.page-norma {
    --nrm-ok: var(--green);
    --nrm-picked: #F2F2F2;
    --nrm-row: #FAFAFA;
    --nrm-dark-card: #2E2A2B;
    --nrm-red-on-dark: #FF5A6E;
}

.nrm-section { padding-top: 72px; padding-bottom: 72px; display: flex; flex-direction: column; gap: 28px; }
.nrm-head { display: flex; flex-direction: column; gap: 10px; max-width: 760px; }
.nrm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--min, 320px)), 1fr)); gap: 16px; }
.nrm-num {
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--red);
    color: var(--white);
    font-weight: 700;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.nrm-list { margin: 0; padding-left: 20px; font-size: 15px; display: flex; flex-direction: column; gap: 4px; }
.nrm-list--loose { gap: 6px; }

/* Portada */
.nrm-hero { padding-top: 56px; padding-bottom: 48px; display: flex; flex-wrap: wrap; gap: 40px; align-items: center; }
.nrm-hero__text { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.nrm-hero__text .actions { margin-top: 4px; }
.nrm-h1 { font-size: clamp(32px, 4.2vw, 48px); line-height: 1.1; letter-spacing: -0.02em; }
.nrm-hero__intro { font-size: 17px; color: var(--muted); max-width: 620px; }
.nrm-lines {
    flex: 1 1 360px;
    min-width: 0;
    background: var(--soft);
    border-top: 4px solid var(--red);
    border-radius: 8px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.nrm-lines__title { font-weight: 700; font-size: 18px; }
.nrm-lines__item { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; }
.nrm-lines__note { font-size: 13px; color: var(--muted); border-top: 1px solid var(--square-off); padding-top: 12px; }

/* Índice de temas: el submenú pegado bajo el header, con píldoras */
.nrm-topics { z-index: 30; background: rgba(255, 255, 255, 0.97); }
.nrm-topics .container { align-items: center; padding-top: 10px; padding-bottom: 10px; }
.nrm-topics__label { flex: none; font-size: 13px; font-weight: 700; color: var(--muted); margin-right: 4px; }
.nrm-topics a {
    flex: none;
    min-height: 40px;
    padding: 0 13px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: var(--white);
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    transition: border-color var(--fast) ease, color var(--fast) ease, background-color var(--fast) ease;
}
.nrm-topics a::after { display: none; }
.nrm-topics a:hover { border-color: var(--ink); }
.nrm-topics a.is-active { border-color: var(--red); color: var(--red); }

/* ¿Aplica? */
.nrm-gen { background: var(--white); border-left: 4px solid var(--red); border-radius: 8px; padding: 28px; display: flex; flex-direction: column; gap: 12px; font-size: 15px; }
.nrm-gen--small { border-left-color: var(--ink); }
.nrm-gen__name { font-size: 20px; line-height: 1.3; }
.nrm-gen__must { font-size: 14px; font-weight: 600; }

/* Metas */
.nrm-metas { padding-top: 72px; padding-bottom: 72px; display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; }
.nrm-metas__text { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.nrm-table { flex: 1 1 520px; min-width: 0; border: 1px solid var(--square-off); border-radius: 8px; overflow: hidden; }
.nrm-table table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 15px; }
.nrm-table th:first-child { width: 33%; }
.nrm-table thead th { background: var(--ink); color: var(--white); font-weight: 700; font-size: 14px; padding: 14px 16px; text-align: center; line-height: 1.35; }
.nrm-table thead th:first-child { text-align: left; }
.nrm-table tbody tr { border-top: 1px solid var(--square-off); transition: background-color var(--fast) ease; }
.nrm-table tbody tr:nth-child(even) { background: var(--nrm-row); }
.nrm-table tbody tr:hover { background: var(--soft); }
.nrm-table tbody th { padding: 16px; font-weight: 600; text-align: left; color: var(--ink); line-height: 1.4; }
.nrm-table td { padding: 16px; text-align: center; font-weight: 800; }
.nrm-table td:nth-of-type(1) { color: var(--muted); font-weight: 400; }
.nrm-table td:nth-of-type(2) { color: var(--red); }
.nrm-table__note { padding: 12px 16px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--square-off); background: var(--nrm-row); }

/* Calculadora */
.nrm-calc { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.nrm-calc__form { flex: 1 1 560px; min-width: 0; background: var(--white); border-radius: 8px; padding: 28px; display: flex; flex-direction: column; gap: 28px; }
.nrm-q { display: flex; flex-direction: column; gap: 12px; }
.nrm-q__title { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; line-height: 1.35; }
.nrm-opts { display: grid; gap: 10px; }
.nrm-opts--cat { grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); }
.nrm-opts--year { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.nrm-opt {
    min-height: 96px;
    padding: 14px;
    border-radius: 6px;
    border: 1.5px solid var(--line-strong);
    background: var(--white);
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color var(--fast) ease, background-color var(--fast) ease, transform var(--fast) var(--ease);
}
.nrm-opt:hover { border-color: var(--ink); }
.nrm-opt:active { transform: scale(0.985); }
.nrm-opt[aria-checked="true"] { border-color: var(--ink); background: var(--nrm-picked); }
.nrm-opt__top { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 15px; }
.nrm-opt__sub { font-size: 12px; line-height: 1.45; color: var(--muted); }
.nrm-opt--row { min-height: 56px; padding: 10px 14px; flex-direction: row; justify-content: space-between; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.nrm-opt__check:not(:empty) { animation: nrm-pop var(--medium) var(--ease) both; }

.nrm-unit { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding-top: 16px; border-top: 1px solid var(--placeholder); }
.nrm-unit__label { font-size: 14px; font-weight: 700; }
.nrm-seg { display: inline-flex; flex-wrap: wrap; background: var(--soft); border-radius: 6px; padding: 4px; gap: 4px; }
.nrm-seg button {
    min-height: 40px;
    padding: 0 16px;
    border-radius: 4px;
    border: 1.5px solid transparent;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--fast) ease, border-color var(--fast) ease;
}
.nrm-seg button[aria-checked="true"] { background: var(--white); border-color: var(--ink); font-weight: 700; }

.nrm-amount { display: flex; flex-direction: column; gap: 8px; background: var(--soft); border-radius: 8px; padding: 16px; }
.nrm-amount__label { display: flex; flex-direction: column; gap: 8px; }
.nrm-amount__hint { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--red); }
.nrm-amount__hint svg { flex: none; }
.nrm-amount__box {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 60px;
    border: 2px solid var(--ink);
    border-radius: 6px;
    background: var(--white);
    padding: 0 16px;
    box-shadow: 0 0 0 4px rgba(191, 0, 33, 0.08);
    transition: box-shadow var(--fast) ease;
}
.nrm-amount__box:focus-within { box-shadow: 0 0 0 4px rgba(191, 0, 33, 0.2); }
.nrm-amount__box input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; font: inherit; font-size: 26px; font-weight: 800; color: var(--ink); background: transparent; }
.nrm-amount__unit { flex: none; font-size: 18px; font-weight: 700; color: var(--muted); }
.nrm-amount__help { font-size: 13px; color: var(--muted); }
.nrm-amount__range { display: flex; align-items: center; gap: 12px; margin-top: 2px; }
.nrm-amount__range > span { flex: none; font-size: 12px; font-weight: 600; color: var(--muted); }
.nrm-amount__range input { flex: 1; min-width: 0; accent-color: var(--red); height: 28px; }

.nrm-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.nrm-quick > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.nrm-pill {
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1.5px solid var(--line-strong);
    background: var(--white);
    color: var(--ink);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color var(--fast) ease, background-color var(--fast) ease;
}
.nrm-pill:hover { border-color: var(--ink); }
.nrm-pill.is-on { border-color: var(--ink); background: var(--nrm-picked); }

/* Resultado */
.nrm-result {
    --tone: var(--ink);
    flex: 1 1 380px;
    min-width: 0;
    position: sticky;
    top: calc(var(--header-h) + 78px);
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.nrm-result.is-ok { --tone: var(--nrm-ok); }
.nrm-result.is-bad { --tone: var(--red); }
.nrm-result__head {
    background: var(--tone);
    color: var(--white);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 16px;
    transition: background-color var(--medium) ease;
}
.nrm-result__icon {
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--white);
    color: var(--tone);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: color var(--medium) ease;
}
.nrm-result.is-changed .nrm-result__icon { animation: nrm-pop var(--medium) var(--ease) both; }
.nrm-result.is-changed [data-c-status], .nrm-result.is-changed .nrm-result__msg { animation: nrm-in var(--medium) var(--ease) both; }
.nrm-result__body { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.nrm-result__meta { display: flex; flex-direction: column; gap: 2px; }
.nrm-result__label { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.nrm-result__pct { font-weight: 800; font-size: 40px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.nrm-result__need { font-size: 14px; color: var(--muted); }
.nrm-result__progress { display: flex; flex-direction: column; gap: 8px; }
.nrm-result__legend { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; }
.nrm-bar { position: relative; height: 16px; background: var(--line); border-radius: 8px; }
.nrm-bar__fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: var(--tone);
    border-radius: 8px;
    transition: width var(--medium) var(--ease), background-color var(--medium) ease;
}
.nrm-bar__mark { position: absolute; top: -6px; bottom: -6px; width: 3px; margin-left: -1px; background: var(--night); transition: left var(--medium) var(--ease); }
.nrm-result__msg { font-size: 15px; line-height: 1.5; }
.nrm-result__tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nrm-result__tiles > div { background: var(--soft); border-radius: 6px; padding: 12px; display: flex; flex-direction: column; }
.nrm-result__tiles b { font-weight: 800; font-size: 20px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.nrm-result__tiles b.is-red { color: var(--red); }
.nrm-result__tiles > div > span { font-size: 12px; color: var(--muted); }
.nrm-result__cta { min-height: 52px; padding: 12px 20px; font-weight: 700; text-align: center; }
.nrm-result__foot { font-size: 12px; color: var(--muted); }

@keyframes nrm-pop { from { opacity: 0; transform: scale(0.5); } }
@keyframes nrm-in { from { opacity: 0; transform: translateY(6px); } }

/* Lo que exige la norma */
.nrm-steps { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 14px; }
.nrm-steps li { border: 1px solid var(--square-off); border-top: 4px solid var(--red); border-radius: 8px; padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.nrm-steps__when { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--red); }
.nrm-steps b { font-weight: 700; font-size: 17px; line-height: 1.3; }
.nrm-steps li > span:last-child { font-size: 14px; color: var(--muted); }

/* Empresa autorizada y consecuencias */
.nrm-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 24px; }
.nrm-box { background: var(--white); border-radius: 8px; padding: 32px; display: flex; flex-direction: column; gap: 16px; }
.nrm-box--risk { border-top: 4px solid var(--night); }
.nrm-box--risk .eyebrow { color: var(--night); }
.nrm-box__title { font-size: 24px; line-height: 1.25; }
.nrm-box__text { font-size: 15px; }
.nrm-points { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 16px; font-size: 15px; }
.nrm-points li { display: flex; gap: 12px; align-items: flex-start; }
.nrm-points svg { flex: none; margin-top: 2px; color: var(--red); }
.nrm-box--risk .nrm-points svg { color: var(--night); }
.nrm-box__foot { font-size: 12px; color: var(--muted); border-top: 1px solid var(--square-off); padding-top: 12px; }

/* Productos recuperados */
.nrm-recover { padding-top: 72px; padding-bottom: 72px; display: flex; flex-wrap: wrap; gap: 40px; align-items: center; }
.nrm-recover__text { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.nrm-recover__note { font-size: 14px; color: var(--muted); }
.nrm-uses { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.nrm-uses > div { background: var(--soft); border-radius: 6px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.nrm-uses b { font-weight: 700; font-size: 15px; }
.nrm-uses span { font-size: 14px; color: var(--muted); }
.nrm-cycle { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 18px; background: var(--soft); border-radius: 8px; padding: 36px 28px; }
.nrm-cycle img { width: 120px; height: 120px; object-fit: contain; }
.nrm-cycle__flow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; font-size: 14px; font-weight: 600; text-align: center; }
.nrm-cycle__flow > span:not(.nrm-cycle__arrow) { background: var(--white); border-radius: 4px; padding: 8px 12px; }
.nrm-cycle__arrow { color: var(--red); }
.nrm-cycle__note { font-size: 13px; color: var(--muted); text-align: center; }

/* Beneficios */
.nrm-dark { background: var(--night); color: var(--line-strong); }
.nrm-dark h2 { color: var(--white); }
.nrm-dark__eyebrow { color: var(--nrm-red-on-dark); }
.nrm-benefit {
    background: var(--nrm-dark-card);
    border-left: 3px solid var(--red);
    border-radius: 8px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform var(--medium) var(--ease), background-color var(--medium) ease;
}
.nrm-benefit:hover { transform: translateY(-3px); background: var(--night-line); }
.nrm-benefit b { font-weight: 700; font-size: 17px; color: var(--white); }
.nrm-benefit span { font-size: 14px; }

/* Preguntas frecuentes */
.nrm-faq-wrap { max-width: 900px; padding-top: 72px; padding-bottom: 72px; display: flex; flex-direction: column; gap: 20px; }
.nrm-faq { display: flex; flex-direction: column; border-top: 1px solid var(--square-off); }
.nrm-faq__item { border-bottom: 1px solid var(--square-off); }
.nrm-faq h3 { font-size: inherit; }
.nrm-faq button {
    width: 100%;
    min-height: 56px;
    padding: 16px 0;
    background: none;
    border: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    font: inherit;
    font-weight: 600;
    font-size: 16px;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
    transition: color var(--fast) ease;
}
.nrm-faq button:hover { color: var(--red); }
/* El + se vuelve − girando la barra vertical */
.nrm-faq__sign { flex: none; position: relative; width: 14px; height: 14px; }
.nrm-faq__sign::before, .nrm-faq__sign::after {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    width: 14px;
    height: 2px;
    background: var(--red);
    transition: transform var(--medium) var(--ease);
}
.nrm-faq__sign::after { transform: rotate(90deg); }
.nrm-faq button[aria-expanded="true"] .nrm-faq__sign::after { transform: rotate(0deg); }
.nrm-faq__a { display: grid; grid-template-rows: 1fr; transition: grid-template-rows var(--medium) var(--ease); }
.nrm-faq__a > div { overflow: hidden; }
.nrm-faq__a p { margin: 0 0 18px; font-size: 15px; color: var(--muted); transition: opacity var(--medium) ease, transform var(--medium) var(--ease); }
/* Sin JavaScript todas las respuestas quedan a la vista */
.js .nrm-faq__a.is-closed { grid-template-rows: 0fr; }
.js .nrm-faq__a.is-closed p { opacity: 0; transform: translateY(-6px); }
.nrm-faq__legal { font-size: 12px; color: var(--muted); }

/* Llamado final */
.nrm-cta { background: var(--red); color: var(--white); }
.nrm-cta__inner { padding-top: 48px; padding-bottom: 48px; display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.nrm-cta__text { flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.nrm-cta__title { color: var(--white); font-size: clamp(22px, 2.4vw, 30px); line-height: 1.2; }
.nrm-cta__text p { font-size: 16px; opacity: 0.92; }
.nrm-cta__main { color: var(--red); }

@media (max-width: 720px) {
    .nrm-hero { padding-top: 40px; }
    .nrm-section, .nrm-metas, .nrm-recover, .nrm-faq-wrap { padding-top: 56px; padding-bottom: 56px; }
    .nrm-calc__form, .nrm-box { padding: 22px; }
    .nrm-lines, .nrm-gen { padding: 22px; }
    .nrm-result { position: static; }
    .nrm-table thead th, .nrm-table tbody th, .nrm-table td { padding: 12px 8px; font-size: 13px; }
    .nrm-table thead th:first-child, .nrm-table tbody th { padding-left: 12px; }
    .nrm-cta .actions, .nrm-cta .btn { width: 100%; }
}
