:root {
  --navy-950: #071426;
  --navy-900: #0b1d34;
  --navy-800: #123052;
  --blue-700: #1556a3;
  --blue-600: #1769c2;
  --blue-100: #e8f2ff;
  --cyan-400: #35c4d8;
  --gold-500: #f1b94a;
  --gold-100: #fff5d8;
  --green-700: #14734b;
  --green-100: #e6f7ef;
  --red-700: #a02c39;
  --red-100: #fff0f1;
  --orange-100: #fff3e2;
  --ink: #172436;
  --muted: #5d6a7c;
  --line: #dbe3ed;
  --surface: #ffffff;
  --surface-soft: #f4f7fb;
  --shadow-sm: 0 8px 24px rgba(5, 28, 55, 0.08);
  --shadow-lg: 0 24px 70px rgba(5, 28, 55, 0.16);
  --radius-sm: 0.6rem;
  --radius: 1rem;
  --radius-lg: 1.5rem;
  --content: 1180px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body.no-scroll {
  overflow: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--blue-700);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--navy-900);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid var(--gold-500);
  outline-offset: 3px;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.65em;
  color: var(--navy-950);
  font-weight: 780;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

h1 {
  font-size: clamp(2.35rem, 5.5vw, 4.65rem);
}

h2 {
  font-size: clamp(1.85rem, 3.5vw, 3rem);
}

h3 {
  font-size: clamp(1.15rem, 2vw, 1.45rem);
}

p {
  margin: 0 0 1rem;
}

.container {
  width: min(calc(100% - 2rem), var(--content));
  margin-inline: auto;
}

.section {
  padding: clamp(4rem, 8vw, 7rem) 0;
}

.section--soft {
  background: var(--surface-soft);
}

.section--dark {
  background: var(--navy-950);
  color: #dce8f7;
}

.section--dark h2,
.section--dark h3,
.section--dark .eyebrow {
  color: #fff;
}

.section-intro {
  max-width: 760px;
  margin-bottom: 2.5rem;
}

.section-intro--center {
  margin-inline: auto;
  text-align: center;
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--blue-700);
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.section--dark .muted {
  color: #aebfd2;
}

.small {
  font-size: 0.875rem;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 10000;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--navy-950);
  box-shadow: var(--shadow-lg);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.72rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 0.72rem;
  cursor: pointer;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: transform 150ms ease, background 150ms ease, border 150ms ease, box-shadow 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(4, 27, 54, 0.14);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
  box-shadow: none;
}

.button--primary {
  background: var(--blue-600);
  color: #fff;
}

.button--primary:hover {
  background: var(--blue-700);
  color: #fff;
}

.button--accent {
  background: var(--gold-500);
  color: var(--navy-950);
}

.button--accent:hover {
  background: #ffd06f;
  color: var(--navy-950);
}

.button--ghost {
  border-color: var(--line);
  background: #fff;
  color: var(--navy-900);
}

.button--ghost:hover {
  border-color: var(--blue-600);
  color: var(--blue-700);
}

.button--light {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.button--block {
  width: 100%;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Cabecera pública */
.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  border-bottom: 1px solid rgba(219, 227, 237, 0.9);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.site-header__inner {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--navy-950);
  font-weight: 850;
  line-height: 1.05;
  text-decoration: none;
}

.brand__mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 0.8rem;
  background: linear-gradient(135deg, var(--blue-600), var(--cyan-400));
  color: #fff;
  font-size: 1.2rem;
  box-shadow: 0 8px 20px rgba(23, 105, 194, 0.28);
}

.brand__text small {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.main-nav > a:not(.button) {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 650;
  text-decoration: none;
}

.main-nav > a:not(.button):hover {
  color: var(--blue-700);
}

.nav-toggle {
  display: none;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--navy-950);
  cursor: pointer;
  font-weight: 750;
}

/* Landing */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(4.5rem, 9vw, 8rem) 0;
  background: var(--navy-950);
  color: #dce8f7;
}

.hero::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(4, 14, 29, 0.97) 0%, rgba(4, 14, 29, 0.9) 35%, rgba(4, 14, 29, 0.44) 61%, rgba(4, 14, 29, 0.08) 100%),
    linear-gradient(0deg, rgba(4, 14, 29, 0.38), transparent 45%);
  content: "";
}

.hero--visual {
  display: grid;
  min-height: clamp(650px, 75vh, 780px);
  align-items: center;
}

.hero__media {
  position: absolute;
  z-index: 0;
  inset: 0;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero__grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(340px, 1.08fr);
  align-items: center;
  gap: clamp(2rem, 7vw, 6rem);
}

.hero__copy {
  max-width: 720px;
}

.hero h1 {
  max-width: 850px;
  color: #fff;
  text-shadow: 0 2px 22px rgba(0, 0, 0, 0.3);
}

.hero__lead {
  max-width: 720px;
  color: #c4d4e7;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.hero__trust {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.2rem;
  margin: 1.6rem 0 2rem;
  padding: 0;
  list-style: none;
}

.hero__trust li::before {
  margin-right: 0.45rem;
  color: var(--cyan-400);
  content: "✓";
  font-weight: 900;
}

.hero__disclaimer {
  max-width: 680px;
  margin-top: 1rem;
  color: #d4e0ee;
}

.price-card {
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(15px);
}

.price-card h2 {
  color: #fff;
  font-size: 1.25rem;
}

.price-card__amount {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.price-card__amount strong {
  color: #fff;
  font-size: 3.8rem;
  letter-spacing: -0.06em;
  line-height: 1;
}

.price-card ul,
.check-list {
  padding: 0;
  list-style: none;
}

.price-card li,
.check-list li {
  position: relative;
  margin: 0.65rem 0;
  padding-left: 1.55rem;
}

.price-card li::before,
.check-list li::before {
  position: absolute;
  left: 0;
  color: var(--cyan-400);
  content: "✓";
  font-weight: 900;
}

.trust-strip {
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.trust-strip__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.trust-item {
  padding: 1.35rem 1rem;
  border-right: 1px solid var(--line);
  text-align: center;
}

.trust-item:last-child {
  border: 0;
}

.trust-item strong,
.trust-item span {
  display: block;
}

.trust-item strong {
  color: var(--navy-950);
  font-size: 1.15rem;
}

.trust-item span {
  color: var(--muted);
  font-size: 0.82rem;
}

.feature-grid,
.module-grid,
.metric-grid,
.calculator-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.15rem;
}

.feature-card,
.module-card,
.metric-card,
.calculator-card,
.content-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.feature-card {
  padding: 1.6rem;
}

.feature-card__icon {
  display: grid;
  width: 46px;
  height: 46px;
  margin-bottom: 1rem;
  place-items: center;
  border-radius: 0.8rem;
  background: var(--blue-100);
  color: var(--blue-700);
  font-size: 1.3rem;
  font-weight: 900;
}

.module-list-public {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  counter-reset: module;
}

.module-list-public article {
  position: relative;
  min-height: 110px;
  padding: 1.25rem 1.25rem 1.25rem 4.4rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
  counter-increment: module;
}

.module-list-public article::before {
  position: absolute;
  top: 1.2rem;
  left: 1.2rem;
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  border-radius: 50%;
  background: var(--gold-500);
  color: var(--navy-950);
  content: counter(module, decimal-leading-zero);
  font-size: 0.78rem;
  font-weight: 850;
}

.module-list-public h3 {
  color: #fff;
  font-size: 1.05rem;
}

.module-list-public p {
  margin: 0;
  color: #aebfd2;
  font-size: 0.9rem;
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  counter-reset: steps;
}

.step {
  position: relative;
  padding: 1.5rem;
  border-top: 3px solid var(--blue-600);
  background: #fff;
  box-shadow: var(--shadow-sm);
  counter-increment: steps;
}

.step::before {
  color: var(--blue-600);
  content: "0" counter(steps);
  font-size: 0.78rem;
  font-weight: 850;
}

.comparison {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.comparison table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.comparison th,
.comparison td {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.comparison th {
  background: var(--navy-900);
  color: #fff;
}

.comparison tr:last-child td {
  border-bottom: 0;
}

.faq-list {
  max-width: 860px;
  margin-inline: auto;
}

.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-item summary {
  padding: 1.25rem 2.5rem 1.25rem 0;
  cursor: pointer;
  color: var(--navy-950);
  font-weight: 750;
}

.faq-item p {
  padding-right: 2rem;
  color: var(--muted);
}

.cta-panel {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 2rem;
  padding: clamp(2rem, 5vw, 4rem);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--blue-700), var(--navy-900));
  color: #dce8f7;
  box-shadow: var(--shadow-lg);
}

.cta-panel h2 {
  color: #fff;
}

.cta-panel__price {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  margin: 0 0 1rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: var(--gold-500);
  color: var(--navy-950);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
  line-height: 1;
}

.cta-panel__price span {
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.cta-panel__price strong {
  font-size: clamp(1.08rem, 2vw, 1.35rem);
  font-weight: 900;
  letter-spacing: -0.03em;
}

.lead-form {
  padding: 1.5rem;
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}

.lead-form__status {
  min-height: 1.5rem;
  margin-top: 0.8rem;
  font-size: 0.9rem;
}

.lead-form__status.is-success {
  color: var(--green-700);
}

.lead-form__status.is-error {
  color: var(--red-700);
}

/* Formularios */
.form-field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
  color: var(--navy-900);
  font-size: 0.9rem;
  font-weight: 700;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-height: 46px;
  padding: 0.7rem 0.8rem;
  border: 1px solid #bcc9d8;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-weight: 450;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--blue-600);
  outline: 3px solid rgba(23, 105, 194, 0.14);
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 0.8rem 0;
  font-size: 0.84rem;
}

.checkbox-field input {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.2rem;
}

.input-unit {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  overflow: hidden;
  border: 1px solid #bcc9d8;
  border-radius: var(--radius-sm);
}

.input-unit input {
  border: 0;
  border-radius: 0;
}

.input-unit > span {
  padding: 0 0.75rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
}

/* Nivel */
.page-hero {
  padding: 4rem 0;
  background: var(--navy-950);
  color: #c8d8e9;
}

.page-hero h1 {
  color: #fff;
  font-size: clamp(2rem, 5vw, 3.5rem);
}

.level-layout {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  align-items: start;
  gap: 2rem;
}

.level-info {
  position: sticky;
  top: 96px;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

/* Portal */
.portal-body {
  min-height: 100vh;
  background: #eef3f8;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 1.05fr 0.95fr;
}

.login-branding {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 7vw, 7rem);
  background:
    radial-gradient(circle at 10% 10%, rgba(53, 196, 216, 0.2), transparent 30%),
    var(--navy-950);
  color: #c4d4e7;
}

.login-branding h1 {
  color: #fff;
  font-size: clamp(2.1rem, 5vw, 4rem);
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 2rem;
}

.login-card {
  width: min(100%, 440px);
  padding: clamp(1.5rem, 5vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-lg);
}

.demo-credentials {
  margin: 1rem 0;
  padding: 0.9rem;
  border: 1px solid #bad8fb;
  border-radius: var(--radius-sm);
  background: var(--blue-100);
  font-size: 0.84rem;
}

.demo-credentials code {
  color: var(--navy-900);
  font-weight: 800;
}

.form-status {
  min-height: 1.6rem;
  margin: 0.75rem 0;
  color: var(--red-700);
  font-size: 0.9rem;
}

.portal-app {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 276px minmax(0, 1fr);
}

.portal-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  overflow-y: auto;
  padding: 1.25rem;
  background: var(--navy-950);
  color: #c9d7e8;
}

.portal-sidebar .brand {
  margin: 0.35rem 0 2rem;
  color: #fff;
}

.portal-sidebar .brand__text small {
  color: #9eb2ca;
}

.portal-nav {
  display: grid;
  gap: 0.3rem;
}

.portal-nav button {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.75rem;
  border: 0;
  border-radius: 0.65rem;
  background: transparent;
  color: #b9cade;
  cursor: pointer;
  font-weight: 650;
  text-align: left;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.portal-nav button:hover,
.portal-nav button.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.portal-nav__icon {
  width: 1.5rem;
  color: var(--cyan-400);
  text-align: center;
}

.sidebar-user {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
}

.sidebar-user strong,
.sidebar-user span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user span {
  color: #9eb2ca;
  font-size: 0.78rem;
}

.portal-main {
  min-width: 0;
}

.portal-topbar {
  position: sticky;
  z-index: 60;
  top: 0;
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.portal-menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
}

.portal-topbar__title {
  margin: 0;
  font-size: 1.05rem;
}

.portal-content {
  width: min(100%, 1220px);
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 2.6rem);
}

.view-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.7rem;
}

.view-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1.3rem;
}

.metric-grid--compact {
  margin: 1.2rem 0;
}

.metric-card {
  display: flex;
  min-height: 112px;
  flex-direction: column;
  justify-content: center;
  padding: 1.25rem;
}

.metric-card strong {
  color: var(--navy-950);
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1;
}

.metric-card span {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.2rem;
}

.content-card {
  padding: 1.35rem;
}

.progress-track {
  overflow: hidden;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #dfe8f1;
}

.progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue-600), var(--cyan-400));
}

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

.module-card {
  display: flex;
  flex-direction: column;
  padding: 1.4rem;
}

.module-card__code {
  width: fit-content;
  margin-bottom: 0.85rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: var(--blue-100);
  color: var(--blue-700);
  font-size: 0.72rem;
  font-weight: 850;
}

.module-card__meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
  padding: 1rem 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.lesson-list,
.attempt-list,
.error-book,
.case-list {
  display: grid;
  gap: 0.75rem;
}

.lesson-item,
.attempt-item,
.error-item,
.case-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: #fff;
}

.lesson-item.is-complete {
  border-color: #a8dcc6;
  background: var(--green-100);
}

.lesson-main {
  min-width: 0;
}

.lesson-main h3,
.lesson-main p {
  margin: 0;
}

.lesson-main p {
  color: var(--muted);
  font-size: 0.84rem;
}

.lesson-view {
  max-width: 900px;
  margin-inline: auto;
  padding: clamp(1.25rem, 5vw, 3rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.lesson-content {
  font-size: 1.04rem;
}

.lesson-content h2,
.lesson-content h3 {
  margin-top: 1.7em;
}

.lesson-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.lesson-content td,
.lesson-content th {
  padding: 0.7rem;
  border: 1px solid var(--line);
}

.lesson-content .callout,
.lesson-content .method,
.lesson-content .example,
.lesson-content .checklist,
.lesson-content .pitfalls {
  margin: 1.25rem 0;
  padding: 1rem 1.1rem;
  border-left: 4px solid var(--blue-600);
  border-radius: 0.55rem;
  background: var(--blue-100);
}

.lesson-content .example {
  border-left-color: var(--green-700);
  background: var(--green-100);
}

.lesson-content .pitfalls {
  border-left-color: var(--gold-500);
  background: #fff8e7;
}

.lesson-content .checklist ul,
.lesson-content .checklist ol {
  margin-bottom: 0;
}

.lesson-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.source-list {
  padding-left: 1.2rem;
  font-size: 0.86rem;
}

.source-note {
  color: var(--muted);
  font-size: 0.78rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 750;
}

.badge--success {
  background: var(--green-100);
  color: var(--green-700);
}

.badge--danger {
  background: var(--red-100);
  color: var(--red-700);
}

.notice {
  padding: 0.85rem 1rem;
  border-left: 4px solid var(--blue-600);
  border-radius: 0.4rem;
  background: var(--blue-100);
  color: var(--navy-900);
  font-size: 0.88rem;
}

.notice--warning {
  border-left-color: var(--gold-500);
  background: var(--orange-100);
}

.notice--danger {
  border-left-color: var(--red-700);
  background: var(--red-100);
}

.empty-state,
.loading-state,
.error-state {
  padding: clamp(2rem, 5vw, 4rem);
  border: 1px dashed #b9c7d7;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.75);
  text-align: center;
}

.error-state {
  border-color: #e4adb3;
  background: var(--red-100);
}

.loading-dots::after {
  content: "…";
  animation: pulse 1.3s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1; }
}

/* Motor de test */
.test-runner {
  overflow: hidden;
  max-width: 920px;
  margin-inline: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.test-runner__header,
.test-runner__body,
.test-runner__footer {
  padding: clamp(1rem, 4vw, 1.7rem);
}

.test-runner__header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
}

.test-runner__header h3 {
  margin: 0;
}

.test-runner__header .progress-track {
  grid-column: 1 / -1;
}

.test-meta {
  align-self: center;
}

.timer {
  font-size: 0.82rem;
  font-weight: 750;
}

.question-prompt {
  color: var(--navy-950);
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  font-weight: 720;
}

.case-context {
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  white-space: pre-line;
}

.answer-options {
  display: grid;
  gap: 0.65rem;
  margin: 1.25rem 0 0;
  padding: 0;
  border: 0;
}

.answer-option {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 0.75rem;
  min-height: 54px;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  cursor: pointer;
  transition: border 140ms ease, background 140ms ease;
}

.answer-option:hover,
.answer-option.is-selected {
  border-color: var(--blue-600);
  background: var(--blue-100);
}

.answer-option input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--blue-600);
}

.answer-letter {
  display: grid;
  width: 1.8rem;
  height: 1.8rem;
  place-items: center;
  border-radius: 50%;
  background: #e5ebf2;
  font-size: 0.75rem;
  font-weight: 850;
}

.test-runner__footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  border-top: 1px solid var(--line);
}

.test-runner__footer .button:last-child {
  justify-self: end;
}

.test-position {
  color: var(--muted);
  font-size: 0.78rem;
}

.result-card {
  padding: clamp(1.25rem, 5vw, 2.5rem);
}

.score-number {
  color: var(--blue-700);
  font-size: clamp(2rem, 6vw, 3.6rem);
  font-weight: 850;
  letter-spacing: -0.05em;
}

.review-details {
  margin: 1.25rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.review-details summary {
  padding: 1rem 0;
  cursor: pointer;
  font-weight: 750;
}

.review-list {
  display: grid;
  gap: 0.8rem;
  padding-bottom: 1rem;
}

.review-item {
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.review-item h4 {
  font-size: 1rem;
}

.review-answer {
  color: var(--red-700);
}

.review-correct {
  color: var(--green-700);
  font-weight: 700;
}

/* Casos y calculadoras */
.guided-steps {
  display: grid;
  gap: 0.65rem;
  margin: 1rem 0;
}

.guided-step {
  padding: 0.9rem;
  border-left: 3px solid var(--cyan-400);
  background: var(--surface-soft);
}

.guided-step h4 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.hint-button {
  border: 0;
  background: transparent;
  color: var(--blue-700);
  cursor: pointer;
  font-weight: 750;
  padding: 0;
}

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

.calculator-card {
  padding: 1.35rem;
}

.calculator-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 0.8rem;
}

.calculator-form .button {
  grid-column: 1 / -1;
}

.calculator-output {
  min-height: 2rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.calculator-output.is-error {
  color: var(--red-700);
}

.calculator-headline {
  display: block;
  margin-bottom: 0.8rem;
  color: var(--blue-700);
  font-size: 1.7rem;
}

.result-table {
  display: grid;
  grid-template-columns: 1fr auto;
  margin: 0;
}

.result-table dt,
.result-table dd {
  margin: 0;
  padding: 0.4rem 0;
  border-bottom: 1px dotted var(--line);
}

.result-table dd {
  font-weight: 750;
  text-align: right;
}

.simulation-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.simulation-card {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.simulation-result {
  padding: clamp(1.5rem, 5vw, 3rem);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.simulation-result.is-pass {
  border-top: 6px solid var(--green-700);
}

.simulation-result.is-fail {
  border-top: 6px solid var(--red-700);
}

/* Legal y pie */
.legal-content {
  width: min(calc(100% - 2rem), 860px);
  margin-inline: auto;
  padding: clamp(3rem, 7vw, 6rem) 0;
}

.legal-content h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
}

.legal-content h2 {
  margin-top: 1.8em;
  font-size: 1.45rem;
}

.legal-meta {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.site-footer {
  padding: 3rem 0 1.5rem;
  background: var(--navy-950);
  color: #9fb2c9;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(2, 1fr);
  gap: 2rem;
}

.site-footer h2,
.site-footer h3 {
  color: #fff;
  font-size: 1rem;
}

.site-footer a {
  color: #c6d4e4;
}

.footer-links {
  display: grid;
  gap: 0.45rem;
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.8rem;
}

.cookie-banner {
  position: fixed;
  z-index: 1000;
  right: 1rem;
  bottom: 1rem;
  width: min(calc(100% - 2rem), 500px);
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-lg);
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-banner h2 {
  font-size: 1.05rem;
}

.cookie-banner p {
  color: var(--muted);
  font-size: 0.84rem;
}

/* Responsive */
@media (max-width: 980px) {
  .hero__grid,
  .cta-panel,
  .level-layout,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .hero__grid {
    align-items: stretch;
  }

  .hero--visual {
    min-height: 680px;
  }

  .hero__media img {
    object-position: 63% center;
  }

  .hero::before {
    background: linear-gradient(90deg, rgba(4, 14, 29, 0.98) 0%, rgba(4, 14, 29, 0.9) 46%, rgba(4, 14, 29, 0.3) 78%, rgba(4, 14, 29, 0.12) 100%);
  }

  .price-card {
    max-width: 600px;
  }

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

  .steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .level-info {
    position: static;
  }

  .portal-app {
    grid-template-columns: 1fr;
  }

  .portal-sidebar {
    position: fixed;
    z-index: 200;
    left: 0;
    width: min(86vw, 300px);
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .portal-sidebar.is-open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .portal-menu-toggle {
    display: inline-grid;
    place-items: center;
  }

  .portal-overlay {
    position: fixed;
    z-index: 190;
    inset: 0;
    background: rgba(4, 14, 29, 0.62);
  }

  .portal-overlay[hidden] {
    display: none;
  }
}

@media (max-width: 760px) {
  .nav-toggle {
    display: inline-block;
  }

  .main-nav {
    position: fixed;
    z-index: 99;
    top: 74px;
    right: 0;
    left: 0;
    display: none;
    align-items: stretch;
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--line);
    background: #fff;
    box-shadow: var(--shadow-lg);
  }

  .main-nav.is-open {
    display: flex;
  }

  .main-nav > a:not(.button) {
    padding: 0.6rem;
  }

  .trust-strip__grid,
  .metric-grid,
  .module-grid,
  .calculator-grid,
  .simulation-options {
    grid-template-columns: 1fr 1fr;
  }

  .module-list-public,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-branding {
    min-height: 300px;
    padding: 2rem;
  }

  .login-branding h1 {
    font-size: 2.3rem;
  }

  .comparison {
    overflow-x: auto;
  }

  .comparison table {
    min-width: 650px;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(calc(100% - 1.25rem), var(--content));
  }

  .brand__text small {
    display: none;
  }

  .hero {
    min-height: 710px;
    padding: 3.6rem 0 3rem;
    align-items: end;
  }

  .hero__media img {
    object-position: 69% center;
  }

  .hero::before {
    background:
      linear-gradient(0deg, rgba(4, 14, 29, 0.99) 0%, rgba(4, 14, 29, 0.95) 51%, rgba(4, 14, 29, 0.38) 82%, rgba(4, 14, 29, 0.14) 100%),
      linear-gradient(90deg, rgba(4, 14, 29, 0.54), rgba(4, 14, 29, 0.08));
  }

  .hero h1 {
    font-size: clamp(2.25rem, 11vw, 3rem);
  }

  .hero__lead {
    font-size: 1rem;
  }

  .hero__trust {
    gap: 0.45rem 0.9rem;
    margin: 1.15rem 0 1.4rem;
    font-size: 0.88rem;
  }

  .hero .button-row {
    align-items: stretch;
    flex-direction: column;
  }

  .hero .button {
    width: 100%;
  }

  .hero__disclaimer {
    font-size: 0.74rem;
  }

  .feature-grid,
  .steps,
  .trust-strip__grid,
  .metric-grid,
  .module-grid,
  .calculator-grid,
  .simulation-options,
  .calculator-form {
    grid-template-columns: 1fr;
  }

  .trust-item {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric-card {
    min-height: 92px;
  }

  .lesson-item,
  .attempt-item,
  .error-item,
  .case-item,
  .view-header {
    align-items: stretch;
    flex-direction: column;
  }

  .test-runner__header {
    grid-template-columns: 1fr;
  }

  .test-runner__header .progress-track {
    grid-column: 1;
  }

  .test-runner__footer {
    grid-template-columns: 1fr 1fr;
  }

  .test-position {
    display: none;
  }

  .answer-option {
    grid-template-columns: auto 1fr;
  }

  .answer-option input {
    position: absolute;
    opacity: 0;
  }

  .portal-topbar {
    padding-inline: 0.75rem;
  }

  .portal-content {
    padding-inline: 0.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .site-header,
  .site-footer,
  .portal-sidebar,
  .portal-topbar,
  .button,
  .cookie-banner {
    display: none !important;
  }

  body,
  .portal-body {
    background: #fff;
  }

  .portal-app {
    display: block;
  }

  .portal-content,
  .legal-content {
    width: 100%;
    max-width: none;
    padding: 0;
  }
}
