:root {
  --navy: #061733;
  --navy-soft: #0c2855;
  --blue: #0d5dcc;
  --cyan: #26b9e8;
  --gold: #e8b949;
  --paper: #f4f7fb;
  --white: #fff;
  --ink: #0b1d3a;
  --muted: #667085;
  --line: #dce4ef;
  --danger: #a62a22;
  --success: #087443;
  --shadow: 0 22px 70px rgba(6, 23, 51, .12);
}

* { box-sizing: border-box; }
html { color: var(--ink); background: var(--paper); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { margin: 0; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.kicker, .eyebrow { margin: 0 0 12px; color: var(--cyan); font-size: 12px; font-weight: 850; letter-spacing: .17em; text-transform: uppercase; }

/* Login and activation */
.portal-auth { min-height: 100vh; background: var(--navy); }
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(430px, 1.08fr) minmax(420px, .92fr); }
.auth-story { position: relative; min-height: 100vh; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(34px, 5vw, 76px); color: var(--white); background: linear-gradient(125deg, rgba(2, 15, 39, .97), rgba(7, 42, 104, .78)), url('/assets/images/hero-desktop.jpeg') center/cover; }
.auth-story::before { content: ""; position: absolute; inset: 0; opacity: .25; background: radial-gradient(circle at 80% 20%, var(--cyan), transparent 28%), radial-gradient(circle at 12% 82%, #8d2258, transparent 31%); }
.auth-story::after { content: ""; position: absolute; width: 500px; aspect-ratio: 1; right: -250px; bottom: -190px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 50%; box-shadow: 0 0 0 70px rgba(255, 255, 255, .025), 0 0 0 140px rgba(255, 255, 255, .02); }
.brand { position: relative; z-index: 1; display: inline-flex; width: fit-content; }
.brand img { display: block; width: 210px; max-height: 86px; object-fit: contain; object-position: left center; }
.auth-story-copy { position: relative; z-index: 1; max-width: 690px; }
.auth-story h1 { max-width: 760px; margin: 0 0 24px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(50px, 6vw, 86px); font-weight: 500; line-height: .94; letter-spacing: -.055em; }
.auth-story-copy > p:not(.kicker) { max-width: 620px; margin: 0; color: #d9e5f8; font-size: clamp(18px, 2vw, 22px); line-height: 1.6; }
.auth-benefits { display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 34px 0 0; list-style: none; }
.auth-benefits li { display: flex; align-items: center; gap: 9px; padding: 10px 13px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; background: rgba(255, 255, 255, .07); color: #eef5ff; font-size: 13px; }
.auth-benefits span { color: var(--cyan); font-weight: 900; }
.auth-note { position: relative; z-index: 1; margin: 0; color: #adbed9; font-size: 13px; }
.auth-panel { display: grid; place-items: center; min-height: 100vh; padding: clamp(24px, 5vw, 64px); background: linear-gradient(145deg, #f9fbff, #e9eff8); }
.auth-card { width: min(520px, 100%); padding: clamp(30px, 5vw, 54px); border: 1px solid #e0e7f0; border-radius: 28px; background: var(--white); box-shadow: var(--shadow); }
.auth-card-heading { margin-bottom: 30px; }
.auth-card h2 { margin: 0 0 10px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(34px, 4vw, 45px); font-weight: 500; line-height: 1.04; letter-spacing: -.04em; }
.muted { margin: 0; color: var(--muted); line-height: 1.55; }
.alert { margin: 0 0 22px; padding: 13px 15px; border: 1px solid #ffc6c1; border-radius: 12px; background: #fff1f0; color: var(--danger); font-size: 14px; line-height: 1.45; }
.alert-success { border-color: #afe2c9; background: #ecfbf3; color: var(--success); }
.portal-form { display: grid; gap: 19px; }
.portal-form label { display: grid; gap: 8px; color: var(--ink); font-size: 14px; font-weight: 750; }
.portal-form small { color: var(--muted); font-size: 12px; font-weight: 500; }
.portal-form input { width: 100%; min-height: 52px; padding: 14px 15px; border: 1px solid #cbd5e1; border-radius: 12px; outline: 0; background: #fff; color: var(--ink); }
.portal-form input::placeholder { color: #98a2b3; }
.portal-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(13, 93, 204, .11); }
.primary { display: flex; justify-content: center; align-items: center; gap: 12px; min-height: 54px; margin-top: 3px; padding: 14px 18px; border: 0; border-radius: 12px; background: var(--blue); color: #fff; font-weight: 800; cursor: pointer; box-shadow: 0 10px 24px rgba(13, 93, 204, .22); }
.primary:hover { background: #084ba9; }
.auth-links { display: flex; justify-content: space-between; gap: 18px; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 13px; }
.auth-links a { color: var(--blue); font-weight: 750; text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }

/* E-learning library */
.library-app { min-height: 100vh; display: grid; grid-template-columns: 390px minmax(0, 1fr); background: var(--paper); }
.library-sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; border-right: 1px solid #203657; background: var(--navy); color: #fff; }
.sidebar-header { padding: 24px 22px 18px; border-bottom: 1px solid rgba(255, 255, 255, .11); }
.sidebar-brand-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.sidebar-brand { display: inline-flex; }
.sidebar-brand img { display: block; width: 145px; max-height: 60px; object-fit: contain; object-position: left center; }
.logout-button { padding: 8px 11px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 9px; background: transparent; color: #d6e1f2; font-size: 12px; font-weight: 750; cursor: pointer; }
.logout-button:hover { border-color: rgba(255, 255, 255, .45); color: #fff; }
.welcome-block { display: grid; gap: 3px; margin-top: 21px; }
.welcome-block span { color: #8da4c7; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.welcome-block strong { overflow: hidden; color: #fff; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.library-filters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 20px; padding: 4px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px; background: rgba(255, 255, 255, .055); }
.filter-button { min-width: 0; padding: 9px 4px; border: 0; border-radius: 9px; background: transparent; color: #aabbd4; font-size: 11px; font-weight: 750; cursor: pointer; }
.filter-button span { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 2px; border-radius: 99px; background: rgba(255, 255, 255, .09); font-size: 10px; }
.filter-button.is-active { background: #fff; color: var(--navy); }
.search-field { position: relative; display: block; margin-top: 14px; }
.search-field > span:not(.sr-only) { position: absolute; z-index: 1; top: 50%; left: 13px; transform: translateY(-53%); color: #7f94b3; font-size: 20px; }
.search-field input { width: 100%; min-height: 46px; padding: 11px 13px 11px 40px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 11px; outline: 0; background: rgba(255, 255, 255, .075); color: #fff; }
.search-field input::placeholder { color: #91a5c1; }
.search-field input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(38, 185, 232, .14); }
.sort-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 13px; color: #8fa5c6; font-size: 11px; }
.sort-row select { max-width: 190px; padding: 7px 26px 7px 9px; border: 1px solid rgba(255, 255, 255, .13); border-radius: 8px; outline: 0; background: var(--navy-soft); color: #dce7f7; font-size: 11px; }
.resource-list { flex: 1; overflow: auto; padding: 12px 10px 26px; scrollbar-color: #385276 transparent; scrollbar-width: thin; }
.resource-item { width: 100%; display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; align-items: start; padding: 14px 12px; border: 0; border-left: 3px solid transparent; border-radius: 12px; background: transparent; color: #fff; text-align: left; cursor: pointer; }
.resource-item:hover { background: rgba(255, 255, 255, .055); }
.resource-item.is-active { border-left-color: var(--cyan); background: rgba(38, 185, 232, .12); }
.resource-item[hidden] { display: none; }
.resource-type-icon { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 11px; background: rgba(255, 255, 255, .07); color: var(--cyan); font-size: 14px; font-weight: 900; }
.resource-item-copy { min-width: 0; display: grid; gap: 3px; }
.resource-item-copy small { color: var(--cyan); font-size: 10px; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.resource-item-copy strong { display: -webkit-box; overflow: hidden; color: #f7fbff; font-size: 14px; line-height: 1.33; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.resource-item-copy > span { overflow: hidden; color: #91a7c6; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-empty, .no-results { padding: 30px 18px; color: #8ea4c4; text-align: center; font-size: 13px; line-height: 1.55; }
.no-results[hidden] { display: none; }

.lesson-area { width: min(1180px, 100%); min-width: 0; margin: 0 auto; padding: clamp(36px, 5vw, 70px) clamp(24px, 5vw, 76px) 80px; }
.lesson-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 28px; margin-bottom: 28px; }
.lesson-header > div:first-child { min-width: 0; }
.lesson-header h1 { max-width: 890px; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(38px, 5vw, 66px); font-weight: 500; line-height: 1.02; letter-spacing: -.045em; }
.lesson-speaker { margin: 13px 0 0; color: var(--muted); font-size: 18px; }
.lesson-speaker:empty { display: none; }
.view-only-badge { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; margin-top: 4px; padding: 9px 12px; border: 1px solid #cbd7e8; border-radius: 999px; background: #fff; color: #405673; font-size: 12px; font-weight: 800; }
.view-only-badge span { color: var(--blue); }
.viewer-card { overflow: hidden; border: 1px solid #d5dfec; border-radius: 22px; background: #fff; box-shadow: 0 18px 55px rgba(6, 23, 51, .1); }
.viewer-topbar { min-height: 50px; display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 12px 18px; border-bottom: 1px solid #d8e1ed; background: #fff; color: #66768e; font-size: 12px; }
.viewer-topbar span:first-child { color: var(--ink); font-weight: 850; }
.viewer-stage { position: relative; display: grid; place-items: center; width: 100%; min-height: 430px; aspect-ratio: 16 / 9; overflow: hidden; background: #030915; }
.viewer-stage[data-current-type="PRESENTATION"] { aspect-ratio: 16 / 10; background: #e9eef5; }
.viewer-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.viewer-unavailable { max-width: 500px; padding: 30px; color: #d9e5f5; text-align: center; }
.viewer-unavailable > span { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 17px; border-radius: 16px; background: rgba(255, 255, 255, .1); color: var(--cyan); font-size: 24px; font-weight: 900; }
.viewer-unavailable strong { display: block; font-size: 20px; }
.viewer-unavailable p { margin: 8px 0 0; color: #9fb0c7; }
.lesson-details { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; margin-top: 27px; }
.lesson-details > div, .content-policy { padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.lesson-details p { margin: 0; color: var(--muted); line-height: 1.65; }
.content-policy strong { display: block; margin-bottom: 7px; color: var(--ink); }
.content-policy p { font-size: 13px; }
.library-empty-state { min-height: calc(100vh - 150px); display: grid; place-content: center; max-width: 720px; margin: auto; text-align: center; }
.library-empty-state > span { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto 24px; border-radius: 20px; background: #e6f3ff; color: var(--blue); font-size: 30px; }
.library-empty-state h1 { margin: 0 0 14px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(38px, 6vw, 64px); font-weight: 500; line-height: 1; letter-spacing: -.045em; }
.library-empty-state > p:last-child { max-width: 620px; margin: 0 auto; color: var(--muted); font-size: 17px; line-height: 1.65; }

@media (max-width: 1050px) {
  .library-app { grid-template-columns: 340px minmax(0, 1fr); }
  .lesson-area { padding-inline: 34px; }
  .lesson-details { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-story { min-height: 560px; }
  .auth-panel { min-height: auto; padding-block: 48px; }
  .library-app { display: block; }
  .library-sidebar { position: relative; height: auto; max-height: 64vh; min-height: 520px; border-right: 0; border-bottom: 1px solid #203657; }
  .lesson-area { padding: 42px 24px 64px; }
  .lesson-header { flex-direction: column; }
  .viewer-stage { min-height: 360px; }
}

@media (max-width: 620px) {
  .auth-story { min-height: 500px; padding: 28px; }
  .auth-story h1 { font-size: 48px; }
  .brand img { width: 170px; }
  .auth-benefits li:nth-child(3) { display: none; }
  .auth-panel { padding: 18px; }
  .auth-card { padding: 28px 22px; border-radius: 20px; }
  .auth-links { flex-direction: column; }
  .library-sidebar { min-height: 540px; max-height: 70vh; }
  .sidebar-header { padding: 19px 15px 15px; }
  .sidebar-brand img { width: 126px; }
  .library-filters { grid-template-columns: 1fr; }
  .filter-button { display: flex; justify-content: space-between; padding: 9px 11px; }
  .lesson-area { padding-inline: 17px; }
  .lesson-header h1 { font-size: 40px; }
  .viewer-card { border-radius: 15px; }
  .viewer-topbar span:last-child { display: none; }
  .viewer-stage, .viewer-stage[data-current-type="PRESENTATION"] { min-height: 300px; aspect-ratio: 4 / 3; }
  .lesson-details > div, .content-policy { padding: 20px; }
}

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