:root {
  color-scheme: light;
  --paper: #fcf9f6;
  --white: #fffdfb;
  --ink: #342630;
  --muted: #695d64;
  --plum: #602e4b;
  --plum-dark: #412239;
  --line: #e9dfdf;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 300px; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 1rem/1.55 var(--sans); }
#app { min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--plum); text-underline-offset: .16em; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.13; }
:focus-visible { outline: 3px solid #9c386f; outline-offset: 4px; }
#contenido:focus { outline: none; }
.icon { width: 1.125rem; height: 1.125rem; flex: none; vertical-align: middle; }
.shell { width: min(100% - 6rem, 1248px); margin-inline: auto; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link:focus { position: fixed; z-index: 5; top: .6rem; left: .6rem; padding: .55rem 1rem; background: white; }

.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 78px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; }
.brand { width: max-content; display: flex; align-items: center; gap: .72rem; color: #412337; font: bold 1.24rem/1.1 var(--serif); text-decoration: none; }
.brand-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: #fff3f7; background: #62364f; }
.brand-icon .icon { width: 24px; height: 24px; }
.brand-subtitle { display: block; margin-top: .25rem; color: #715b68; font: 720 .67rem/1 var(--sans); letter-spacing: .13em; }
.primary-nav, .module-nav { display: flex; align-items: center; gap: .3rem; }
.primary-nav a, .module-nav a { display: inline-flex; align-items: center; justify-content: center; gap: .47rem; min-height: 42px; padding: .45rem .78rem; border-radius: 9px; color: #66535f; text-decoration: none; font-size: .9rem; font-weight: 650; white-space: nowrap; }
.primary-nav a:hover, .module-nav a:hover { color: var(--plum); background: #f9edf2; }
.primary-nav a[aria-current], .module-nav a[aria-current] { color: #6a3654; background: #f3e5eb; }
#site-progress { justify-self: end; }
.header-progress { display: flex; gap: .6rem; align-items: center; color: var(--muted); text-decoration: none; }
.header-progress:hover strong { text-decoration: underline; }
.progress-ring { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(#984c74 var(--progress), #eddee6 0); color: var(--plum); }
.progress-ring .icon { padding: 4px; width: 28px; height: 28px; border-radius: 50%; background: var(--white); }
.progress-text { display: grid; gap: .15rem; font-size: .77rem; line-height: 1.12; white-space: nowrap; }
.progress-text strong { font-size: .88rem; color: #503448; }

.main-shell { flex: 1; padding-block: 33px 4.2rem; }
.hero { position: relative; isolation: isolate; min-height: 370px; overflow: hidden; display: grid; align-items: center; border-radius: 23px; background: #49293f; color: #fff9fa; }

.hero::after { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, #43243a 0%, #49293f 34%, rgba(73, 41, 63, .96) 40%, rgba(73, 41, 63, .55) 53%, transparent 74%); }
.hero-content { padding: 2.45rem 0 2.75rem clamp(2rem, 4.4vw, 4.25rem); max-width: 650px; }
.hero-kicker { width: max-content; display: inline-flex; align-items: center; gap: .48rem; margin-bottom: 1.15rem; padding: .46rem .72rem; border: 1px solid rgba(244, 214, 229, .28); border-radius: 6px; color: #f3dce8; background: rgba(255, 225, 243, .08); font-size: .73rem; font-weight: 720; line-height: 1.15; letter-spacing: .13em; }
.hero-kicker .icon { width: 15px; height: 15px; }
.hero h1 { margin: 0 0 1rem; font: 500 clamp(3.25rem, 5vw, 4.55rem)/.99 var(--serif); letter-spacing: -.062em; }
.hero p { max-width: 430px; margin-bottom: 1.55rem; color: #f0dfe7; font-size: 1.03rem; line-height: 1.53; }
.hero-actions { display: flex; gap: .7rem; flex-wrap: wrap; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: .45rem; width: max-content; max-width: 100%; min-height: 45px; border: 1px solid transparent; border-radius: 8px; padding: .56rem 1rem; color: var(--plum); font-size: .91rem; font-weight: 680; line-height: 1.3; text-align: center; text-decoration: none; }
.button-light { background: #fae7ee; color: #4a263e; }
.button-light:hover { background: #fff7fa; }
.button-outline { border-color: #ae889f; background: rgba(63, 34, 54, .55); color: #fff8fa; }
.button-outline:hover { background: #754d65; }
.hero a:focus-visible { outline-color: #ffd7eb; }
.button-primary { background: #653652; color: #fff9fc; }
.button-primary:hover { background: var(--plum-dark); }
.button-secondary { background: #f8edf2; border-color: #ead7e1; }
.button-secondary:hover { background: #f2e1ea; border-color: #cfa9bd; }

.module-section { margin-top: 2.65rem; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.28rem; }
.section-heading h2, .lesson-section > h2, .lesson-header h2 { margin: 0 0 .42rem; font: 500 clamp(1.9rem, 3.25vw, 2.55rem)/1.08 var(--serif); letter-spacing: -.045em; }
.section-heading p, .page-intro p, .lesson-header p { margin: 0; color: var(--muted); }
.count-label { display: inline-flex; align-items: center; gap: .45rem; flex: none; color: #6d4c5f; border: 1px solid #eadfe3; border-radius: 8px; padding: .44rem .65rem; font-size: .84rem; font-weight: 650; }
.count-label .icon { width: 1rem; height: 1rem; }
.module-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.05rem; align-items: stretch; }
.tint-rose { --tint: #f7e3e8; --tone: #8b4562; --soft: #fbf0f3; }
.tint-pink { --tint: #f8e2dd; --tone: #964b44; --soft: #fdf1ee; }
.tint-violet { --tint: #eee3f4; --tone: #785189; --soft: #f7f1f9; }
.tint-amber { --tint: #f6ead1; --tone: #845a33; --soft: #fcf5e9; }
.tint-mint { --tint: #e4eee5; --tone: #45694e; --soft: #f1f6ef; }
.module-card { position: relative; min-width: 0; min-height: 225px; display: flex; flex-direction: column; padding: 1.28rem 1.32rem 1.05rem; border: 1px solid #e8dedf; border-radius: 15px; background: var(--white); box-shadow: 0 2px 3px rgba(66, 36, 57, .025); transition: background .18s, border-color .18s; }
.module-card:hover, .module-card:focus-within { background: var(--soft); border-color: #cfabbc; }
.module-top { display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem; }
.module-icon { width: 47px; height: 47px; display: grid; flex: none; place-items: center; border-radius: 12px; color: var(--tone); background: var(--tint); }
.module-icon .icon { width: 25px; height: 25px; }
.module-position, .eyebrow { margin: 0; color: var(--tone, #805167); font-size: .75rem; line-height: 1.15; letter-spacing: .115em; font-weight: 740; }
.completed-badge { margin-left: auto; color: #32664e; }
.module-title { color: var(--ink); }
.module-title::after { position: absolute; inset: 0; content: ""; border-radius: 15px; }
.module-card h3 { margin-bottom: .46rem; font: 500 clamp(1.35rem, 1.8vw, 1.62rem)/1.12 var(--serif); letter-spacing: -.027em; }
.module-card p { color: var(--muted); margin-bottom: 1.15rem; line-height: 1.5; }
.module-bottom { display: flex; flex-wrap: wrap; gap: .45rem 1rem; margin-top: auto; padding-top: .7rem; border-top: 1px solid #eadfe2; color: #725663; font-size: .84rem; font-weight: 570; }
.module-bottom span { display: inline-flex; align-items: center; gap: .36rem; }
.module-bottom .icon { width: 15px; height: 15px; }

.page-intro { padding: 2.25rem 2.6rem; background: #f4e8ee; border: 1px solid #ebdce4; border-radius: 17px; }
.page-intro h1, .module-hero h1 { margin-bottom: .62rem; font: 500 clamp(2.45rem, 5vw, 4rem)/1 var(--serif); letter-spacing: -.052em; }
.page-intro p { max-width: 700px; }
.page-intro .progress-summary { margin-top: .8rem; color: #66364f; }
.directory-list { display: grid; gap: .8rem; margin-top: 1.4rem; }
.directory-card { display: flex; align-items: center; gap: 1.05rem; padding: 1rem 1.25rem; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.directory-text { flex: 1; }
.directory-text h2 { margin: 0 0 .25rem; font: 500 1.4rem/1.15 var(--serif); }
.directory-text p { margin: 0; color: var(--muted); }

.back-link { display: inline-flex; min-height: 38px; align-items: center; gap: .42rem; margin-bottom: .55rem; font-size: .91rem; font-weight: 650; }
.module-hero { display: flex; gap: 1.25rem; padding: 2.05rem 2.25rem; align-items: center; background: var(--soft); border: 1px solid var(--tint); border-radius: 17px; }
.module-hero .module-icon { width: 61px; height: 61px; border-radius: 15px; }
.module-hero .module-icon .icon { width: 33px; height: 33px; }
.module-hero .eyebrow { margin-bottom: .5rem; }
.module-hero div > p:last-child { margin: 0; color: var(--muted); }
.module-nav { flex-wrap: wrap; margin: 1rem 0 1.7rem; padding-bottom: .7rem; border-bottom: 1px solid var(--line); }
.lesson-section { max-width: 900px; margin-inline: auto; }
.lesson-section > h2 { margin-bottom: 1rem; }
.lesson-header { margin-bottom: 1.15rem; }
.lesson-header .eyebrow { display: inline-block; margin-bottom: .45rem; }
.lesson-grid { display: grid; gap: .68rem; margin-bottom: 1rem; }
.lesson-card, .case-file, .question, .discussion-card, .quiz-item { padding: 1.15rem 1.35rem; background: var(--white); border: 1px solid var(--line); border-radius: 12px; }
.lesson-card h3, .evidence-panel h3, .discussion-card h3 { margin: 0 0 .45rem; font: 600 1.25rem/1.2 var(--serif); }
.lesson-card p, .evidence-panel p, .discussion-card p { margin: 0; color: var(--muted); }
.references { padding: .7rem 1rem; margin-block: .7rem 1.15rem; border: 1px solid var(--line); border-radius: 9px; background: var(--white); }
summary { width: fit-content; cursor: pointer; color: var(--plum); font-weight: 680; }
.references ul { margin-block: .65rem .35rem; padding-inline-start: 1.2rem; }
.references li + li { margin-top: .35rem; }
.case-file { margin-bottom: .85rem; }
.case-steps { display: flex; flex-wrap: wrap; gap: .4rem; padding-bottom: .8rem; margin-bottom: .85rem; border-bottom: 1px solid var(--line); }
.case-step { min-height: 42px; padding: .4rem .75rem; border: 1px solid var(--line); border-radius: 7px; background: var(--white); color: var(--plum); font-size: .91rem; font-weight: 675; }
.case-step:hover { border-color: #b788a4; }
.case-step[aria-pressed="true"] { background: #f1e0e9; border-color: #e3c9d7; }
.question { margin-bottom: 1rem; }
.question fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.question legend { margin-bottom: .72rem; padding: 0; font-weight: 690; font-size: 1.06rem; }
.options { display: grid; gap: .4rem; margin-bottom: .85rem; }
.option { display: flex; align-items: flex-start; gap: .57rem; padding: .58rem .68rem; border-radius: 7px; border: 1px solid var(--line); cursor: pointer; }
.option input { flex: none; width: 1.05rem; height: 1.05rem; margin: .24rem 0 0; accent-color: var(--plum); }
.option:has(input:checked), .option:hover { border-color: #b686a0; }
.option:has(input:disabled) { cursor: default; }
.option-right, .option.option-right:hover { background: #edf6ef; border-color: #9dbfa8; }
.option-wrong, .option.option-wrong:hover { background: #fff1eb; border-color: #ddb7a6; }
.feedback { margin-bottom: .75rem; padding: .68rem .8rem; border-left: 3px solid currentColor; border-radius: 5px; }
.feedback-right { background: #edf6ef; color: #28553b; }
.feedback-wrong { background: #fff1eb; color: #79452e; }
.feedback p { margin: .32rem 0 0; }
.feedback strong { display: inline-flex; align-items: center; gap: .34rem; }
.discussion-card { margin-bottom: .7rem; }
.discussion-card label { display: block; margin-top: .8rem; margin-bottom: .25rem; color: var(--muted); font-size: .92rem; font-weight: 640; }
.discussion-card textarea { display: block; width: 100%; min-height: 90px; margin-bottom: .6rem; padding: .5rem .65rem; border: 1px solid #d1bac7; border-radius: 7px; color: var(--ink); background: #fff; resize: vertical; }
.discussion-card details p { margin-top: .45rem; }
.note-status { color: var(--muted); font-size: .9rem; }
.quiz-item { margin-bottom: .7rem; }
.quiz-item .question { margin: .4rem 0 0; padding: 0; border: 0; }
.quiz-item .feedback { margin-bottom: 0; }
.quiz-summary { margin-block: .8rem 1.05rem; color: var(--muted); }
.quiz-summary p { margin: 0; }
.quiz-finished { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .7rem; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 9px; background: #f6ebf1; color: var(--plum-dark); }

.site-footer { border-top: 1px solid var(--line); color: #746471; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 75px; font-size: .86rem; }
.footer-inner > span { display: inline-flex; align-items: center; gap: .4rem; color: #65485a; font-weight: 680; }
.footer-inner p { margin: 0; }

@media (max-width: 1050px) {
  .shell { width: calc(100% - 3.4rem); }
  .header-inner { gap: .4rem; }
  .primary-nav { gap: .12rem; }
  .primary-nav a { padding-inline: .55rem; }
}

@media (max-width: 790px) {
  .shell { width: calc(100% - 2rem); }
  .header-inner { grid-template-columns: 1fr 1fr; gap: .45rem; padding-top: .7rem; }
  .primary-nav { grid-row: 2; grid-column: 1 / -1; padding-block: .25rem .5rem; }
  .primary-nav a { flex: 1; }
  .main-shell { padding-top: 1.3rem; }
  .hero { min-height: 345px; }
  .hero-content { padding: 2.1rem 1rem 2.4rem 1.65rem; }
  .hero h1 { font-size: clamp(2.8rem, 7vw, 3.5rem); }

  .hero::after { background: linear-gradient(90deg, #43243a 0%, #49293f 31%, rgba(73, 41, 63, .88) 46%, rgba(73, 41, 63, .2) 85%); }
  .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .shell { width: calc(100% - 1.4rem); }
  .primary-nav { gap: .05rem; }
  .primary-nav a { gap: .25rem; min-width: 0; min-height: 44px; padding: .3rem .25rem; font-size: .78rem; }
  .primary-nav .icon { display: none; }
  .hero { display: block; min-height: 0; border-radius: 16px; }

  .hero::after { background: linear-gradient(180deg, rgba(73, 41, 63, .08) 5%, rgba(73, 41, 63, .13) 16%, #49293f 41%); }
  .hero-content { padding: 137px 1rem 1.25rem; }
  .hero-kicker { margin-bottom: .72rem; font-size: .66rem; }
  .hero h1 { font-size: clamp(2.45rem, 10.5vw, 3.3rem); margin-bottom: .65rem; }
  .hero p { font-size: .95rem; margin-bottom: .9rem; }
  .hero-actions { gap: .35rem; }
  .hero-actions .button { padding-inline: .58rem; font-size: .81rem; }
  .module-section { margin-top: 1.85rem; }
  .section-heading { align-items: flex-start; }
  .count-label { display: none; }
  .module-grid { grid-template-columns: 1fr; gap: .68rem; }
  .module-card { min-height: 195px; }
  .page-intro, .module-hero { padding: 1.1rem; }
  .module-hero { align-items: flex-start; gap: .65rem; }
  .module-hero .module-icon { width: 39px; height: 39px; border-radius: 8px; }
  .module-hero .module-icon .icon { width: 24px; height: 24px; }
  .module-hero h1 { font-size: 2rem; }
  .module-nav { display: grid; grid-template-columns: repeat(2, 1fr); gap: .22rem; margin-bottom: 1.2rem; }
  .module-nav a { justify-content: flex-start; font-size: .86rem; padding-inline: .45rem; }
  .directory-card { flex-wrap: wrap; gap: .6rem; padding: .8rem; }
  .directory-card .button { margin-left: calc(47px + .6rem); }
  .directory-text { flex-basis: 65%; }
  .lesson-card, .case-file, .question, .discussion-card, .quiz-item { padding: .9rem; }
  .case-step { font-size: .83rem; padding-inline: .42rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: .3rem; justify-content: center; padding-block: .7rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

#inicio, #modulos, #contenido { scroll-margin-top: 7rem; }

.module-summary { max-width: 44rem; margin-top: 1.4rem; }
.module-summary h2 { font: 500 1.55rem/1.2 var(--serif); }
.module-duration { margin-bottom: 0; }
.module-availability { color: var(--muted); }
