:root {
  --blue: #00519d;
  --neutral: #929295;
  --ink: #000000;
  --cyan: #9ccdcb;
  --gold: #eb9815;
  --surface: #f5f7f8;
  --panel: #ffffff;
  --line: #d9dadd;
  --muted: #626265;
  --red: #b42318;
  --shadow: 0 18px 46px rgba(25, 35, 55, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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: 20;
  background: #fff;
  border-bottom: 5px solid var(--blue);
}

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

.utility-bar p {
  margin: 0;
  font-size: 16px;
  font-weight: 400;
}

.utility-bar a {
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 3px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 96px;
  padding: 14px 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: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  text-transform: uppercase;
}

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

.sign-out-button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--blue);
  background: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.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.98),
      rgba(246, 247, 248, 0.94)
    ),
    radial-gradient(
      circle at 78% 35%,
      rgba(156, 205, 203, 0.26),
      transparent 32%
    ),
    linear-gradient(135deg, rgba(19, 84, 155, 0.08), transparent 44%);
}

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

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

.info-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.info-strip span {
  padding: 8px 12px;
  border: 1px solid rgba(19, 84, 155, 0.18);
  border-radius: 999px;
  color: var(--blue);
  background: rgba(156, 205, 203, 0.18);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

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

h1 {
  max-width: 820px;
  margin-bottom: 18px;
  font-family: Oswald, Lato, sans-serif;
  font-size: clamp(42px, 7vw, 88px);
  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),
.library-hero p {
  max-width: 720px;
  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);
  font-weight: 600;
}

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

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

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

input:focus,
button:focus-visible,
a:focus-visible {
  border-color: var(--blue);
  outline: 3px solid rgba(19, 84, 155, 0.18);
}

.form-error,
.form-success {
  min-height: 0;
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

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

.form-success {
  color: #1f6f48;
}

.primary-button,
.secondary-button,
.filter-button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--gold);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.primary-button:hover,
.filter-button:hover {
  background: #d7810e;
}

.secondary-button {
  border: 2px solid var(--blue);
  color: var(--blue);
  background: #fff;
}

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

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

.portal-view {
  min-height: calc(100vh - 127px);
}

.library-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 260px);
  align-items: end;
  gap: 28px;
  padding: clamp(36px, 6vw, 80px) clamp(18px, 5vw, 72px) clamp(24px, 4vw, 42px);
  color: var(--ink);
  background:
    linear-gradient(
      120deg,
      rgba(255, 255, 255, 0.96),
      rgba(245, 247, 248, 0.9)
    ),
    linear-gradient(90deg, rgba(19, 84, 155, 0.12), rgba(156, 205, 203, 0.2));
}

.hero-copy h1 {
  font-size: clamp(36px, 5.8vw, 72px);
  margin-bottom: 20px;
}

.library-stat {
  padding: 22px;
  border-left: 7px solid var(--cyan);
  background: #fff;
  box-shadow: var(--shadow);
}

.library-stat span {
  display: block;
  color: var(--blue);
  font-family: Oswald, Lato, sans-serif;
  font-size: 64px;
  line-height: 0.95;
  font-weight: 700;
}

.library-stat p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.library-shell {
  padding: clamp(22px, 4vw, 46px) clamp(18px, 5vw, 72px) 72px;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(300px, 480px) minmax(
      300px,
      380px
    );
  align-items: end;
  gap: 16px;
  margin-bottom: 18px;
}

.filter-actions {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.compact-button {
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--line);
  color: var(--blue);
  background: #fff;
  white-space: nowrap;
}

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

.filter-bar h2 {
  margin-bottom: 4px;
}

.filter-bar p {
  margin: 0;
  color: var(--muted);
}

.search-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-filter {
  position: relative;
}

.filter-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 0 16px;
  text-align: center;
  white-space: nowrap;
}

.filter-button::after {
  content: "";
  width: 0;
  height: 0;
  border-right: 5px solid transparent;
  border-left: 5px solid transparent;
  border-top: 7px solid currentColor;
  transform: translateY(1px);
}

.section-menu {
  position: absolute;
  right: 0;
  z-index: 15;
  display: grid;
  gap: 2px;
  width: min(330px, 88vw);
  max-height: 360px;
  margin-top: 8px;
  padding: 8px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.section-option {
  display: flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.25;
}

.section-option:hover {
  background: rgba(156, 205, 203, 0.2);
}

.section-option input {
  width: 16px;
  min-height: 16px;
  padding: 0;
}

.loading-state {
  margin: 0 0 22px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
}

.source-note {
  min-height: 20px;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
}

.source-note.warning {
  color: var(--red);
}

.section-list {
  display: grid;
  gap: 28px;
}

.library-section {
  border-top: 8px solid var(--blue);
  background: #fff;
  box-shadow: var(--shadow);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
}

.section-heading h3 {
  margin: 0;
  font-family: Oswald, Lato, sans-serif;
  font-size: clamp(24px, 3.6vw, 34px);
  line-height: 1.05;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1px;
  background: var(--line);
}

.single-resource-section .resource-grid {
  grid-template-columns: minmax(280px, 560px);
}

.resource-card {
  display: grid;
  grid-template-rows: auto 1fr;
  background: #fff;
}

.resource-media {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(19, 84, 155, 0.94), rgba(0, 0, 0, 0.78)),
    linear-gradient(45deg, rgba(156, 205, 203, 0.3), transparent);
}

.resource-media iframe,
.resource-media video {
  width: 100%;
  height: 100%;
  border: 0;
}

.resource-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.85);
}

.youtube-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.42));
}

.play-badge {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 70px;
  height: 50px;
  border-radius: 8px;
  color: #fff;
  background: rgba(19, 84, 155, 0.92);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25);
}

.play-badge::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-left: 18px solid #fff;
}

.resource-placeholder {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border: 3px solid rgba(255, 255, 255, 0.82);
  border-radius: 50%;
  font-family: Oswald, Lato, sans-serif;
  font-size: 28px;
  line-height: 1;
}

.resource-body {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 18px;
}

.resource-body h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.resource-body a {
  color: var(--blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.resource-meta {
  display: grid;
  gap: 4px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
}

.empty-state {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  text-align: center;
  box-shadow: var(--shadow);
}

@media (max-width: 920px) {
  .login-view,
  .library-hero,
  .filter-bar {
    grid-template-columns: 1fr;
  }

  .filter-actions {
    grid-template-columns: minmax(150px, 1fr) auto;
  }

  .library-stat {
    max-width: 260px;
  }
}

@media (max-width: 640px) {
  .utility-bar {
    justify-content: center;
  }

  .info-strip {
    gap: 8px;
  }

  .info-strip span {
    width: 100%;
    text-align: center;
  }

  .utility-bar p {
    display: none;
  }

  .topbar {
    align-items: flex-start;
    gap: 14px;
    min-height: 96px;
  }

  .brand img {
    width: min(250px, 58vw);
    max-height: 60px;
  }

  .topnav {
    gap: 8px;
  }

  .topnav a {
    font-size: 13px;
  }

  .login-view {
    min-height: auto;
    padding: 30px 18px;
  }

  h1 {
    font-size: 42px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .section-heading p {
    white-space: normal;
  }

  .resource-grid {
    grid-template-columns: 1fr;
  }

  .single-resource-section .resource-grid {
    grid-template-columns: 1fr;
  }
}
