:root {
  --bg: #f8fafc;
  --surface: #fff;
  --footer: #f1f5f9;
  --text: #334155;
  --heading: #1e293b;
  --blue: #046bd2;
  --blue-dark: #034f9c;
  --yellow: #ffcc66;
  --yellow-soft: #fff7df;
  --dgsa-red: #d33b54;
  --line: #dfe6ec;
  --ok: #18794e;
  --bad: #b42318;
  --warn: #9a6700;
  --shadow: 0 14px 35px rgba(30, 41, 59, .08);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--blue-dark); }
.wrap { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }

.network-bar { background: var(--yellow); color: var(--heading); }
.network-row {
  position: relative;
  min-height: 68px;
  display: grid;
  grid-template-columns: auto minmax(280px, 1fr) auto;
  align-items: center;
  gap: 24px;
}
.network-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--heading);
  text-decoration: none;
  white-space: nowrap;
}
.network-brand:hover { color: var(--heading); }
.dgsa-wordmark {
  color: var(--dgsa-red);
  font-size: 30px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: -.06em;
  line-height: 1;
}
.network-brand-copy,
.brand-copy { display: grid; line-height: 1.15; }
.network-brand-copy strong { font-size: 14px; }
.network-brand-copy small,
.brand-copy small { font-size: 10px; font-weight: 650; letter-spacing: .025em; color: #59677a; }
.service-nav {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 3px;
  overflow-x: auto;
  scrollbar-width: none;
}
.service-nav::-webkit-scrollbar { display: none; }
.service-link {
  flex: 0 0 auto;
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #0059c9;
  text-decoration: none;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.service-link:hover,
.service-link:focus-visible { background: rgba(255, 255, 255, .65); color: #003f91; transform: translateY(-1px); }
.service-link svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.adr-network-nav {
  min-width: 0;
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
}
.adr-network-nav::-webkit-scrollbar { display: none; }
.adr-network-link {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: #003f91;
  text-decoration: none;
}
.adr-network-link:hover,
.adr-network-link:focus-visible { background: rgba(255, 255, 255, .68); color: #002f6c; }
.adr-network-link svg { width: 16px; height: 16px; max-width: 16px; max-height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.network-nav { display: flex; align-items: center; gap: 24px; }
.network-nav a {
  color: var(--heading);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.network-nav a:hover { color: var(--blue-dark); }
.network-tools { position: relative; }
.network-tools > summary {
  list-style: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #003f91;
  cursor: pointer;
}
.network-tools > summary::-webkit-details-marker { display: none; }
.network-tools > summary:hover { background: rgba(255,255,255,.68); }
.network-tools > summary svg { width: 16px; height: 16px; max-width: 16px; max-height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.network-tools .service-nav {
  position: absolute;
  z-index: 40;
  right: 0;
  top: calc(100% + 9px);
  width: max-content;
  max-width: min(430px, calc(100vw - 24px));
  padding: 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.site-header {
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid #e8edf2;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
}
.header-row { min-height: 80px; display: flex; align-items: center; gap: 28px; }
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--heading);
}
.brand:hover { color: var(--heading); }
.brand-copy strong { font-size: 23px; font-weight: 800; letter-spacing: -.025em; }
.adr-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 2px solid var(--heading);
  border-radius: 9px;
  background: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
}
.nav { margin-left: auto; display: flex; align-items: center; gap: 20px; }
.nav a { text-decoration: none; color: var(--heading); font-size: 14px; font-weight: 700; }
.nav a:hover { color: var(--blue); }
.exam-menu { position: relative; }
.exam-menu summary {
  list-style: none;
  cursor: pointer;
  color: var(--heading);
  font-size: 14px;
  font-weight: 700;
}
.exam-menu summary::-webkit-details-marker { display: none; }
.exam-menu summary::after { content: "⌄"; margin-left: 6px; color: var(--blue); }
.exam-menu[open] summary::after { content: "⌃"; }
.exam-menu > div {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  min-width: 190px;
  display: grid;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.exam-menu > div a { padding: 8px 10px; border-radius: 6px; white-space: nowrap; }
.exam-menu > div a:hover { background: #f1f6fc; }

main {
  min-height: calc(100vh - 280px);
  padding: 42px 0 72px;
  background: linear-gradient(180deg, #fff 0, #f8fafc 72%, #f8fafc 100%);
}
.course-bridge {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 28px;
  margin-bottom: 22px;
  padding: 22px 26px;
  background: var(--yellow-soft);
  border: 1px solid #efc052;
  border-left: 6px solid var(--yellow);
  border-radius: 12px;
}
.course-bridge h2 { margin: 5px 0 6px; font-size: clamp(21px, 2.2vw, 28px); }
.course-bridge p { margin: 0; max-width: 760px; }
.bridge-badge {
  display: inline-flex;
  color: #765400;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.bridge-actions { flex: 0 0 auto; display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.bridge-actions .btn { white-space: nowrap; }

.andalucia-promo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-top: 20px;
  padding: 26px 28px;
  color: var(--heading);
  background: linear-gradient(115deg, #fff3c9, #fffaf0);
  border: 1px solid #efc052;
  border-radius: var(--radius);
}
.andalucia-promo h2 { margin: 2px 0 6px; }
.andalucia-promo p { margin: 0; max-width: 760px; }
.andalucia-promo .btn { flex: 0 0 auto; }

.andalucia-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, .55fr);
  gap: 28px;
  align-items: stretch;
  margin-bottom: 24px;
}
.andalucia-hero h1 { font-size: clamp(38px, 5vw, 64px); line-height: 1.02; margin: 0 0 16px; letter-spacing: -.045em; }
.source-summary { display: grid; align-content: center; gap: 8px; background: var(--yellow-soft); border-color: #efc052; }
.source-summary > strong { color: var(--heading); font-size: clamp(54px, 7vw, 82px); line-height: .95; }
.source-summary > span { font-size: 18px; font-weight: 750; color: var(--heading); }
.rate-cards { margin: 18px 0 24px; }
.rate-cards h3 { margin: 14px 0 4px; }
.rate-cards p { margin: 0; }
.featured-rate { background: var(--yellow-soft); border-color: #efc052; }
.result-tables { align-items: start; }
.result-tables .card { padding: 22px; }
.result-tables th[scope="row"] { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--heading); }
.exam-library { margin-top: 54px; scroll-margin-top: 100px; }
.exam-library > h2 { margin-top: 34px; }
.exam-source { display: flex; flex-direction: column; justify-content: space-between; }
.exam-source h3 { margin: 12px 0 6px; }
.exam-source p { margin-top: 0; }
.exam-source .actions { align-items: center; }
.inline-form { display: inline-flex; margin: 0; }
.official-links { margin-top: 32px; }

.hero { display: grid; grid-template-columns: 1.4fr .8fr; gap: 28px; align-items: stretch; }
.card { background: var(--surface); border: 1px solid #e7ecf1; border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.hero h1 { font-size: clamp(34px, 5vw, 60px); line-height: 1.04; margin: 0 0 18px; color: var(--heading); letter-spacing: -.04em; }
.eyebrow { color: var(--blue); font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.lead { font-size: 19px; max-width: 720px; }
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  border: 0;
  border-radius: 7px;
  padding: 10px 18px;
  background: var(--blue);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}
.btn:hover { background: var(--blue-dark); color: #fff; }
.btn.secondary { background: #eaf3ff; color: #074f9e; }
.btn.ghost { background: #fff; color: var(--heading); border: 1px solid #cfd8e3; }
.btn.ghost:hover { border-color: var(--blue); color: var(--blue-dark); }
.btn.danger { background: var(--bad); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.stat { font-size: 40px; font-weight: 850; color: var(--heading); line-height: 1; }
.muted { color: #64748b; }
.notice { padding: 16px 18px; border-radius: 10px; background: #fff8db; border: 1px solid #f2cf66; color: #604b00; margin: 20px 0; }
.notice.error { background: #fff1f0; border-color: #f0a7a1; color: #7a1510; }
.notice.ok { background: #edfdf4; border-color: #88d7ae; color: #135c3a; }
.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
h1, h2, h3 { color: var(--heading); line-height: 1.25; }
h1, h2 { font-weight: 600; }
h2 { margin-top: 0; }
.field { display: grid; gap: 7px; margin: 0 0 16px; }
.field label { font-weight: 750; color: var(--heading); }
input, select, textarea { width: 100%; border: 1px solid #cbd5e1; border-radius: 7px; padding: 11px 12px; font: inherit; background: #fff; color: var(--heading); }
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(4, 107, 210, .18); border-color: var(--blue); }
.specialties { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label { display: block; height: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 16px; background: #fff; cursor: pointer; font-weight: 750; }
.choice input:checked + label { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(4, 107, 210, .13); color: var(--blue); }
.exam-bar { position: sticky; top: 81px; z-index: 15; background: rgba(248, 250, 252, .95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: 12px 0; }
.exam-meta { display: flex; align-items: center; gap: 18px; justify-content: space-between; }
.timer { font-variant-numeric: tabular-nums; font-size: 24px; font-weight: 850; color: var(--heading); }
.question { margin: 20px 0; }
.question-number { font-size: 13px; color: var(--blue); font-weight: 850; }
.options { display: grid; gap: 10px; margin-top: 18px; }
.option { display: flex; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 13px 15px; background: #fff; cursor: pointer; }
.option:has(input:checked) { border-color: var(--blue); background: #f2f7fd; }
.option input { width: auto; margin-top: 4px; }
.answer-state { font-weight: 800; }
.answer-state.ok { color: var(--ok); }
.answer-state.bad { color: var(--bad); }
.table-wrap { overflow: auto; border-radius: 10px; border: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; background: #fff; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: #617386; background: #f7f9fb; }
.pill { display: inline-flex; border-radius: 999px; padding: 3px 9px; background: #eef2f6; font-size: 12px; font-weight: 800; }
.pill.published, .pill.graded { background: #e8f8ef; color: var(--ok); }
.pill.in_review, .pill.awaiting_review { background: #fff4ce; color: var(--warn); }
.site-footer { background: #17253a; border-top: 5px solid var(--yellow); padding: 32px 0 18px; color: #dce5ef; font-size: 14px; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--yellow); }
.footer-intro { display: flex; justify-content: space-between; gap: 28px; align-items: start; padding-bottom: 20px; }
.footer-intro p { margin: 6px 0 0; max-width: 720px; color: #c4cfdb; }
.footer-title { color: #fff; font-size: 20px; }
.footer-network-label { color: var(--yellow); font-weight: 800; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.footer-accordions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.footer-accordions details { border-top: 1px solid #405067; padding-top: 12px; }
.footer-accordions summary { list-style: none; cursor: pointer; color: #fff; font-weight: 800; }
.footer-accordions summary::-webkit-details-marker { display: none; }
.footer-accordions summary::after { content: "+"; float: right; color: var(--yellow); font-size: 18px; line-height: 1; }
.footer-accordions details[open] summary::after { content: "−"; }
.footer-accordions details > div { display: grid; gap: 7px; padding-top: 10px; }
.footer-accordions details > div a { text-decoration: none; color: #cdd8e4; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; margin-top: 24px; padding-top: 16px; border-top: 1px solid #405067; color: #aebccc; }
.footer-row { display: flex; gap: 28px; justify-content: space-between; align-items: center; }
.footer-ecosystem { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.small { font-size: 13px; }
.right { text-align: right; }

@media (max-width: 1080px) {
  .network-row { grid-template-columns: auto minmax(260px, 1fr) auto; }
  .network-nav { display: none; }
  .service-nav, .adr-network-nav { justify-content: flex-end; }
  .course-bridge { align-items: flex-start; }
  .bridge-actions { max-width: 290px; }
}

@media (max-width: 820px) {
  .network-row { min-height: 62px; gap: 14px; }
  .network-brand-copy small { display: none; }
  .dgsa-wordmark { font-size: 26px; }
  .header-row { min-height: 70px; }
  .nav > a:not(.always), .nav > details { display: none; }
  .brand-copy strong { font-size: 20px; }
  .brand-copy small { display: none; }
  .hero, .andalucia-hero, .grid.two, .grid.three { grid-template-columns: 1fr; }
  .course-bridge { display: grid; }
  .andalucia-promo { display: grid; }
  .andalucia-promo .btn { justify-self: start; }
  .bridge-actions { max-width: none; justify-content: flex-start; }
  .specialties { grid-template-columns: 1fr 1fr; }
  .exam-bar { top: 71px; }
  .footer-row { display: block; }
  .footer-accordions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .right { text-align: left; margin-top: 16px; }
}

@media (max-width: 620px) {
  .network-row { grid-template-columns: 1fr; padding: 10px 0 8px; gap: 7px; }
  .network-brand { justify-content: center; }
  .network-brand-copy { display: none; }
  .service-nav, .adr-network-nav { justify-content: flex-start; padding-inline: 2px; }
  .adr-network-link { width: 26px; height: 26px; }
  .network-tools { position: absolute; right: 16px; top: 10px; }
  .network-tools .service-nav { right: 0; }
  .service-link { width: 32px; height: 32px; }
}

@media print {
  .network-bar svg {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
    fill: none !important;
    stroke: currentColor !important;
  }
  .network-tools .service-nav { display: none !important; }
}

@media (max-width: 520px) {
  .wrap { width: min(100% - 20px, 1180px); }
  main { padding-top: 24px; }
  .course-bridge { padding: 19px 18px; border-left-width: 4px; }
  .bridge-actions { display: grid; }
  .card { padding: 20px; }
  .specialties { grid-template-columns: 1fr; }
  .brand { gap: 9px; }
  .brand-copy strong { font-size: 18px; }
  .adr-mark { width: 42px; height: 42px; }
  .nav { gap: 12px; }
  .footer-ecosystem { flex-wrap: wrap; }
  .footer-intro, .footer-bottom { display: grid; }
  .footer-accordions { grid-template-columns: 1fr; }
  .footer-accordions details { padding-bottom: 4px; }
}
