@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/fonts/plus-jakarta-sans.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #202630;
  --muted: #505a64;
  --accent: #90516a;
  --button: #253646;
  --paper: #faf8f6;
  --line: #d6d8da;
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  letter-spacing: normal;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, p { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.login-shell { min-height: 100svh; }

.login-page {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 1.25rem;
  overflow: hidden;
  padding: clamp(1.5rem, 4vw, 4.75rem);
  background: #243746;
}

.login-backdrop,
.login-page::before {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.login-backdrop {
  z-index: -2;
  object-fit: cover;
  object-position: center 69%;
  filter: brightness(1.18);
}

.login-page::before {
  z-index: -1;
  content: "";
  background: linear-gradient(180deg, #102236a0, transparent 23%, transparent 73%, #112235a0);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
}

.page-brand { justify-self: start; color: #fff; }
.page-brand .brand-mark { background: #fff; }
.page-brand .brand-period { color: #f5bece; }

.brand-mark {
  flex: none;
  width: 2.25rem;
  aspect-ratio: 1;
  background: var(--button);
  clip-path: polygon(50% 0, 61% 32%, 68% 39%, 100% 50%, 68% 61%, 61% 68%, 50% 100%, 39% 68%, 32% 61%, 0 50%, 32% 39%, 39% 32%);
}

.brand-name {
  display: block;
  font-size: 1.65rem;
  line-height: 1.15;
  font-weight: 700;
}

.brand-period { color: var(--accent); }

.brand-tagline {
  display: block;
  margin-top: .25rem;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.image-credit {
  justify-self: start;
  padding: .47rem .72rem;
  border: 1px solid #fffb;
  border-radius: 1.5rem;
  background: #172739a8;
  color: #fff;
  font-size: .75rem;
  font-weight: 600;
  text-decoration: none;
}

.image-credit:hover { background: #172739; }
.image-credit:focus-visible { outline-color: #fff; }

.login-panel {
  align-self: center;
  justify-self: end;
  width: min(100%, 28rem);
  margin-inline-end: clamp(0rem, 2vw, 2.4rem);
  padding: clamp(1.5rem, 2.9vw, 2.75rem);
  border: 1px solid #fffe;
  border-radius: 1.15rem;
  background: #faf8f6f7;
  box-shadow: 0 1.45rem 4rem #18263530;
}

.section-label {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1.15rem;
  color: var(--accent);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.lock-icon {
  position: relative;
  width: .75rem;
  height: .57rem;
  margin-top: .25rem;
  border: 1.45px solid currentColor;
  border-radius: .15rem;
}

.lock-icon::before {
  position: absolute;
  top: -.38rem;
  left: 50%;
  width: .46rem;
  height: .37rem;
  border: 1.45px solid currentColor;
  border-bottom: 0;
  border-radius: .35rem .35rem 0 0;
  transform: translateX(-50%);
  content: "";
}

h1 {
  font-size: clamp(2.35rem, 3.15vw, 3.35rem);
  font-weight: 700;
  line-height: 1.12;
}

.login-intro {
  margin-top: 1.35rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.login-form {
  display: grid;
  gap: 1.15rem;
  margin-top: 2rem;
}

.field { display: grid; gap: .45rem; }

.field label {
  font-size: .875rem;
  font-weight: 800;
}

.field input {
  width: 100%;
  min-width: 0;
  height: 3.35rem;
  padding: 0 .95rem;
  border: 1px solid var(--line);
  border-radius: .58rem;
  background: #fff;
  color: var(--ink);
  font-size: 1rem;
}

.field input::placeholder { color: #796c74; }
.field input:focus { border-color: var(--accent); }
.field input[aria-invalid="true"] { border-color: #a84960; }
.password-field { position: relative; }
.password-field input { padding-right: 3.1rem; }

.password-toggle {
  position: absolute;
  inset: .3rem .34rem .3rem auto;
  display: grid;
  width: 2.6rem;
  place-items: center;
  border: 0;
  border-radius: .35rem;
  background: transparent;
  color: var(--muted);
}

.password-toggle:hover { background: #f7eff3; color: var(--accent); }

.eye-icon {
  position: relative;
  width: .88rem;
  height: .88rem;
  border: 1.4px solid currentColor;
  border-radius: 65% 5%;
  transform: rotate(45deg);
}

.eye-icon::before {
  position: absolute;
  inset: 27%;
  border: 1.15px solid currentColor;
  border-radius: 50%;
  content: "";
}

.password-toggle[data-visible] .eye-icon::after {
  position: absolute;
  inset: -.23rem auto -.23rem 45%;
  width: 1.4px;
  background: currentColor;
  box-shadow: 1px 0 #fff;
  content: "";
}

.primary-button {
  min-height: 3.45rem;
  margin-top: .25rem;
  padding: .75rem 1.2rem;
  border: 1px solid transparent;
  border-radius: .58rem;
  background: var(--button);
  color: #fff;
  font-size: .95rem;
  font-weight: 800;
  transition: background-color .18s ease;
}

.primary-button:hover { background: #374e61; }
.primary-button:disabled { cursor: wait; opacity: .75; }

.form-error {
  padding: .75rem .85rem;
  border-radius: .45rem;
  background: #fae9ec;
  color: #812d48;
  font-size: .875rem;
  font-weight: 700;
  line-height: 1.5;
}

.login-help {
  margin-top: 1.55rem;
  color: var(--muted);
  font-size: .875rem;
  line-height: 1.65;
}

.login-help a {
  color: var(--accent);
  font-weight: 800;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
}

.portal-shell {
  display: grid;
  place-items: center;
  padding: 1rem;
  background: radial-gradient(ellipse at 30% 0%, #e0e8ec, var(--paper) 63%);
}

.portal-shell .login-content {
  width: min(100%, 32rem);
  padding: clamp(1.75rem, 5vw, 3rem);
  border: 1px solid var(--line);
  border-radius: 1.125rem;
  background: #fffc;
}

.portal-shell h1 { margin-top: 2.75rem; }

@media (max-width: 51rem) {
  .login-page {
    grid-template-rows: auto minmax(14.5rem, 1fr) auto auto;
    gap: 1rem;
    padding: 1rem;
  }
  .login-backdrop {
    top: -42%;
    height: 142%;
    object-position: 53% 58%;
  }
  .page-brand { margin: .5rem 0 0 .3rem; }
  .brand-name { font-size: 1.35rem; }
  .brand-mark { width: 1.85rem; }
  .brand-tagline { font-size: .6rem; }
  .login-panel {
    grid-row: 3;
    justify-self: center;
    margin-inline-end: 0;
  }
  .image-credit { grid-row: 4; justify-self: center; }
  .section-label { margin-bottom: .9rem; }
  .login-intro { margin-top: .95rem; }
  .login-form { margin-top: 1.45rem; gap: .95rem; }
  .login-help { margin-top: 1.2rem; }
}

@media (max-width: 23rem) {
  .login-panel { padding-inline: 1.25rem; }
  h1 { font-size: 2.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  .primary-button { transition: none; }
}
