:root {
  --ink: #000000;
  --muted: #626265;
  --line: #d9dadd;
  --panel: #ffffff;
  --surface: #f6f7f8;
  --blue: #00519d;
  --blue-dark: #003b73;
  --green: #2f855a;
  --green-dark: #1f6f48;
  --green-light: #bfe6cf;
  --green-soft: #e9f7ef;
  --gold: #eb9815;
  --cyan: #9ccdcb;
  --red: #b42318;
  --shadow: 0 16px 40px rgba(24, 33, 47, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-family: Lato, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  border-bottom: 5px solid var(--blue);
}

.utility-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  min-height: 34px;
  padding: 5px clamp(18px, 4vw, 56px);
  color: #fff;
  background: var(--blue);
}

.utility-bar p {
  margin: 0;
  font-size: 14px;
  font-weight: 900;
}

.utility-bar a {
  padding: 5px 11px;
  border: 2px solid #fff;
  border-radius: 3px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 88px;
  padding: 12px clamp(18px, 4vw, 56px);
  background: #fff;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand img {
  display: block;
  width: min(340px, 40vw);
  max-height: 66px;
  object-fit: contain;
}

.topnav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 18px;
}

.topnav a {
  padding: 8px 0;
  color: var(--blue);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.01em;
  text-decoration: none;
  text-transform: uppercase;
}

.topnav a:hover {
  color: var(--gold);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font-size: 22px;
}

.login-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  min-height: calc(100vh - 127px);
  padding: clamp(28px, 6vw, 72px);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.97), rgba(246, 247, 248, 0.94)),
    url("assets/surgery-basic-science-bg.svg") right center / auto 100%;
}

.login-copy {
  max-width: 720px;
}

.login-instructions {
  display: grid;
  gap: 10px;
  max-width: 680px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 18px;
  font-family: Oswald, Lato, sans-serif;
  font-size: clamp(34px, 6vw, 64px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

h2 {
  margin-bottom: 10px;
  font-family: Lato, sans-serif;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-copy p:not(.eyebrow),
.portal-hero p {
  max-width: 680px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.login-instructions p {
  margin: 0;
}

.support-note {
  grid-column: 1 / -1;
  justify-self: center;
  max-width: 720px;
  margin: 6px 0 0;
  color: #5f6368;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.support-note a {
  color: var(--blue-dark);
}

.login-panel {
  display: grid;
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.form-header p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

input:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(23, 105, 170, 0.18);
}

.form-error,
.form-success {
  min-height: 0;
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.form-error:empty,
.form-success:empty {
  display: none;
}

.form-error {
  color: var(--red);
}

.form-error a {
  color: var(--blue);
  font-weight: 900;
}

.form-success {
  color: var(--green);
}

.primary-button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--gold);
  font: inherit;
  font-weight: 600;
  letter-spacing: 0;
  cursor: pointer;
}

.primary-button:hover {
  background: #d8870f;
}

.primary-button:disabled {
  opacity: 0.72;
  cursor: wait;
}

.portal-view {
  padding-bottom: 56px;
}

.portal-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
  gap: 24px;
  align-items: end;
  padding: clamp(32px, 6vw, 72px) clamp(18px, 4vw, 56px);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.96), rgba(244, 249, 252, 0.94)),
    url("assets/surgery-basic-science-bg.svg") right center / auto 100%;
  border-bottom: 1px solid var(--line);
  border-top: 1px solid #fff;
}

.portal-hero h1 {
  font-size: clamp(32px, 5vw, 58px);
}

.progress-summary {
  padding: 24px;
  border: 1px solid #cfe0ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(24, 33, 47, 0.08);
}

.progress-summary span {
  display: block;
  color: var(--blue);
  font-family: Oswald, Lato, sans-serif;
  font-size: 44px;
  font-weight: 800;
}

.progress-summary p {
  margin-bottom: 16px;
  color: var(--muted);
  font-weight: 700;
}

.progress-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe7ef;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green-light), var(--green), var(--green-dark));
  transition: width 180ms ease;
}

.portal-content {
  width: min(1240px, calc(100% - 36px));
  margin: 28px auto 0;
}

.about-course {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(24, 33, 47, 0.06);
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading h2 {
  font-size: 26px;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 28px;
}

.about-copy p,
.about-facts p,
.about-facts li {
  color: var(--muted);
  line-height: 1.6;
}

.about-facts {
  padding-left: 22px;
  border-left: 1px solid var(--line);
}

.about-facts h3 {
  margin: 0 0 8px;
  font-family: Lato, sans-serif;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.about-facts ul {
  margin: 0;
  padding-left: 18px;
}

.module-toolbar h2 {
  font-size: 18px;
}

.main-content {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.module-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0;
}

.module-toolbar p {
  margin: 0;
  color: var(--muted);
}

.search-box {
  width: min(360px, 100%);
}

.search-box span {
  font-size: 13px;
}

.accordion-list {
  display: grid;
  gap: 12px;
}

.accordion-item {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(24, 33, 47, 0.04);
}

.accordion-item[data-complete="true"] {
  border-color: rgba(47, 133, 90, 0.48);
  background: #f7fcf9;
}

.accordion-item[data-complete="true"] .accordion-trigger {
  background: var(--green-soft);
}

.accordion-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 58px;
  padding: 16px 18px;
  border: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 17px;
  font-weight: 900;
  text-align: left;
}

.accordion-title {
  flex: 1 1 auto;
  min-width: 0;
}

.accordion-progress {
  display: inline-grid;
  flex: 0 0 116px;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.mini-progress {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe7ef;
}

.mini-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green-light), var(--green), var(--green-dark));
}

.accordion-trigger:hover,
.accordion-trigger[aria-expanded="true"] {
  background: #edf5fb;
}

.accordion-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
}

.accordion-panel {
  padding: 20px;
  border-top: 1px solid var(--line);
}

.presenter {
  margin-bottom: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.material-content ul {
  margin: 0 0 16px;
  padding-left: 0;
  list-style: none;
}

.material-content li {
  margin-bottom: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.material-content li li {
  margin-left: 18px;
}

.material-content a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 2px 0;
  color: var(--blue);
  font-weight: 400;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.material-content a::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  border: 2px solid #b8c6d6;
  border-radius: 999px;
  background: #fff;
}

.material-content a.resource-complete {
  color: var(--green);
}

.material-content a.resource-complete::before {
  border-color: var(--green);
  background: var(--green);
}

.module-status {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  font-size: 14px;
}

.module-status[data-status="started"] {
  border-color: rgba(0, 81, 157, 0.24);
  color: var(--blue);
  background: rgba(0, 81, 157, 0.06);
}

.module-status[data-status="completed"] {
  border-color: rgba(47, 133, 90, 0.34);
  color: var(--green-dark);
  background: var(--green-soft);
}

.certificate-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin-left: 10px;
  padding: 9px 14px;
  border: 1px solid var(--green-dark);
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  font-size: 14px;
  text-decoration: none;
}

.certificate-button:hover {
  background: var(--green-dark);
}

[hidden] {
  display: none !important;
}

@media (max-width: 860px) {
  .utility-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .topbar {
    align-items: flex-start;
    min-height: auto;
  }

  .topnav {
    display: none;
  }

  .brand img {
    width: min(320px, 72vw);
  }

  .login-view,
  .portal-hero,
  .portal-content,
  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-facts {
    padding-left: 0;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .module-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .accordion-trigger {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .accordion-progress {
    grid-column: 1 / -1;
    width: 100%;
    text-align: left;
  }

  .accordion-icon {
    grid-column: 2;
    grid-row: 1;
  }
}

@media (max-width: 520px) {
  .brand small {
    display: none;
  }

  .login-view {
    padding: 28px 18px;
  }

  .login-panel {
    padding: 20px;
  }

  .accordion-trigger {
    align-items: flex-start;
  }
}
