:root {
  color-scheme: light;
  --navy: #153652;
  --blue: #1b5484;
  --ink: #152b3d;
  --muted: #445c72;
  --line: #cad6e1;
  --canvas: #f2f6fa;
  --soft: #eaf2fa;
  --paper: #fff;
  --rail: #f9fbfd;
  --stripe: #f7faff;
  --radius: 10px;
  --font: Inter, "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font: 16px/1.58 var(--font);
  text-align: justify;
  text-align-last: start;
}
main { flex: 1; min-width: 0; }
a { color: var(--blue); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #a84b13; outline-offset: 3px; }
.skip { position: absolute; top: 8px; left: 8px; transform: translateY(-160%); background: var(--paper); padding: 10px; z-index: 3; }
.skip:focus { transform: none; }
h1,h2,h3,p { margin: 0 0 .68rem; }
h1,h2,h3 { color: var(--navy); line-height: 1.2; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.85rem,3.2vw,2.35rem); letter-spacing: -.037em; }
h2 { font-size: clamp(1.19rem,2.2vw,1.55rem); letter-spacing: -.02em; }
h3 { font-size: 1.08rem; }
.muted,small { color: var(--muted); }
p,li,dd { hyphens: auto; overflow-wrap: anywhere; }
.masthead { background: var(--paper); border-top: 4px solid var(--navy); border-bottom: 1px solid var(--line); }
.masthead > div,footer > div {
  max-width: 1440px; margin: auto; padding: 11px clamp(16px,3vw,40px);
}
.masthead > div {
  display: flex; justify-content: space-between; align-items: center; gap: 10px 24px; flex-wrap: wrap;
}
.brand,.actions,.account,nav,.line { display: flex; align-items: center; flex-wrap: wrap; gap: 9px 14px; }
.brand { color: var(--navy); text-decoration: none; line-height: 1.26; flex-wrap: nowrap; }
.brand img { width: 60px; height: 60px; object-fit: contain; flex: none; }
.brand strong,.account strong,.account small { display: block; }
.brand strong { font-size: .98rem; }
.account small { font-size: .76rem; }
.masthead nav a,.side-rail nav a { text-decoration: none; font-weight: 650; font-size: .9rem; color: var(--muted); }
.masthead nav a { border-bottom: 2px solid transparent; padding: 8px 0; }
.masthead nav a:hover,.masthead nav a[aria-current] { color: var(--navy); border-color: var(--blue); }
.button {
  display: inline-flex; align-items: center; justify-content: center; width: fit-content; max-width: 100%;
  min-height: 42px; padding: 9px 15px; border: 1px solid transparent; border-radius: 7px;
  font: 650 .88rem/1.3 var(--font); text-align: justify; text-decoration: none; cursor: pointer;
}
.primary { color: var(--paper); background: var(--navy); }
.primary:hover { background: var(--blue); }
.secondary { color: var(--navy); background: var(--paper); border-color: #aebfd1; }
.secondary:hover { background: var(--soft); }
.eyebrow { color: var(--blue); font-size: .71rem; letter-spacing: .095em; font-weight: 750; }
.landing,.page { width: 100%; max-width: 1240px; padding: 30px clamp(14px,4vw,40px) 44px; margin: 0 auto; }
.subject-trail { gap: 6px 10px; margin-bottom: 18px; color: var(--muted); font-size: .88rem; }
.subject-trail [aria-current] { color: var(--navy); font-weight: 650; }
.subject-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,320px),1fr)); gap: 16px; }
.subject-card .button { margin-top: 8px; }
.hero {
  display: grid; grid-template-columns: minmax(0,1.3fr) minmax(0,1fr);
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--paper);
}
.hero-copy,.route { padding: clamp(24px,4vw,48px); }
.hero-copy h1 { font-size: clamp(2.2rem,4.4vw,3.85rem); line-height: 1.05; margin: 12px 0 16px; }
.hero-copy > p:not(.eyebrow) { color: var(--muted); font-size: 1.04rem; max-width: 54ch; }
.hero-copy .actions { margin-top: 20px; }
.route { display: flex; flex-direction: column; justify-content: center; background: var(--navy); color: var(--paper); }
.route small,.route p { color: #dce9f5; }
.route-title small { font-size: .69rem; font-weight: 700; letter-spacing: .1em; }
.route h2 { color: var(--paper); margin: 0; }
.route ol { list-style: none; margin: 12px 0 16px; padding: 0; }
.route li { display: flex; align-items: baseline; gap: 13px; padding: 11px 0; border-bottom: 1px solid #607990; }
.route li span { color: #c0daf0; font-weight: 750; font-size: .81rem; font-variant-numeric: tabular-nums; }
.route li small { display: block; }
.route p { font-size: .85rem; margin: 0; }
.stats { display: grid; grid-template-columns: repeat(4,1fr); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); margin-top: 15px; }
.stats div { padding: 13px 17px; color: var(--muted); font-size: .88rem; border-right: 1px solid var(--line); }
.stats div:last-child { border: 0; }
.stats strong,.metric { display: block; color: var(--navy); font-size: 1.76rem; font-weight: 750; line-height: 1.2; font-variant-numeric: tabular-nums; }
.features { margin-top: 24px; }
.index,.pill { display: inline-flex; border-radius: 6px; background: var(--soft); color: var(--blue); font-weight: 750; padding: 4px 9px; margin-bottom: 6px; font-size: .78rem; }
.pill { border-radius: 999px; margin: 0; }
.pill.good { background: #e1f1e7; color: #18573d; }
.cards,.stack { display: grid; gap: 16px; }
.cards.three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.cards.two { grid-template-columns: minmax(0,2.3fr) minmax(220px,1fr); align-items: start; }
.card,.cards > article { padding: 19px 22px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.card > :last-child,.cards > article > :last-child { margin-bottom: 0; }
.card.blue,.card.resume { background: var(--soft); border-color: #bad0e4; }
.resume { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; }
.resume .muted { margin: 0; }
.lead { display: flex; justify-content: space-between; gap: 10px 18px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 20px; }
.lead p:last-child { margin: 0; max-width: 72ch; }
footer { background: var(--paper); border-top: 1px solid var(--line); }
footer > div {
  display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
  align-items: center; gap: 8px 16px; font-size: .82rem; color: var(--muted);
}
.footer-credit { text-align: center; text-align-last: center; }
footer nav { justify-content: flex-end; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; color: var(--navy); font-weight: 750; background: var(--soft); }
.account strong { font-size: .85rem; }
.account small { margin-top: 0; }
.frame { width: 100%; max-width: 1440px; margin: auto; display: grid; grid-template-columns: 224px minmax(0,1fr); flex: 1; }
.side-rail { border-right: 1px solid var(--line); background: var(--rail); padding: 24px 13px; min-width: 0; }
.side-rail nav { display: grid; gap: 5px; }
.side-rail nav a { padding: 9px 10px; border-radius: 6px; border-left: 3px solid transparent; }
.side-rail nav a:hover,.side-rail nav a[aria-current] { background: var(--soft); color: var(--navy); }
.side-rail nav a[aria-current] { border-left-color: var(--blue); }
.side-rail .eyebrow { padding-left: 12px; }
.mobile-navigation { display: none; }
.workspace { padding: 25px clamp(15px,3vw,38px) 40px; }
.table-wrap { border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--paper); font-size: .9rem; font-variant-numeric: tabular-nums; }
td,th { padding: 9px 12px; text-align: justify; vertical-align: middle; }
th { background: var(--navy); color: var(--paper); font-weight: 650; }
td { border-top: 1px solid var(--line); }
td .button { min-height: 36px; padding: 6px 10px; }
tbody tr:nth-child(even) { background: var(--stripe); }
tbody tr:hover { background: var(--soft); }
.module-progress { display: grid; gap: 3px; min-width: 108px; }
.module-progress progress { height: .55rem; }
.line { justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line p { margin: 0; }
.field { display: grid; gap: 5px; font-weight: 650; font-size: .9rem; min-width: 0; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,160px),1fr)); gap: 10px; align-items: end; }
input,select,textarea { font: .98rem var(--font); max-width: 100%; min-width: 0; color: var(--ink); text-align: justify; }
input:not([type=radio]):not([type=checkbox]),select,textarea { padding: 9px 11px; border: 1px solid #a5b7c8; border-radius: 7px; min-height: 42px; background: var(--paper); }
textarea { resize: vertical; line-height: 1.5; }
.page-access { max-width: 780px; padding-top: clamp(24px,6vh,64px); }
.access-main { padding: clamp(20px,3vw,34px); border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.auth { padding: 0; border: 0; }
.auth .lead { margin-bottom: 16px; }
.auth .actions,.access-options { margin-top: 14px; }
.access-next { margin: 15px 0 0; }
.registration-fields,.student-details { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 16px; }
.student-details { margin: 0 0 16px; }
.student-details dt { font-size: .87rem; color: var(--muted); }
.student-details dd { margin: 2px 0 0; }
.access-options form.stack { margin-top: 12px; }
.policy-checks { display: grid; gap: 10px; background: var(--stripe); }
.policy-check { display: grid; gap: 3px; }
.policy-check label { display: flex; align-items: flex-start; gap: 8px; }
.policy-check input { accent-color: var(--blue); flex: none; margin-top: 6px; }
.policy-check a { margin-left: 23px; font-size: .9rem; width: fit-content; }
.unavailable-form { padding: 0; border: 0; margin: 0; }
.unavailable-form button { background: var(--soft); border-color: var(--line); color: var(--navy); cursor: default; }
fieldset { border: 1px solid var(--line); border-radius: 7px; padding: 10px 13px; min-width: 0; }
legend { font-weight: 700; }
.option { display: block; padding: 7px 0; }
.option input { accent-color: var(--blue); margin-right: 6px; }
.notice { padding: 11px 14px; margin-bottom: 13px; border: 1px solid #b7cce0; border-radius: 7px; background: var(--soft); color: var(--navy); }
.notice.error { background: #fff0ef; color: #7c2a22; border-color: #ddb1aa; }
.notice.success { background: #e9f5eb; color: #18563d; border-color: #b6d5c1; }
.rich { max-width: 78ch; line-height: 1.74; overflow-wrap: anywhere; }
.rich p { margin-bottom: 1rem; white-space: pre-line; }
.rich h2 { margin: 1.3rem 0 .55rem; }
.rich h2:first-child { margin-top: 0; }
.lesson-layout > section { position: sticky; top: 16px; }
.crumb { margin-bottom: 12px; font-size: .86rem; color: var(--muted); }
.references { list-style: none; padding: 0; margin: 0; }
.references li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.references p { margin: 3px 0; }
details { padding: 10px 0; border-bottom: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 700; color: var(--navy); }
progress { width: 100%; height: .82rem; accent-color: var(--blue); }
.bar-line { display: grid; grid-template-columns: 6rem 1fr 3rem; align-items: center; gap: 8px; }
math { font-family: "Cambria Math","STIX Two Math","Latin Modern Math",math; }
.inline-math { margin-inline: .08em; }
.formula {
  display: grid; gap: 8px; margin: 12px 0; padding: 10px 14px; overflow-x: auto;
  background: var(--stripe); border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: 6px;
}
.formula math { margin: 2px 0; }
.certificate { position: relative; padding: 34px 28px; max-width: 820px; }
.certificate::before { content: ""; position: absolute; inset: 0; background: url("/static/escudo-uabjo.png") center/190px auto no-repeat; opacity: .06; pointer-events: none; }
.certificate img { width: 65px; height: 78px; object-fit: contain; }
@media (max-width: 890px) {
  .masthead nav { order: 3; width: 100%; }
  footer > div { grid-template-columns: minmax(0,1fr); justify-items: center; }
  footer nav { justify-content: center; }
  .frame { grid-template-columns: minmax(0,1fr); }
  .side-rail { padding: 4px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .desktop-navigation { display: none; }
  .mobile-navigation { display: block; border: 0; }
  .mobile-navigation nav { display: flex; flex-wrap: wrap; margin-top: 6px; }
  .side-rail nav a { padding: 6px 8px; }
}
@media (max-width: 680px) {
  .hero,.cards.three,.cards.two,.registration-fields,.student-details { grid-template-columns: minmax(0,1fr); }
  .page-access { padding-top: 20px; }
  .lesson-layout > section { position: static; }
  .stats { grid-template-columns: repeat(2,1fr); }
  .stats div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .stats div:nth-child(2) { border-right: 0; }
  .brand strong { font-size: .9rem; }
  .account { font-size: .83rem; }
  td,th { padding: 8px; }
}
@media print {
  @page { size: letter; margin: .7in; }
  body,.card,th,.formula { color: #000; background: #fff; }
  .masthead,aside,footer,.button,.skip,.crumb,form,.no-print { display: none !important; }
  .frame,.cards.two { display: block; }
  .workspace,.page,.card { padding: 0; border: 0; }
  .rich,.certificate { max-width: none; }
  h1,h2,h3 { color: #000; break-after: avoid; }
  tr,.formula { break-inside: avoid; }
  .certificate { print-color-adjust: exact; }
}
