.rights-body {
  --rights-ink: #2f2f2b;
  --rights-muted: #6b5b4b;
  --rights-soft: #9b8573;
  --rights-line: #e4d9c6;
  --rights-line-strong: #cdbfae;
  --rights-gold: #c7a977;
  --rights-cream: #f4efe7;
  background:
    radial-gradient(circle at 18% 8%, rgba(220, 200, 181, .34), transparent 31rem),
    linear-gradient(180deg, #faf8f4 0%, #f1ebe1 100%) !important;
}

.rights-page.auth-page.section-shell {
  /* Aquí había un width de 1160 px que nunca llegó a aplicarse: el contenedor
     común lo ganaba por especificidad y la pantalla se ve a 1180. Retirado con la
     tarea 5766 para que no cambie al unificar el contenedor; anotado en el informe. */
  min-height: 100dvh;
  padding: clamp(22px, 4vw, 56px) 0 clamp(52px, 7vw, 88px);
  align-items: flex-start;
}

.rights-shell.auth-card.legal-card {
  position: relative;
  width: 100%;
  padding: clamp(24px, 4.4vw, 56px);
  border-color: rgba(205, 191, 174, .76);
  border-radius: 28px;
  background: rgba(253, 252, 248, .94);
  box-shadow: 0 32px 80px -54px rgba(74, 64, 53, .46);
}

.rights-back {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px 8px;
  color: var(--rights-muted) !important;
  font: 600 .78rem/1 Geist, Montserrat, sans-serif !important;
  text-decoration: none !important;
}
.rights-back::before { content: "←"; color: var(--rights-gold); font-size: 1rem; }
.rights-back:hover { color: var(--rights-ink) !important; }
.rights-back:focus-visible { border-radius: 5px; outline: 2px solid var(--rights-gold); outline-offset: 2px; }

.rights-header {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(260px, .72fr);
  gap: clamp(28px, 6vw, 84px);
  align-items: end;
  margin-bottom: clamp(34px, 5vw, 54px);
}
.rights-header .eyebrow { margin-bottom: 12px; }
.rights-header h1 { margin: 0 !important; font-size: var(--heading-1) !important; letter-spacing: var(--heading-tracking, -0.01em); }
.rights-header .rights-lead {
  margin: 0 0 7px;
  max-width: 39ch;
  color: var(--rights-muted);
  font: 450 clamp(.94rem, 1.4vw, 1.06rem)/1.62 Geist, Montserrat, sans-serif;
  text-wrap: pretty;
}

.rights-form { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(270px, .72fr); gap: clamp(28px, 4vw, 52px); align-items: start; }
.rights-main { min-width: 0; }
.rights-options { margin: 0; padding: 0; border: 0; }
.rights-options legend { padding: 0; color: var(--rights-ink); font: 600 1.02rem/1.3 Geist, Montserrat, sans-serif; }
.rights-options > p { margin: 5px 0 18px; color: var(--rights-soft); font: 500 .79rem/1.45 Geist, Montserrat, sans-serif; }
.rights-option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rights-option {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 18px;
  gap: 12px;
  align-items: start;
  min-height: 112px;
  padding: 17px;
  border: 1px solid var(--rights-line);
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  transition: transform 150ms cubic-bezier(.23,1,.32,1), border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}
.rights-option input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.rights-option-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; background: var(--rights-cream); color: var(--rights-muted); }
.rights-option-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.rights-option-copy { min-width: 0; }
.rights-option-copy strong, .rights-option-copy small { display: block; }
.rights-option-copy strong { color: var(--rights-ink); font: 600 .88rem/1.35 Geist, Montserrat, sans-serif; }
.rights-option-copy small { margin-top: 5px; color: var(--rights-muted); font: 450 .73rem/1.42 Geist, Montserrat, sans-serif; text-wrap: pretty; }
.rights-option-check { width: 17px; height: 17px; margin-top: 1px; border: 1px solid var(--rights-line-strong); border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 4px #fff; }
.rights-option:has(input:checked) { border-color: var(--rights-gold); background: #fdfaf4; box-shadow: 0 10px 28px -22px rgba(107, 91, 75, .7); }
.rights-option:has(input:checked) .rights-option-check { border-color: var(--rights-muted); background: var(--rights-muted); }
.rights-option:has(input:focus-visible) { outline: 3px solid rgba(199, 169, 119, .3); outline-offset: 2px; }
.rights-option:active { transform: scale(.985); }

.rights-email { display: grid; gap: 7px; margin-top: 24px; }
.rights-email > span { color: var(--rights-ink); font: 600 .79rem/1.3 Geist, Montserrat, sans-serif; }
.rights-email input {
  box-sizing: border-box;
  width: 100%;
  height: 48px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--rights-line-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--rights-ink);
  font: 500 .9rem/1 Geist, Montserrat, sans-serif;
}
.rights-email input[readonly] { background: #f8f6f2; color: var(--rights-muted); }
.rights-email input:focus { border-color: var(--rights-gold); outline: 3px solid rgba(199, 169, 119, .22); }
.rights-email small { color: var(--rights-soft); font: 500 .7rem/1.4 Geist, Montserrat, sans-serif; }

.rights-submit.button.primary {
  display: flex;
  width: 100%;
  min-height: 48px;
  justify-content: space-between;
  margin-top: 24px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #6b5b4b 0%, #6b5b4b 42%, #4a4a42 100%);
  color: #fff;
  font: 600 .84rem/1 Geist, Montserrat, sans-serif;
  transition: transform 150ms cubic-bezier(.23,1,.32,1), background 150ms ease;
}
.rights-submit.button.primary:hover { background: linear-gradient(135deg, #4a4a42 0%, #2f2f2b 100%); }
.rights-submit.button.primary:active { transform: scale(.985); }

.rights-process { padding: 4px 0 4px clamp(24px, 4vw, 44px); border-left: 1px solid var(--rights-line); }
.rights-process .eyebrow { margin: 0 0 24px; color: var(--rights-soft); }
.rights-process ol { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.rights-process li { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding-bottom: 25px; }
.rights-process li:not(:last-child)::after { content: ""; position: absolute; top: 29px; bottom: 5px; left: 13px; width: 1px; background: var(--rights-line); }
.rights-process li > span { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid var(--rights-line); border-radius: 9px; background: #faf8f4; color: var(--rights-muted); font: 600 .68rem/1 Geist, sans-serif; }
.rights-process li strong, .rights-process li small { display: block; }
.rights-process li strong { margin-top: 2px; color: var(--rights-ink); font: 600 .8rem/1.35 Geist, Montserrat, sans-serif; }
.rights-process li small { margin-top: 4px; color: var(--rights-muted); font: 450 .72rem/1.45 Geist, Montserrat, sans-serif; }
.rights-legal-note { margin: 5px 0 0 !important; padding-top: 18px; border-top: 1px solid var(--rights-line); color: var(--rights-soft) !important; font: 500 .7rem/1.5 Geist, Montserrat, sans-serif !important; }

.rights-error { margin: 0 0 22px; border-radius: 12px; font: 550 .8rem/1.5 Geist, sans-serif; }
.rights-success { max-width: 580px; margin: 20px auto 12px; text-align: center; }
.rights-success-mark { display: grid; width: 54px; height: 54px; margin: 0 auto 22px; place-items: center; border-radius: 17px; background: var(--rights-cream); color: var(--rights-muted); }
.rights-success-mark svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rights-success .eyebrow { margin-bottom: 10px; }
.rights-success h2 { margin: 0 0 10px; padding: 0; border: 0; font-size: clamp(2rem, 5vw, 2.8rem) !important; }
.rights-success p { margin-inline: auto; }
.rights-reference { display: block; width: fit-content; margin: 24px auto; padding: 12px 17px; border: 1px solid var(--rights-line); border-radius: 11px; background: #faf8f4; color: var(--rights-ink); font: 600 .9rem/1 Geist, monospace; letter-spacing: .06em; }
.rights-success a { display: inline-flex; min-height: 42px; align-items: center; color: var(--rights-muted); font: 600 .78rem/1 Geist, sans-serif; }

@media (hover: hover) and (pointer: fine) {
  .rights-option:hover { transform: translateY(-1px); border-color: var(--rights-line-strong); }
}
@media (max-width: 820px) {
  .rights-header, .rights-form { grid-template-columns: 1fr; }
  .rights-header { gap: 16px; }
  .rights-header .rights-lead { max-width: 56ch; }
  .rights-process { padding: 26px 0 0; border-top: 1px solid var(--rights-line); border-left: 0; }
}
@media (max-width: 580px) {
  .rights-page.auth-page.section-shell { width: calc(100% - 12px); padding-top: 6px; }
  .rights-shell.auth-card.legal-card { padding: 22px 18px 30px; border-radius: 20px; }
  .rights-back { margin: 0 0 8px 8px; }
  .rights-header { margin-bottom: 30px; }
  /* El tamaño móvil lo trae ya el clamp de var(--heading-1). */
  .rights-option-grid { grid-template-columns: 1fr; }
  .rights-option { min-height: 96px; }
}
@media (prefers-reduced-motion: reduce) {
  .rights-option, .rights-submit.button.primary { transition: none; }
}

/* Consentimiento de salud: subpágina integrada con Mis datos. */
.account-health-consent-page {
  --ahc-ink: #2f2f2b;
  --ahc-ink-soft: #4a4a42;
  --ahc-muted: #6b5b4b;
  --ahc-faint: #9b8573;
  --ahc-line: #e4d9c6;
  --ahc-line-strong: #cdbfae;
  --ahc-gold: #c7a977;
  --ahc-sage: #8d9a84;
  --ahc-paper: #f4efe7;
  --ahc-card: #fcfbf8;
  --ahc-ease-out: cubic-bezier(.23, 1, .32, 1);
  margin: 0;
  background:
    radial-gradient(56rem 28rem at 18% 0, rgba(255,255,255,.72), transparent 72%),
    linear-gradient(180deg, #f8f6f2 0%, var(--ahc-paper) 100%);
  color: var(--ahc-ink);
  font-family: Geist, Montserrat, system-ui, sans-serif;
}

/* Esta hoja la comparten dos pantallas y sólo una declaraba su propia columna:
   la declaración va acotada al body del consentimiento. El «Volver» cuelga del
   <body> y lee las mismas dos variables, así que deja de quedarse corto. Tarea
   5795; los tokens, lote 6 del sistema de página: medía 1120 y es una página de
   trabajo como las demás.

   El ancho y el aire de arriba y de abajo los pone ya el TIPO desde el lote 7:
   el contenedor lleva la clase `page` y esta hoja no vuelve a escribir la
   fórmula ni el relleno inferior (medía 84 px contra los 88 de --page-bottom). */
body.account-health-consent-page { --shell-max: var(--page-max); --shell-gutter: var(--page-gutter); }
.health-consent-shell { position: relative; z-index: 1; margin: 4px auto 0; }
.health-consent-card { overflow: hidden; border: 1px solid rgba(205,191,174,.76); border-radius: 28px; background: rgba(252,251,248,.96); box-shadow: 0 34px 84px -60px rgba(74,64,53,.6); }
.health-consent-header { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 24px; align-items: end; padding: clamp(30px,5vw,58px) clamp(24px,5vw,58px) clamp(28px,4vw,44px); border-bottom: 1px solid var(--ahc-line); }
/* Volanta: receta única (issue 5569). */
.health-consent-eyebrow { margin: 0 0 12px; color: var(--eyebrow-color, #6B5B4B); font-family: var(--eyebrow-family, "Geist", Montserrat, system-ui, sans-serif); font-size: var(--eyebrow-size, 0.69rem); font-weight: var(--eyebrow-weight, 600); letter-spacing: var(--eyebrow-tracking, 0.14em); text-transform: uppercase; }
.health-consent-header h1 { max-width: 780px; margin: 0; color: var(--ahc-ink); font-family: var(--font-display, "Cormorant Garamond", Georgia, serif); font-weight: var(--heading-weight-soft, 400); font-size: var(--heading-1); line-height: var(--heading-leading-tight, 0.98); letter-spacing: var(--heading-tracking, -0.01em); text-wrap: balance; }
.health-consent-status { display: inline-flex; min-height: 34px; align-items: center; gap: 8px; margin-bottom: 4px; padding: 0 12px; border: 1px solid var(--ahc-line); border-radius: 999px; background: #fff; color: var(--ahc-muted); font-size: .7rem; font-weight: 700; white-space: nowrap; }
.health-consent-status > span { width: 7px; height: 7px; border-radius: 50%; background: var(--ahc-faint); box-shadow: 0 0 0 4px rgba(155,133,115,.1); }
.health-consent-status.is-active > span { background: #68785f; box-shadow: 0 0 0 4px rgba(104,120,95,.12); }

.health-consent-notice { display: grid; grid-template-columns: 44px minmax(0,1fr); gap: 14px; margin: 24px clamp(24px,5vw,58px) 0; padding: 16px 18px; border: 1px solid rgba(141,154,132,.35); border-radius: 16px; background: rgba(141,154,132,.1); }
.health-consent-notice__icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; background: rgba(255,255,255,.72); color: var(--ahc-muted); }
.health-consent-notice__icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.health-consent-notice strong { display: block; margin-top: 1px; color: var(--ahc-ink); font-size: .88rem; }
.health-consent-notice p { margin: 4px 0 0; color: var(--ahc-muted); font-size: .78rem; line-height: 1.55; }

.health-consent-layout { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(270px,.7fr); gap: clamp(30px,5vw,62px); padding: clamp(30px,5vw,58px); }
.health-consent-main { min-width: 0; }
.health-consent-lead { max-width: 62ch; margin: 0; color: var(--ahc-ink-soft); font-size: clamp(.96rem,1.5vw,1.08rem); font-weight: 450; line-height: 1.7; text-wrap: pretty; }
.health-consent-detail { display: grid; grid-template-columns: 42px minmax(0,1fr); gap: 14px; margin-top: 28px; padding: 20px; border: 1px solid var(--ahc-line); border-radius: 17px; background: #f8f6f2; }
.health-consent-detail__icon { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 12px; background: #fff; color: var(--ahc-muted); }
.health-consent-detail__icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
/* Sube de .9rem al suelo de 16px, que es donde empieza un encabezado (issue 5781).
   Se queda en h2 porque es la ÚNICA sección de esta pantalla: bajarlo a h3 la dejaba
   saltando de h1 a h3, y un aviso solo no justifica inventarle una sección por encima.
   Es, eso sí, el h2 más pequeño de la aplicación, y su motivo es éste. */
.health-consent-detail h2 { margin: 1px 0 6px; color: var(--ahc-ink); font-family: var(--font-ui); font-size: 1rem; font-weight: 600; }
.health-consent-detail p { margin: 0; color: var(--ahc-muted); font-size: .77rem; line-height: 1.58; text-wrap: pretty; }
.health-consent-legal { max-width: 64ch; margin: 18px 2px 0; color: var(--ahc-faint); font-size: .71rem; line-height: 1.55; }
.health-consent-form { margin-top: 24px; }
.health-consent-withdraw, .health-consent-primary { box-sizing: border-box; display: inline-flex; min-height: 46px; align-items: center; justify-content: center; padding: 0 18px; border-radius: 12px; font: 600 .8rem/1 Geist, Montserrat, sans-serif; cursor: pointer; transition: transform 140ms var(--ahc-ease-out), background 150ms ease, border-color 150ms ease; }
.health-consent-withdraw { border: 1px solid rgba(176,88,74,.3); background: #f8e9e4; color: #9b4f48; }
.health-consent-primary { border: 0; background: linear-gradient(135deg,#6b5b4b 0%,#6b5b4b 42%,#4a4a42 100%); color: #fff; text-decoration: none; }
.health-consent-withdraw:active, .health-consent-primary:active { transform: scale(.97); }
.health-consent-withdraw:focus-visible, .health-consent-primary:focus-visible { outline: 2px solid var(--ahc-gold); outline-offset: 3px; }

.health-consent-summary { padding-left: clamp(24px,4vw,42px); border-left: 1px solid var(--ahc-line); }
.health-consent-summary > p { margin: 1px 0 22px; color: var(--eyebrow-color, #6B5B4B); font-family: var(--eyebrow-family, "Geist", Montserrat, system-ui, sans-serif); font-size: var(--eyebrow-size, 0.69rem); font-weight: var(--eyebrow-weight, 600); letter-spacing: var(--eyebrow-tracking, 0.14em); text-transform: uppercase; }
.health-consent-summary ul { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.health-consent-summary li { position: relative; display: grid; grid-template-columns: 30px minmax(0,1fr); gap: 12px; padding-bottom: 24px; }
.health-consent-summary li:not(:last-child)::after { content: ""; position: absolute; top: 31px; bottom: 5px; left: 14px; width: 1px; background: var(--ahc-line); }
.health-consent-summary li > span { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid var(--ahc-line); border-radius: 9px; background: #f8f6f2; color: var(--ahc-faint); font-size: .62rem; font-weight: 700; }
.health-consent-summary strong, .health-consent-summary small { display: block; }
.health-consent-summary strong { margin-top: 2px; color: var(--ahc-ink); font-size: .8rem; font-weight: 600; }
.health-consent-summary small { margin-top: 4px; color: var(--ahc-muted); font-size: .71rem; line-height: 1.5; text-wrap: pretty; }

@media (hover: hover) and (pointer: fine) {
  .health-consent-withdraw:hover { border-color: rgba(155,79,72,.5); background: #f2ddd6; }
  .health-consent-primary:hover { background: linear-gradient(135deg,#4a4a42 0%,#2f2f2b 100%); }
}
@media (max-width: 760px) {
  .health-consent-shell { width: calc(100% - 12px); }
  .health-consent-card { border-radius: 20px; }
  .health-consent-header { grid-template-columns: 1fr; align-items: start; gap: 18px; padding: 28px 20px 26px; }
  /* El tamaño móvil lo trae ya el clamp de var(--heading-1). */
  .health-consent-status { width: fit-content; margin: 0; }
  .health-consent-notice { margin: 18px 20px 0; }
  .health-consent-layout { grid-template-columns: 1fr; gap: 30px; padding: 28px 20px 34px; }
  .health-consent-summary { padding: 26px 0 0; border-top: 1px solid var(--ahc-line); border-left: 0; }
  .health-consent-withdraw, .health-consent-primary { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .health-consent-withdraw, .health-consent-primary { transition: none; }
}
