:root {
  --red: #e30613;
  --red-dark: #b0000b;
  --red-ink: #7f0710;
  --red-soft: #ffe8ea;
  --red-wash: #fff5f6;
  --ink: #111322;
  --text: #252633;
  --muted: #626673;
  --line: #e5e6eb;
  --soft: #f6f7f9;
  --white: #fff;
  --green: #177245;
  --amber: #9a6200;
  --shadow: 0 18px 50px rgba(40, 19, 22, .09);
  --shadow-small: 0 8px 24px rgba(40, 19, 22, .07);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 88% 8%, rgba(227, 6, 19, .055), transparent 26rem),
    #fff;
  font-family: Inter, Arial, "Helvetica Neue", sans-serif;
  line-height: 1.5;
}
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button:not(:disabled) { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
img { max-width: 100%; }
.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  color: #fff;
  background: var(--ink);
  border-radius: 8px;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 3px solid #121f57; outline-offset: 3px; }
.is-hidden { display: none !important; }

.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px clamp(20px, 5vw, 72px);
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid rgba(17, 19, 34, .08);
  backdrop-filter: blur(14px);
}
.brand-group {
  min-width: 320px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0;
  text-align: left;
  background: none;
  border: 0;
}
.brand-placeholder { display: flex; align-items: center; gap: 10px; }
.brand-placeholder strong { color: #101010; font-size: 15px; line-height: 1.02; }
.brand-image { display: flex; align-items: center; flex: 0 0 auto; }
.brand-image img { display: block; width: auto; object-fit: contain; }
.brand-image.brand-madrid img { height: 44px; }
.brand-image.brand-mdr img { height: 42px; }
.madrid-flag {
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--red);
  font-size: 8px;
  line-height: .9;
  letter-spacing: 1px;
}
.brand-divider { width: 1px; height: 34px; background: #d8d9df; }
.brand-mdr > strong {
  color: var(--red);
  font-size: 27px;
  font-weight: 900;
  letter-spacing: -2px;
}
.brand-mdr small { color: #111; font-size: 8px; line-height: 1.05; }
.program-seal {
  padding-left: 14px;
  color: var(--muted);
  border-left: 1px solid #d8d9df;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.15;
}
.desktop-nav { display: flex; align-items: center; gap: 4px; }
.desktop-nav button,
.profile-button,
.icon-button {
  min-height: 42px;
  padding: 9px 13px;
  background: transparent;
  border: 0;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
}
.desktop-nav button:hover,
.desktop-nav button[aria-current="page"],
.profile-button:hover,
.icon-button:hover { color: var(--red); background: var(--red-wash); }
.header-tools { display: flex; align-items: center; gap: 5px; }
.icon-button {
  width: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
}
.profile-button { display: flex; gap: 7px; align-items: center; }
.profile-button span:first-child {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
}

#app-main { min-height: calc(100vh - 210px); }
.page { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 48px 0 72px; }
.page-narrow { width: min(900px, calc(100% - 40px)); }
.section-eyebrow {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin: 0 0 12px;
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
h1, h2, h3, h4 { color: var(--ink); line-height: 1.08; letter-spacing: -.025em; }
h1 { margin: 0; font-size: clamp(38px, 5.4vw, 70px); }
h2 { margin: 0; font-size: clamp(28px, 3.2vw, 44px); }
h3 { margin: 0; font-size: 22px; }
h4 { margin: 0; font-size: 16px; }
p { margin: 0; }
.lead { max-width: 720px; color: var(--muted); font-size: clamp(17px, 2vw, 21px); }
.red-text { color: var(--red); }

.btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 800;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--red), #f21b2d);
  box-shadow: 0 9px 24px rgba(227, 6, 19, .22);
}
.btn-primary:hover { background: var(--red-dark); }
.btn-secondary { color: var(--red); background: #fff; border-color: rgba(227, 6, 19, .35); }
.btn-secondary:hover { background: var(--red-wash); }
.btn-quiet { color: var(--ink); background: var(--soft); border-color: var(--line); }
.btn-danger { color: #fff; background: var(--red-dark); }
.button-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.hero-wrap { padding: 28px 0 0; }
.hero {
  position: relative;
  overflow: hidden;
  min-height: 550px;
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  align-items: center;
  gap: 40px;
  padding: clamp(32px, 6vw, 76px);
  background:
    linear-gradient(105deg, rgba(255,255,255,.98) 5%, rgba(255,255,255,.91) 48%, rgba(255,241,243,.68)),
    repeating-linear-gradient(0deg, transparent 0 44px, rgba(227,6,19,.04) 45px),
    repeating-linear-gradient(90deg, transparent 0 44px, rgba(227,6,19,.04) 45px);
  border: 1px solid #ececf0;
  border-radius: 30px;
  box-shadow: var(--shadow);
}
.hero::after {
  content: "";
  position: absolute;
  right: -8%;
  bottom: -35%;
  width: 56%;
  height: 65%;
  border: 3px solid rgba(227, 6, 19, .11);
  border-radius: 50%;
  transform: rotate(-12deg);
}
.hero-copy { position: relative; z-index: 2; }
.hero-copy .lead { margin: 22px 0 30px; }
.trust-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 20px;
}
.trust-row span {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.trust-row i,
.check-list li::before { content: "✓"; color: var(--red); font-style: normal; font-weight: 900; }

.compass-stage,
.gps-stage {
  position: relative;
  z-index: 2;
  min-height: 390px;
  display: grid;
  place-items: center;
}
.gps-stage {
  min-height: 410px;
  perspective: 900px;
}
.template-hero-image {
  position: relative;
  width: 100%;
  margin: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(227,6,19,.12);
  border-radius: 26px;
  box-shadow: 0 28px 60px rgba(65, 27, 32, .18);
}
.template-hero-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.template-gps-image { aspect-ratio: 2.295; }
.gps-device {
  position: relative;
  width: min(430px, 86vw);
  aspect-ratio: 1.45;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255,255,255,.1), transparent 35%),
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(255,255,255,.07) 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(255,255,255,.07) 40px),
    #171a2d;
  border: 12px solid #25283a;
  border-radius: 32px;
  box-shadow: 0 36px 70px rgba(33, 17, 20, .27), inset 0 0 0 2px rgba(255,255,255,.12);
  transform: rotateX(9deg) rotateZ(-3deg);
}
.gps-device::before {
  content: "";
  position: absolute;
  left: -5%;
  bottom: 13%;
  width: 110%;
  height: 42%;
  border: 6px solid var(--red);
  border-left-color: transparent;
  border-bottom-color: transparent;
  border-radius: 48% 52% 42% 58%;
  transform: rotate(-8deg);
  filter: drop-shadow(0 0 12px rgba(255,44,61,.72));
}
.gps-device::after {
  content: "TU RUTA PROFESIONAL";
  position: absolute;
  top: 18px;
  left: 22px;
  color: rgba(255,255,255,.72);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
}
.gps-pin {
  position: absolute;
  z-index: 3;
  top: 22%;
  left: 58%;
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--red);
  border: 8px solid rgba(255,255,255,.92);
  border-radius: 50% 50% 50% 0;
  box-shadow: 0 10px 30px rgba(227,6,19,.55);
  transform: rotate(-45deg);
  font-size: 28px;
}
.gps-pin span { transform: rotate(45deg); }
.gps-stop {
  position: absolute;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: #fff;
  background: var(--red);
  border: 5px solid rgba(255,255,255,.85);
  border-radius: 50%;
  font-weight: 900;
  box-shadow: 0 0 20px rgba(227,6,19,.55);
}
.gps-stop.first { left: 12%; bottom: 18%; }
.gps-stop.second { right: 10%; bottom: 18%; }
.course-card-featured {
  background: linear-gradient(145deg, var(--red-dark), var(--red));
  border-color: transparent;
}
.course-card-featured h3,
.course-card-featured p,
.course-card-featured .text-link { color: #fff; }
.course-card-featured .module-number { color: var(--red); background: #fff; }
.course-card-featured .module-status { color: #fff; background: rgba(255,255,255,.14); }
.course-hero-strip {
  margin: -1px;
  padding: 28px;
  color: #fff;
  background:
    linear-gradient(100deg, rgba(176,0,11,.98), rgba(227,6,19,.88)),
    repeating-linear-gradient(90deg, transparent 0 50px, rgba(255,255,255,.08) 51px);
  border-radius: 28px 28px 0 0;
}
.course-hero-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  align-items: center;
  gap: 20px;
}
.course-strip-image {
  width: 160px;
  height: 102px;
  object-fit: cover;
  border: 4px solid rgba(255,255,255,.75);
  border-radius: 17px;
  box-shadow: 0 10px 26px rgba(91,0,7,.22);
}
.course-thumb {
  width: 100%;
  height: 118px;
  margin-bottom: 18px;
  object-fit: cover;
  border: 1px solid rgba(227,6,19,.14);
  border-radius: 15px;
}
.course-hero-strip h1,
.course-hero-strip h2 { color: #fff; }
.course-hero-strip .lead { color: rgba(255,255,255,.86); }
.compass-dial {
  position: relative;
  width: min(320px, 78vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle, #fff 0 11%, transparent 12%),
    repeating-conic-gradient(from -2deg, #e7e7ec 0 1deg, transparent 1deg 10deg),
    radial-gradient(circle, #fff 0 56%, #f4f4f7 57% 62%, #171a2d 63% 67%, #fff 68%);
  border: 10px solid #f7f7f8;
  border-radius: 50%;
  box-shadow: 0 34px 70px rgba(50, 20, 24, .2), inset 0 0 0 1px #d7d8df;
}
.compass-dial::before {
  content: "";
  width: 32%;
  height: 66%;
  background: linear-gradient(to bottom right, var(--red) 0 49%, #fff 50% 100%);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  transform: rotate(24deg);
  filter: drop-shadow(0 10px 14px rgba(227,6,19,.25));
}
.compass-dial::after {
  content: "N";
  position: absolute;
  top: 13%;
  color: var(--red);
  font-weight: 900;
}
.route-dot {
  position: absolute;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--red);
  border: 6px solid rgba(255,255,255,.88);
  border-radius: 50% 50% 50% 0;
  box-shadow: 0 8px 18px rgba(227,6,19,.25);
  transform: rotate(-45deg);
}
.route-dot span { transform: rotate(45deg); font-weight: 900; }
.route-dot.one { top: 4%; right: 18%; }
.route-dot.two { right: 4%; bottom: 24%; }
.route-dot.three { bottom: 5%; left: 17%; }
.route-dot.four { top: 28%; left: 3%; }
.compass-card {
  position: absolute;
  right: 0;
  bottom: -10px;
  width: 245px;
  padding: 18px;
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-small);
}
.compass-card strong { display: block; margin-bottom: 5px; color: var(--ink); }
.compass-card p { color: var(--muted); font-size: 13px; }

.section { padding: 74px 0 0; }
.section-head { max-width: 760px; margin-bottom: 26px; }
.section-head p { margin-top: 12px; color: var(--muted); font-size: 17px; }
.card-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.card,
.module-card,
.stat-card,
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-small);
}
.module-card {
  position: relative;
  min-height: 260px;
  padding: 25px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.module-card:hover { border-color: rgba(227,6,19,.32); box-shadow: var(--shadow); }
.module-number {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin-bottom: 26px;
  color: var(--red);
  background: var(--red-soft);
  border-radius: 14px;
  font-size: 18px;
  font-weight: 900;
}
.module-card p { margin: 10px 0 20px; color: var(--muted); }
.module-card .text-link { margin-top: auto; }
.text-link {
  padding: 0;
  color: var(--red);
  background: none;
  border: 0;
  font-weight: 900;
}
.module-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 5px 9px;
  color: var(--muted);
  background: var(--soft);
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
}
.module-status.done { color: var(--green); background: #e9f7f0; }
.module-status.active { color: var(--red-ink); background: var(--red-soft); }

.callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  margin-top: 36px;
  padding: 28px 34px;
  color: #fff;
  background: linear-gradient(120deg, var(--red-dark), var(--red));
  border-radius: var(--radius);
  box-shadow: 0 14px 32px rgba(227, 6, 19, .18);
}
.home-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, .65fr) auto;
  align-items: center;
  gap: 28px;
  margin-top: 18px;
  padding: 22px 26px;
}
.home-progress .section-eyebrow { margin-bottom: 4px; }
.home-progress p:last-child { color: var(--muted); font-size: 13px; }
.callout h3 { color: #fff; font-size: clamp(23px, 3vw, 34px); }
.callout p { margin-top: 5px; color: rgba(255,255,255,.84); }
.callout .btn { color: var(--red); background: #fff; }

.page-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 25px;
  margin-bottom: 32px;
}
.page-header .lead { margin-top: 12px; }
.progress-summary { min-width: 240px; }
.progress-label { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 13px; font-weight: 800; }
.progress-track { height: 9px; overflow: hidden; background: #eaebef; border-radius: 99px; }
.progress-track > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--red), #ff5260); border-radius: inherit; transition: width .3s ease; }
.route-list { display: grid; gap: 16px; }
.route-card {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-small);
}
.route-card .module-number { margin: 0; }
.route-card p { margin-top: 6px; color: var(--muted); }
.route-meta { display: flex; align-items: center; gap: 14px; }
.route-meta small { color: var(--muted); }

.module-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, .9fr);
  gap: 30px;
  padding: clamp(30px, 5vw, 58px);
  background: linear-gradient(130deg, #fff 0 55%, var(--red-wash));
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}
.module-hero::after {
  content: "";
  position: absolute;
  right: 4%;
  bottom: -48%;
  width: 38%;
  aspect-ratio: 1;
  border: 22px solid rgba(227,6,19,.06);
  border-radius: 50%;
}
.module-hero .lead { margin: 17px 0 24px; }
.module-facts {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.module-facts div { padding: 17px; background: rgba(255,255,255,.82); border: 1px solid var(--line); border-radius: 16px; }
.module-facts strong { display: block; color: var(--ink); font-size: 14px; }
.module-facts span { color: var(--muted); font-size: 12px; }
.learning-list { margin: 18px 0 0; padding: 0; list-style: none; }
.learning-list li, .check-list li { position: relative; margin: 9px 0; padding-left: 26px; }
.learning-list li::before, .check-list li::before { position: absolute; left: 0; content: "✓"; color: var(--red); font-weight: 900; }

.workspace { margin-top: 24px; }
.stage-tabs {
  position: sticky;
  z-index: 10;
  top: 86px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 7px;
  background: rgba(255,255,255,.97);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-small);
}
.stage-tabs button {
  min-height: 46px;
  padding: 10px;
  background: transparent;
  border: 0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
}
.stage-tabs button.active { color: #fff; background: var(--red); }
.stage-panel { margin-top: 18px; padding: clamp(24px, 4vw, 42px); background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-small); }
.lesson-head { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 25px; }
.lesson-index {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--red);
  border-radius: 50%;
  font-weight: 900;
}
.lesson-head p { margin-top: 8px; color: var(--muted); }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(280px, .88fr); gap: 22px; }
.content-card { padding: 24px; background: var(--soft); border: 1px solid var(--line); border-radius: 18px; }
.content-card h3 { margin-bottom: 13px; }
.content-card p + p { margin-top: 12px; }
.tip-box { padding: 22px; color: var(--red-ink); background: var(--red-soft); border-radius: 18px; }
.tip-box strong { display: block; margin-bottom: 8px; }
.activity-box { margin-top: 22px; padding: 24px; background: #fffafb; border: 1px solid #f0ccd0; border-radius: 18px; }
.activity-box h3 { margin-bottom: 8px; }
.activity-box > p { margin-bottom: 18px; color: var(--muted); }
.workspace-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field span { color: var(--ink); font-size: 13px; font-weight: 800; }
.field small { color: var(--muted); }
.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 50px;
  padding: 13px 14px;
  color: var(--text);
  background: #fff;
  border: 1px solid #cfd1d8;
  border-radius: 11px;
}
.field textarea { min-height: 112px; resize: vertical; }
.field input:focus,
.field textarea:focus,
.field select:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(227,6,19,.1); outline: 0; }
.check-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.check-choice {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
}
.check-choice:has(input:checked) { color: var(--red-ink); background: var(--red-soft); border-color: rgba(227,6,19,.3); }
.check-choice input { width: 18px; height: 18px; accent-color: var(--red); }

.artifact-preview {
  margin-top: 24px;
  padding: 32px;
  background:
    linear-gradient(135deg, rgba(227,6,19,.035), transparent 40%),
    #fff;
  border: 1px solid #d8d9df;
  border-top: 8px solid var(--red);
  border-radius: 18px;
}
.artifact-preview header { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.artifact-preview h3 { color: var(--red); }
.artifact-preview section { padding: 20px 0; border-bottom: 1px solid var(--line); }
.artifact-preview section:last-child { border: 0; }
.artifact-preview dt { margin-top: 10px; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.artifact-preview dd { margin: 3px 0 0; white-space: pre-wrap; }
.empty-copy { color: var(--muted); font-style: italic; }

.kit-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 22px; align-items: start; }
.kit-sections { display: grid; gap: 16px; }
.kit-section { padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-small); }
.kit-section header { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.kit-section p { margin-top: 8px; color: var(--muted); }
.kit-aside { position: sticky; top: 100px; padding: 24px; background: var(--ink); color: #fff; border-radius: 20px; }
.kit-aside h3 { color: #fff; }
.kit-aside p { margin: 10px 0 20px; color: #cfd1dc; }
.kit-aside .btn { width: 100%; margin-top: 10px; }

.quiz-list { display: grid; gap: 16px; counter-reset: quiz; }
.quiz-card { padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-small); counter-increment: quiz; }
.quiz-card legend { width: 100%; margin-bottom: 14px; color: var(--ink); font-weight: 900; }
.quiz-card legend::before { content: counter(quiz) ". "; color: var(--red); }
.option-list { display: grid; gap: 8px; }
.option-list label { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.option-list label:has(input:checked) { background: var(--red-soft); border-color: rgba(227,6,19,.35); }
.option-list input { margin-top: 4px; accent-color: var(--red); }
.feedback { margin-top: 12px; padding: 10px 12px; border-radius: 10px; font-size: 13px; font-weight: 700; }
.feedback.ok { color: var(--green); background: #e9f7f0; }
.feedback.bad { color: var(--red-ink); background: var(--red-soft); }
.result-panel { margin-bottom: 24px; padding: 28px; color: #fff; background: var(--ink); border-radius: 20px; }
.result-panel h2 { color: #fff; }
.result-panel p { margin-top: 8px; color: #d9dbe3; }

.resource-grid, .stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.resource-card, .stat-card { padding: 22px; }
.resource-card .tag { display: inline-block; margin-bottom: 18px; padding: 5px 8px; color: var(--red-ink); background: var(--red-soft); border-radius: 99px; font-size: 11px; font-weight: 900; }
.resource-card p, .stat-card p { margin: 8px 0 16px; color: var(--muted); }
.stat-card strong { display: block; color: var(--red); font-size: 34px; }
.privacy { margin-top: 24px; padding: 20px; color: #4f3f17; background: #fff8df; border: 1px solid #eddda4; border-radius: 14px; }
.case-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

.site-footer {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 30px;
  align-items: center;
  padding: 32px clamp(20px, 5vw, 72px);
  background: #f8f8fa;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.site-footer > div:first-child { display: grid; }
.site-footer span, .site-footer p { color: var(--muted); }
.powered { color: var(--muted); white-space: nowrap; }
.powered { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.powered img { display: block; width: 132px; height: auto; }
.powered strong { margin-left: 6px; color: #111; }
.powered strong span { color: var(--red); font-size: 22px; font-weight: 1000; }
.mobile-nav { display: none; }

.toast-region { position: fixed; z-index: 90; right: 22px; bottom: 22px; display: grid; gap: 8px; }
.toast { max-width: 340px; padding: 14px 18px; color: #fff; background: var(--ink); border-radius: 12px; box-shadow: var(--shadow); }
.modal-root:empty { display: none; }
.modal-root {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(17,19,34,.48);
}
.modal {
  width: min(620px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 30px;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(0,0,0,.25);
}
.modal-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.modal-close { width: 42px; height: 42px; background: var(--soft); border: 0; border-radius: 50%; }
.mini-compass { width: 76px; height: 76px; margin: 18px auto; display: grid; place-items: center; background: var(--red-soft); border: 2px solid var(--red); border-radius: 50%; color: var(--red); font-size: 32px; }
.question-display { min-height: 110px; display: grid; place-items: center; padding: 22px; text-align: center; background: var(--soft); border-radius: 16px; font-size: 19px; font-weight: 800; }

@media (max-width: 1080px) {
  .desktop-nav { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero-copy { max-width: 720px; }
  .compass-stage { min-height: 360px; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
  .kit-layout { grid-template-columns: 1fr; }
  .kit-aside { position: static; }
}

@media (max-width: 760px) {
  body { padding-bottom: 72px; }
  .site-header { min-height: 64px; padding: 8px 16px; }
  .brand-group { min-width: 0; gap: 10px; }
  .brand-madrid strong { display: none; }
  .brand-mdr small, .brand-divider { display: none; }
  .program-seal { display: none; }
  .brand-image.brand-madrid img { height: 34px; }
  .brand-image.brand-mdr img { height: 32px; }
  .madrid-flag { width: 38px; height: 38px; }
  .brand-mdr > strong { font-size: 23px; }
  .profile-button { display: none; }
  .page { width: min(100% - 28px, 620px); padding: 28px 0 50px; }
  .hero-wrap { padding-top: 14px; }
  .hero { min-height: 0; padding: 30px 22px; border-radius: 22px; }
  h1 { font-size: clamp(36px, 12vw, 54px); }
  .trust-row { grid-template-columns: repeat(2, 1fr); }
  .compass-stage { min-height: 310px; }
  .gps-stage { min-height: 330px; }
  .template-gps-image { width: 100%; max-width: 590px; }
  .gps-device { width: 300px; border-width: 9px; border-radius: 24px; }
  .gps-pin { width: 58px; height: 58px; border-width: 6px; }
  .compass-dial { width: 245px; }
  .route-dot { width: 40px; height: 40px; }
  .compass-card { position: relative; right: auto; bottom: auto; width: 100%; margin-top: -20px; }
  .section { padding-top: 54px; }
  .card-grid, .resource-grid, .stats-grid, .form-grid, .check-grid { grid-template-columns: 1fr; }
  .page-header { display: grid; align-items: start; }
  .home-progress { grid-template-columns: 1fr; gap: 16px; }
  .progress-summary { width: 100%; }
  .route-card { grid-template-columns: 48px 1fr; gap: 14px; }
  .route-card .module-number { width: 44px; height: 44px; }
  .route-meta { grid-column: 1 / -1; justify-content: space-between; }
  .module-hero { grid-template-columns: 1fr; padding: 28px 22px; }
  .module-facts { grid-template-columns: 1fr 1fr; }
  .stage-tabs { top: 70px; overflow-x: auto; grid-template-columns: repeat(4, minmax(115px, 1fr)); }
  .stage-panel { padding: 24px 18px; }
  .workspace-footer { flex-wrap: wrap; }
  .workspace-footer .btn { flex: 1; }
  .artifact-preview { padding: 22px 17px; }
  .callout { display: grid; padding: 25px; }
  .site-footer { grid-template-columns: 1fr; padding: 28px 20px; }
  .powered { justify-content: flex-start; }
  .course-hero-strip { grid-template-columns: 1fr; }
  .course-strip-image { width: 100%; height: 120px; }
  .mobile-nav {
    position: fixed;
    z-index: 40;
    left: 10px;
    right: 10px;
    bottom: 10px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 6px;
    background: rgba(17,19,34,.96);
    border-radius: 16px;
    box-shadow: 0 10px 35px rgba(0,0,0,.2);
  }
  .mobile-nav button { min-height: 52px; display: grid; place-items: center; gap: 1px; padding: 5px; color: #fff; background: transparent; border: 0; border-radius: 11px; font-size: 10px; }
  .mobile-nav button span { font-size: 18px; }
  .mobile-nav button[aria-current="page"] { background: var(--red); }
}

@media (max-width: 430px) {
  .header-tools .icon-button { display: none; }
  .brand-image.brand-madrid img { height: 29px; }
  .brand-image.brand-mdr img { height: 27px; }
  .hero .button-row .btn { width: 100%; }
  .trust-row { grid-template-columns: 1fr; }
  .module-facts { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .module-card { min-height: 230px; }
  .page { width: min(100% - 20px, 620px); }
}

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

@media print {
  .no-print, .site-header, .site-footer, .mobile-nav, .stage-tabs, .workspace-footer, .button-row, .case-tools { display: none !important; }
  body { background: #fff; }
  #app-main, .page, .page-narrow { width: 100%; min-height: 0; margin: 0; padding: 0; }
  .module-hero, .stage-panel, .artifact-preview, .kit-section { box-shadow: none; break-inside: avoid; }
  .artifact-preview { border: 1px solid #aaa; border-top: 8px solid var(--red); }
}
