/* IMC — entrada */
.imc-page [hidden] { display: none !important; }
.imc-page .container { max-width: 1120px; }
.imc-page .resources-hero { padding: 2rem 0 0; background: #eff8fc; }
.imc-page .resources-hero__content { display: block; padding-bottom: 2rem; }
.imc-page .resources-hero h1 { max-width: none; margin-bottom: 0.75rem; color: #0077b6; font-size: clamp(2rem, 3vw, 2.5rem); }
.imc-page .resources-hero__intro { max-width: 72ch; font-size: 1rem; line-height: 1.65; }
.imc-page h2 { margin-bottom: 1rem; color: #003d5b; font-size: 1.25rem; line-height: 1.3; }
.imc-page p { line-height: 1.65; }
.imc-page a { color: #005c82; text-decoration: underline; }

/* IMC — medidas y cálculo */
.imc-calculator { display: grid; grid-template-columns: 5fr 6fr; align-items: start; gap: 3rem; padding-top: 2.5rem; padding-bottom: 2.5rem; scroll-margin-top: 100px; }
.imc-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin: 1.5rem 0; }
.imc-field { min-width: 0; }
.imc-field label { display: block; margin-bottom: 0.375rem; color: #003d5b; font-weight: 700; }
.imc-field label span { font-weight: 400; }
.imc-hint { margin-bottom: 0.75rem; color: #475569; font-size: 0.875rem; }
.imc-field input { width: 100%; min-height: 52px; padding: 0.75rem; background: #fff; color: #003d5b; border: 1px solid #527f96; border-radius: 3px; font: inherit; font-size: 1.125rem; caret-color: #0077b6; }
.imc-field input::placeholder { color: #64748b; }
.imc-field input[aria-invalid="true"] { border-color: #991b1b; }
.imc-field input:focus-visible, .imc-actions button:focus-visible, .imc-explanation summary:focus-visible { outline: 3px solid #0077b6; outline-offset: 3px; }
.imc-error { margin: 0.5rem 0 0; color: #991b1b; font-size: 0.875rem; }
.imc-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; }
.imc-actions > p { flex: 1 1 180px; margin: 0; color: #475569; font-size: 0.875rem; }
.imc-actions :is(button, .imc-reset) { min-height: 48px; padding: 0.75rem; border-radius: 3px; font: inherit; font-weight: 600; cursor: pointer; }
.imc-submit { display: inline-flex; align-items: center; gap: 2rem; background: #0077b6; color: #fff; border: 1px solid #0077b6; }
.imc-submit:hover { background: #005c82; }
.imc-submit:disabled { background: #475569; border-color: #475569; cursor: wait; }
.imc-reset { background: transparent; color: #005c82; border: 1px solid transparent; text-decoration: underline; text-underline-offset: 0.2em; }
.imc-reset:hover { background: #f0f7fa; }
.imc-status { margin: 1rem 0 0; color: #005c82; }
.imc-status:empty { margin: 0; }
.imc-status.is-summary { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.imc-scope { margin: 1rem 0 0; color: #475569; font-size: 0.875rem; }
@media (max-width: 991px) {
  .imc-calculator { grid-template-columns: 1fr; gap: 2rem; }
}
@media (max-width: 767px) {
  .imc-calculator { padding-top: 2rem; padding-bottom: 2rem; }
  .imc-fields { grid-template-columns: 1fr; gap: 1rem; }
  .imc-actions { gap: 0.5rem; }
  .imc-submit { flex: 1 0 100%; justify-content: space-between; }
}

/* IMC — resultado y estado inicial */
.imc-result { padding: 1.5rem; background: #eaf8f5; color: #294e55; scroll-margin-top: 100px; }
.imc-result h2 { color: #006d68; }
.imc-result:focus-visible { outline: 3px solid #0077b6; outline-offset: 4px; }
.imc-result__reading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin-bottom: 0.5rem; }
.imc-value { margin: 0; color: #0077b6; font-variant-numeric: tabular-nums; }
.imc-value strong { font-size: 2.75rem; font-weight: 600; line-height: 1.1; }
.imc-value span { margin-left: 0.25rem; color: #3e6268; font-size: 0.875rem; }
.imc-category { margin: 0; }
.imc-category strong { color: #003d5b; font-size: 1rem; font-weight: 600; }
#imc-measurements { margin-bottom: 0; font-size: 0.875rem; color: #3e6268; }
.imc-result__hint { font-size: 0.8125rem; color: #3e6268; }
.imc-result__note { margin: 1.25rem 0 0; font-size: 0.875rem; }
.imc-scale { margin: 2rem 0 1rem; }
.imc-scale__graphic { position: relative; margin: 0 0.375rem; }
.imc-scale [data-scale-category="bajo"] { --imc-range-color: #487fab; }
.imc-scale [data-scale-category="saludable"] { --imc-range-color: #168573; }
.imc-scale [data-scale-category="sobrepeso"] { --imc-range-color: #a66d12; }
.imc-scale [data-scale-category="obesidad"] { --imc-range-color: #ad6255; }
.imc-scale__track { display: flex; height: 10px; overflow: hidden; }
.imc-scale__segment { border-right: 2px solid #eaf8f5; background: var(--imc-range-color); }
.imc-scale__segment.is-current { outline: 2px solid #003d5b; outline-offset: -2px; }
.imc-scale__segment:nth-child(1) { width: 28.3333%; }
.imc-scale__segment:nth-child(2) { width: 21.6667%; }
.imc-scale__segment:nth-child(3) { width: 16.6667%; }
.imc-scale__segment:nth-child(4) { width: 33.3333%; border: 0; }
.imc-scale__marker { position: absolute; top: -14px; width: 3px; height: 28px; background: #003d5b; transform: translateX(-50%); outline: 1px solid #eaf8f5; }
.imc-scale__marker::before { content: ''; position: absolute; top: -3px; left: 50%; transform: translateX(-50%); border: 6px solid transparent; border-top: 8px solid #003d5b; }
.imc-scale__ticks { position: relative; height: 26px; margin-top: 0.5rem; color: #3e6268; font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.imc-scale__ticks span { position: absolute; transform: translateX(-50%); }
.imc-scale__ticks span:first-child { left: 0; transform: none; }
.imc-scale__ticks span:last-child { right: 0; transform: none; }
.imc-scale__legend { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem 1rem; padding: 0; margin: 0.5rem 0 0; color: #3e6268; list-style: none; font-size: 0.8125rem; }
.imc-scale__legend li { position: relative; padding-left: 14px; }
.imc-scale__legend li::before { content: ''; position: absolute; top: 0.4em; left: 0; width: 7px; height: 7px; background: var(--imc-range-color); }
.imc-scale__legend li > span { display: block; font-size: 0.75rem; }
.imc-scale__legend .is-current { color: #003d5b; font-weight: 700; }
#imc-scale-note { margin: 1rem 0 0; }
@media (max-width: 991px) {
  .imc-result { padding: 1.25rem; }
}
@media (forced-colors: active) {
  .imc-scale__segment { border: 1px solid CanvasText; background: Canvas; }
  .imc-scale__segment.is-current { background: Highlight; outline-color: CanvasText; }
  .imc-scale__marker { background: CanvasText; outline-color: Canvas; }
  .imc-scale__marker::before { border-top-color: CanvasText; }
}

/* IMC — interpretación y fuentes */
.imc-guide { padding: 2.5rem 0; border-top: 1px solid #cddce4; background: #fff; }
.imc-guide__columns { display: grid; grid-template-columns: 5fr 6fr; gap: 3rem; }
.imc-guide__columns > div { min-width: 0; }
.imc-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.imc-table th, .imc-table td { padding: 1rem 0.75rem; border-bottom: 1px solid #cddce4; text-align: left; }
.imc-table th { color: #003d5b; }
.imc-table th:first-child { padding-left: 0.5rem; font-variant-numeric: tabular-nums; }
.imc-table thead { font-size: 0.8125rem; }
.imc-table thead { background: #e4f3fa; }
.imc-table .is-current { background: #dff3ed; }
.imc-current { display: block; margin-top: 0.25rem; color: #005c82; font-size: 0.8125rem; font-weight: 700; }
.imc-table caption, .imc-source { color: #475569; font-size: 0.8125rem; line-height: 1.6; }
.imc-source { margin: 1rem 0 0; }
.imc-explanation details { border-bottom: 1px solid #cddce4; }
.imc-explanation summary { min-height: 48px; padding: 1rem 0; color: #003d5b; font-weight: 600; cursor: pointer; }
.imc-formula { color: #003d5b; font-weight: 600; }
.imc-back { margin: 1.5rem 0 0; }
.imc-back a { display: inline-flex; align-items: center; gap: 0.75rem; min-height: 48px; }
@media (max-width: 991px) {
  .imc-guide__columns { grid-template-columns: 1fr; gap: 2rem; }
}
@media (max-width: 767px) {
  .imc-guide { padding: 2rem 0; }
}
