:root {
  color-scheme: light;
  --ink: #121a39;
  --muted: #56617b;
  --line: #e0e5f1;
  --violet: #6d27ce;
  --blue: #2459d7;
  --action: linear-gradient(106deg, #2459d7, #7425ce);
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); font: 1rem/1.55 "Segoe UI", system-ui, sans-serif; background: #f5f7fc; }
a { color: var(--blue); text-underline-offset: .22em; }
.top {
  min-height: 5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .8rem;
  padding: 1rem max(1.3rem, calc((100vw - 72rem) / 2));
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; }
.brand img { width: 9.4rem; height: auto; }
nav { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.25rem; }
nav a { font-size: .9rem; font-weight: 650; }
.login-view {
  min-height: 100dvh;
  background: radial-gradient(ellipse at 16% 24%, #e3efff 0, transparent 42%), radial-gradient(ellipse at 93% 95%, #ebddff 0, transparent 42%), #f4f6fd;
}
.signin {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  width: min(67rem, calc(100% - 3rem));
  margin: clamp(2rem, 8vh, 6rem) auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1.6rem;
  background: #fff;
  box-shadow: 0 30px 85px #23286425;
}
.brand-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  place-items: center;
  min-height: 32rem;
  background: radial-gradient(ellipse at 10% 20%, #103f75, transparent 62%), radial-gradient(ellipse at 95% 90%, #492184, transparent 64%), #111736;
}
.brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle, #c9d6ff 1px, transparent 1.4px) 0 0 / 24px 24px;
  opacity: .24;
  mask-image: linear-gradient(135deg, #000, transparent 79%);
}
.brand-orbit {
  position: absolute;
  z-index: -1;
  width: 70%;
  aspect-ratio: 1;
  border: 1px solid #b6c6ff38;
  border-radius: 50%;
  box-shadow: 0 0 0 26px #a8b9ff17, 0 0 0 54px #a8b9ff0c, inset 0 0 65px #6a78fb38;
}
.brand-panel img { width: min(52%, 18rem); height: auto; filter: drop-shadow(0 16px 40px #070a24a0); }
.login-panel { display: grid; align-items: center; padding: clamp(2rem, 5.5vw, 5rem); }
h1 { margin: 0; letter-spacing: -.045em; line-height: 1.08; font-size: clamp(2rem, 4vw, 3.35rem); }
.login-panel h1 { font-size: clamp(2rem, 3.8vw, 2.85rem); }
.intro { color: var(--muted); margin: .65rem 0 1.8rem; }
#loginform p { margin: 0 0 1.15rem; }
label { display: block; font-size: .9rem; font-weight: 700; margin-bottom: .38rem; }
input:not([type=submit]) {
  width: 100%; min-width: 0; min-height: 3rem; padding: .65rem .85rem;
  border: 1px solid #bac5de; border-radius: .6rem; font: inherit; color: var(--ink); background: #fcfdff;
}
button, input[type=submit] {
  min-height: 3rem; padding: .65rem 1.25rem; border: 0; border-radius: .6rem;
  background: var(--action); color: white; font: inherit; font-weight: 700; cursor: pointer;
}
button:hover, input[type=submit]:hover { filter: brightness(.91); }
#loginform input[type=submit] { width: 100%; margin-top: .3rem; }
.reset-link { display: inline-block; font-weight: 650; font-size: .9rem; }
.library { width: min(72rem, calc(100% - 3rem)); margin: 2rem auto 4rem; }
.library-heading {
  padding: clamp(1.5rem, 5vw, 3.5rem);
  border-radius: 1.25rem;
  color: #fff;
  background: radial-gradient(ellipse at top right, #552899, transparent 70%), linear-gradient(105deg, #152341, #252563);
}
.search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .4rem .65rem; max-width: 38rem; margin: 1.75rem 0; }
.search label { grid-column: 1 / -1; }
.refs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: .9rem; list-style: none; padding: 0; margin: 1rem 0 1.5rem; }
.refs a { display: block; height: 100%; padding: 1rem 1.15rem; color: var(--ink); font-weight: 650; text-decoration: none; }
.refs li, .library article, .library > p { border: 1px solid var(--line); border-radius: .9rem; background: #fff; }
.refs li:hover { border-color: var(--violet); }
.library article, .library > p { max-width: 50rem; padding: clamp(1rem, 3vw, 2rem); }
.library > a + h1 { margin: 1.25rem 0; }
.library article > :first-child { margin-top: 0; }
.library article > :last-child { margin-bottom: 0; }
:focus-visible { outline: 3px solid #2661df; outline-offset: 3px; }
@media (max-width: 700px) {
  .signin { width: calc(100% - 2rem); grid-template-columns: 1fr; margin: 1.25rem auto 2.5rem; }
  .brand-panel { min-height: 9rem; }
  .brand-panel img { width: 5.75rem; }
  .brand-orbit { width: 10rem; }
  .login-panel { padding: 1.6rem; }
  .library { width: calc(100% - 2rem); margin-top: 1rem; }
}

.theme-toggle { min-height: 2.25rem; padding: .35rem .75rem; border: 1px solid var(--line); background: transparent; color: var(--ink); font-size: .875rem; }
.theme-toggle:hover { background: #e9eefb; }
[data-theme="dark"] { color-scheme: dark; --ink: #f0f3ff; --muted: #b7c2df; --line: #354267; --blue: #9bc5ff; --violet: #bd91ff; }
[data-theme="dark"] body { background: #0d1428; }
[data-theme="dark"] .login-view {
  background: radial-gradient(ellipse at 16% 24%, #162948, transparent 48%),
              radial-gradient(ellipse at 93% 95%, #2a184b, transparent 52%), #0d1428;
}
[data-theme="dark"] .top,
[data-theme="dark"] .signin,
[data-theme="dark"] .refs li,
[data-theme="dark"] .library article,
[data-theme="dark"] .library > p { background: #161f38; }
.brand .logo-dark { display: none; }
[data-theme="dark"] .brand .logo-dark { display: block; }
[data-theme="dark"] .brand .logo-light { display: none; }
[data-theme="dark"] input:not([type=submit]) { background: #10182c; border-color: #56668f; }
[data-theme="dark"] .theme-toggle:hover { background: #273354; }
[data-theme="dark"] :focus-visible { outline-color: #9bc5ff; }


.partner-panel {
  width: min(67rem, calc(100% - 3rem));
  margin: 0 auto 3rem;
  padding: 1.15rem 1.35rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: #fff;
}
.partner-panel h2 { margin: 0; font-size: 1.16rem; }
.partner-panel p { margin: .4rem 0 .8rem; color: var(--muted); font-size: .91rem; }
.partner-panel ul { display: flex; flex-wrap: wrap; gap: .55rem; margin: 0; padding: 0; list-style: none; }
.partner-panel a { display: block; border: 1px solid var(--line); border-radius: .55rem; padding: .45rem .65rem; }
[data-theme="dark"] .partner-panel { background: #161f38; }
@media (max-width: 700px) { .partner-panel { width: calc(100% - 2rem); } }
