:root {
  --ink: #10151b;
  --muted: #657180;
  --cyan: #28abe3;
  --cyan-dark: #148abc;
  --cyan-soft: #e9f7fd;
  --line: #dce5eb;
  --surface: #ffffff;
  --canvas: #f4f8fa;
  --success: #22734b;
  --success-bg: #e6f5ed;
  --danger: #a2302a;
  --danger-bg: #fff0ef;
  --shadow: 0 22px 60px rgba(14, 28, 38, .10);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; background: var(--canvas); color: var(--ink); font-family: Catamaran, system-ui, sans-serif; font-size: 16px; line-height: 1.55; }
a { color: var(--cyan-dark); }
.skip { position: absolute; left: -10000px; }
.skip:focus { left: 16px; top: 16px; z-index: 20; padding: 10px 14px; background: #fff; border-radius: 6px; }
:focus-visible { outline: 3px solid rgba(40, 171, 227, .5); outline-offset: 3px; }

.portal-header { min-height: 84px; padding: 15px max(24px, 5vw); display: flex; align-items: center; justify-content: space-between; gap: 24px; color: #fff; background: #050708; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.brand { display: flex; align-items: center; gap: 17px; color: #fff; text-decoration: none; }
.portal-header .brand .portal-brand-logo { display: block; flex: 0 0 94px; width: 94px !important; max-width: 94px !important; height: 49px !important; object-fit: cover; object-position: center; filter: invert(1); mix-blend-mode: screen; }
.brand span { padding-left: 17px; border-left: 1px solid rgba(255, 255, 255, .3); color: #d6dde1; font-size: 13px; font-weight: 600; letter-spacing: .11em; text-transform: uppercase; }
.portal-header form { margin: 0; }

main:not(.admin-login-shell) { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 52px 0 68px; }
h1 { margin: 8px 0 12px; font-size: clamp(34px, 4.5vw, 56px); line-height: 1.08; letter-spacing: -.035em; }
h2 { margin: 0 0 20px; font-size: 24px; line-height: 1.25; }
h3 { margin: 0 0 6px; font-size: 21px; line-height: 1.3; }
h4 { margin: 0 0 12px; color: #344350; font-size: 14px; }
.eyebrow, .panel-kicker { margin: 0; color: var(--cyan-dark); font-size: 12px; font-weight: 800; letter-spacing: .19em; text-transform: uppercase; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.panel { padding: 30px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 34px rgba(16, 34, 46, .045); }
.notice, .error { margin-bottom: 22px; padding: 14px 16px; border-radius: 8px; }
.notice { background: var(--success-bg); color: var(--success); }
.error { background: var(--danger-bg); color: var(--danger); }

label { display: block; margin: 20px 0 7px; font-size: 14px; font-weight: 700; }
input:not([type=checkbox]) { width: 100%; min-height: 48px; padding: 11px 14px; border: 1px solid #b8c5cd; border-radius: 7px; background: #fff; color: var(--ink); font: inherit; transition: border-color .18s, box-shadow .18s; }
input:not([type=checkbox]):focus { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(40, 171, 227, .12); outline: none; }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 45px; padding: 10px 23px; border: 1px solid transparent; border-radius: 40px; background: var(--cyan); color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; transition: background .18s, transform .18s, box-shadow .18s; }
button:hover, .button:hover { background: var(--cyan-dark); box-shadow: 0 8px 20px rgba(40, 171, 227, .22); transform: translateY(-1px); }
form > button { width: 100%; margin-top: 26px; }
.secondary { width: auto; min-height: 40px; margin: 0; border-color: rgba(255,255,255,.45); background: transparent; }
.secondary:hover { background: #fff; color: #050708; }

.login-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); align-items: center; gap: clamp(50px, 8vw, 110px); min-height: calc(100vh - 250px); }
.login-intro { position: relative; padding: 50px 0; }
.login-intro h1 { max-width: 690px; font-size: clamp(44px, 6vw, 78px); }
.login-intro > p:last-of-type { max-width: 580px; color: #596775; font-size: 19px; }
.login-panel { padding: clamp(28px, 4vw, 44px); border-top: 4px solid var(--cyan); box-shadow: var(--shadow); }
.login-panel h2, .admin-form-wrap h2 { margin: 7px 0 3px; font-size: 30px; }
.support-note { margin: 24px 0 0; text-align: center; }
.pulse-line { position: relative; width: min(520px, 86%); height: 70px; margin-top: 38px; overflow: hidden; opacity: .55; }
.pulse-line::before { content: ""; position: absolute; inset: 34px 0 auto; height: 2px; background: var(--cyan); }
.pulse-line span { position: absolute; left: 37%; top: 17px; width: 74px; height: 38px; border-left: 3px solid var(--cyan); border-bottom: 3px solid var(--cyan); transform: skew(-26deg); }
.pulse-line span::after { content: ""; position: absolute; left: 38px; top: -25px; width: 28px; height: 48px; border-left: 3px solid var(--cyan); border-bottom: 3px solid var(--cyan); }

.welcome { max-width: 780px; }
.welcome > p:last-child { margin: 0; color: var(--muted); font-size: 18px; }
.resources-section { margin-top: 35px; }
.section-heading, .resource-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.section-heading { margin-bottom: 16px; }
.section-heading h2 { margin: 5px 0 0; }
.resource-count { color: var(--muted); font-size: 13px; }
.resources-list { display: grid; gap: 17px; }
.resource-card { position: relative; overflow: hidden; border-left: 4px solid var(--cyan); }
.resource-card::after { content: ""; position: absolute; top: 0; right: 0; width: 110px; height: 4px; background: var(--cyan-soft); }
.resource-title { align-items: flex-start; }
.resource-title p { margin: 0; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 5px; background: var(--success-bg); color: var(--success); font-size: 13px; font-weight: 700; white-space: nowrap; }
.file-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 38px; margin-top: 22px; padding-top: 20px; border-top: 1px solid #e6ecef; }
.file-columns h4 span { color: #71808b; font-weight: 500; }
.file-list { margin: 0; padding: 0; list-style: none; }
.file-list li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid #edf1f3; }
.file-list li:last-child { border-bottom: 0; }
.file-list strong { display: block; font-size: 14px; overflow-wrap: anywhere; }
.file-list span { display: block; margin-top: 2px; color: #71808b; font-size: 12px; }
.download { padding: 7px 13px; border: 1px solid #b7e2f4; border-radius: 30px; background: var(--cyan-soft); font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.download:hover { border-color: var(--cyan); background: #dff3fc; }
.empty-state { padding: 52px; text-align: center; }
.portal-footer { display: flex; justify-content: space-between; gap: 20px; padding: 20px max(24px, 5vw); border-top: 1px solid #dce5eb; color: #74808a; background: #fff; font-size: 13px; }
.portal-footer a { font-weight: 700; text-decoration: none; }

.admin-login-page { background: #050708; }
.admin-login-shell { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(440px, .88fr); min-height: 100vh; }
.admin-brand-panel { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; padding: clamp(38px, 6vw, 82px); overflow: hidden; color: #fff; background: radial-gradient(circle at 77% 20%, rgba(40,171,227,.20), transparent 28%), linear-gradient(145deg, #020303, #0b1419); }
.admin-brand-panel::after { content: ""; position: absolute; right: -8%; bottom: 10%; width: 78%; height: 180px; opacity: .18; background: linear-gradient(160deg, transparent 46%, var(--cyan) 47%, var(--cyan) 49%, transparent 50%) 0 0 / 130px 90px; transform: rotate(-4deg); }
.admin-logo { position: relative; z-index: 1; width: fit-content; }
.admin-logo img { width: 128px; height: 72px; object-fit: cover; filter: invert(1); mix-blend-mode: screen; }
.admin-brand-panel > div { position: relative; z-index: 1; max-width: 680px; }
.admin-brand-panel h1 { max-width: 650px; font-size: clamp(48px, 6vw, 82px); }
.admin-brand-panel > div > p:last-child { max-width: 580px; color: #aebbc2; font-size: 18px; }
.admin-security-note { position: relative; z-index: 1; margin: 0; color: #84939b; font-size: 13px; letter-spacing: .04em; }
.admin-security-note span { margin-right: 8px; color: var(--cyan); }
.admin-form-panel { display: grid; place-items: center; padding: 40px; background: #f8fbfc; }
.admin-form-wrap { width: min(430px, 100%); }
.admin-form-wrap .error { margin-top: 22px; }

@media (max-width: 840px) {
  .login-layout, .admin-login-shell { grid-template-columns: 1fr; }
  .login-layout { gap: 18px; min-height: auto; }
  .login-intro { padding: 16px 0; }
  .pulse-line { display: none; }
  .admin-brand-panel { min-height: auto; padding: 35px 25px 45px; }
  .admin-brand-panel h1 { font-size: 42px; }
  .admin-security-note { margin-top: 32px; }
  .admin-form-panel { padding: 48px 24px; }
  .file-columns { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 560px) {
  .portal-header { align-items: flex-start; }
  .brand { gap: 10px; }
  .portal-header .brand .portal-brand-logo { flex-basis: 76px; width: 76px !important; max-width: 76px !important; height: 40px !important; }
  .brand span { padding-left: 10px; font-size: 10px; }
  main:not(.admin-login-shell) { width: min(100% - 28px, 1180px); padding: 34px 0 50px; }
  .login-intro h1 { font-size: 40px; }
  .panel { padding: 22px 20px; }
  .section-heading, .resource-title { align-items: flex-start; flex-direction: column; gap: 10px; }
  .file-list li { align-items: flex-start; }
  .portal-footer { flex-direction: column; }
}

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