:root {
  --brand: #1520a6;
  --brand-hover: #0f1878;
  --deep: #0f1b4c;
  --text: #111315;
  --text-secondary: #1e2a44;
  --text-muted: #526a9f;
  --surface: #ffffff;
  --surface-subtle: #f7faff;
  --border: #e6eeff;
  --border-strong: #dce7ff;
  --danger: #b42318;
  --danger-surface: #fff5f4;
  color-scheme: light;
  font-family: Inter, Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--surface-subtle);
  color: var(--text);
}

button,
input {
  font: inherit;
}

.login-shell {
  background: var(--surface-subtle);
  display: grid;
  grid-template-areas:
    "surface"
    "hero";
  grid-template-rows: minmax(calc(100dvh - 148px), auto) 148px;
  min-height: 100dvh;
  overflow-x: clip;
}

.login-hero {
  animation: hero-enter 280ms ease-out both;
  background: var(--deep);
  grid-area: hero;
  min-height: 148px;
  overflow: hidden;
  position: relative;
}

.collage {
  inset: 0;
  position: absolute;
}

.collage-image {
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgb(4 12 39 / 26%);
  overflow: hidden;
  position: absolute;
}

.collage-image img {
  animation: hero-drift 24s ease-in-out infinite alternate;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.collage-image-1 {
  height: 76%;
  left: -2%;
  top: 12%;
  width: 54%;
}

.collage-image-2 {
  height: 68%;
  left: 30%;
  top: -8%;
  width: 44%;
}

.collage-image-3 {
  bottom: -12%;
  height: 72%;
  right: 13%;
  width: 42%;
}

.collage-image-4 {
  height: 74%;
  right: -8%;
  top: 8%;
  width: 38%;
}

.hero-scrim {
  background:
    linear-gradient(90deg, rgb(15 27 76 / 92%) 0%, rgb(15 27 76 / 70%) 54%, rgb(15 27 76 / 78%) 100%),
    linear-gradient(0deg, rgb(15 27 76 / 78%), rgb(15 27 76 / 34%));
  inset: 0;
  position: absolute;
}

.signal-line {
  animation: signal-pass 10s linear infinite;
  background: linear-gradient(90deg, transparent, rgb(125 211 252 / 64%), transparent);
  height: 1px;
  left: -35%;
  opacity: 0.64;
  position: absolute;
  top: 57%;
  width: 45%;
}

.hero-content {
  bottom: 18px;
  color: white;
  left: 20px;
  max-width: calc(100% - 40px);
  position: absolute;
  z-index: 1;
}

.hero-logo {
  display: none;
  height: auto;
  width: 132px;
}

.hero-meta {
  align-items: center;
  display: flex;
  font-size: 0.6875rem;
  font-weight: 700;
  gap: 10px;
  letter-spacing: 0.14em;
  line-height: 1;
}

.hero-meta strong {
  background: rgb(255 255 255 / 10%);
  border: 1px solid rgb(255 255 255 / 48%);
  border-radius: 999px;
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  padding: 5px 9px;
}

.login-hero h1 {
  font-size: 1.75rem;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin: 8px 0 0;
}

.hero-description,
.hero-benefit {
  display: none;
}

.login-surface {
  align-items: center;
  background: var(--surface);
  display: flex;
  grid-area: surface;
  justify-content: center;
  min-width: 0;
  padding: 32px 20px;
}

.login-card {
  animation: card-enter 260ms ease-out both;
  max-width: 460px;
  width: 100%;
}

.form-logo {
  height: auto;
  margin-bottom: 32px;
  width: 142px;
}

.login-heading {
  margin-bottom: 28px;
}

.login-heading > p {
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.5;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.login-heading h2 {
  color: var(--text);
  font-size: clamp(1.75rem, 5.8vw, 2rem);
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 0;
}

.auth-form {
  display: grid;
  gap: 20px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25rem;
}

.field input {
  background: var(--surface-subtle);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: var(--text);
  height: 48px;
  line-height: 1.5;
  min-width: 0;
  outline: none;
  padding: 0 14px;
  transition: border-color 160ms ease, background-color 160ms ease;
  width: 100%;
}

.field input:hover {
  border-color: var(--text-muted);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 50px;
}

.password-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  height: 44px;
  justify-content: center;
  padding: 0;
  position: absolute;
  right: 2px;
  top: 2px;
  width: 44px;
}

.password-toggle svg {
  height: 19px;
  width: 19px;
}

.sign-in-button {
  align-items: center;
  background: var(--brand);
  border: 1px solid var(--brand);
  border-radius: 10px;
  color: white;
  cursor: pointer;
  display: inline-flex;
  font-size: 0.9375rem;
  font-weight: 600;
  height: 48px;
  justify-content: center;
  padding: 0 18px;
  transition: background-color 160ms ease, border-color 160ms ease;
  width: 100%;
}

.sign-in-button:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

.sign-in-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.auth-message {
  align-items: flex-start;
  background: var(--danger-surface);
  border: 1px solid #fecdca;
  border-radius: 10px;
  color: var(--danger);
  display: flex;
  font-size: 0.875rem;
  gap: 10px;
  line-height: 1.35rem;
  padding: 12px 14px;
}

.auth-message svg {
  flex: 0 0 auto;
  height: 18px;
  margin-top: 1px;
  width: 18px;
}

.submit-status {
  height: 0;
  margin: 0;
  overflow: hidden;
  position: absolute;
  width: 0;
}

.login-footer {
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.5;
  margin: 28px 0 0;
  padding-top: 20px;
  text-align: center;
}

.login-shell :is(button, input):focus-visible {
  box-shadow: 0 0 0 2px white, 0 0 0 4px var(--brand);
  outline: none;
}

@media (min-width: 640px) {
  .login-shell {
    grid-template-areas:
      "hero"
      "surface";
    grid-template-rows: minmax(300px, 38dvh) auto;
  }

  .login-hero {
    min-height: 300px;
  }

  .collage-image-1 {
    height: 72%;
    left: 3%;
    top: 12%;
    width: 48%;
  }

  .collage-image-2 {
    height: 58%;
    left: 39%;
    top: 4%;
    width: 36%;
  }

  .collage-image-3 {
    bottom: 3%;
    height: 54%;
    right: 20%;
    width: 34%;
  }

  .collage-image-4 {
    height: 68%;
    right: 3%;
    top: 16%;
    width: 30%;
  }

  .hero-content {
    bottom: 36px;
    left: 40px;
    max-width: 520px;
  }

  .hero-logo {
    display: block;
    margin-bottom: 24px;
  }

  .login-hero h1 {
    font-size: 2.5rem;
    margin-top: 12px;
  }

  .hero-description {
    display: block;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
    margin: 12px 0 0;
  }

  .hero-benefit {
    color: rgb(255 255 255 / 76%);
    display: block;
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 5px 0 0;
  }

  .login-surface {
    min-height: 62dvh;
    padding: 48px 32px;
  }
}

@media (min-width: 1280px) {
  .login-shell {
    grid-template-areas: "hero surface";
    grid-template-columns: 56% 44%;
    grid-template-rows: 100dvh;
  }

  .login-hero {
    min-height: 100dvh;
  }

  .collage-image {
    border-radius: 16px;
  }

  .collage-image-1 {
    height: 39%;
    left: 5%;
    top: 8%;
    width: 65%;
  }

  .collage-image-2 {
    height: 32%;
    left: auto;
    right: 4%;
    top: 5%;
    width: 40%;
  }

  .collage-image-3 {
    bottom: 7%;
    height: 35%;
    left: 8%;
    right: auto;
    width: 45%;
  }

  .collage-image-4 {
    bottom: 5%;
    height: 39%;
    right: 5%;
    top: auto;
    width: 44%;
  }

  .hero-scrim {
    background:
      linear-gradient(90deg, rgb(15 27 76 / 91%) 0%, rgb(15 27 76 / 70%) 58%, rgb(15 27 76 / 52%) 100%),
      linear-gradient(0deg, rgb(15 27 76 / 78%) 0%, rgb(15 27 76 / 30%) 52%, rgb(15 27 76 / 56%) 100%);
  }

  .hero-content {
    bottom: 64px;
    left: clamp(48px, 5vw, 80px);
    max-width: 540px;
  }

  .hero-logo {
    margin-bottom: 48px;
    width: 156px;
  }

  .login-hero h1 {
    font-size: clamp(3rem, 4.1vw, 4rem);
    line-height: 1.04;
    margin-top: 18px;
  }

  .hero-description {
    font-size: 1.125rem;
    line-height: 1.55;
    margin-top: 18px;
  }

  .hero-benefit {
    font-size: 0.9375rem;
    margin-top: 8px;
    max-width: 500px;
  }

  .login-surface {
    min-height: 100dvh;
    padding: 56px clamp(48px, 5vw, 72px);
  }

  .login-card {
    max-width: 440px;
  }
}

@keyframes hero-enter {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hero-drift {
  from {
    transform: scale(1.015);
  }

  to {
    transform: scale(1.045);
  }
}

@keyframes signal-pass {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(320%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-hero,
  .login-card,
  .collage-image img,
  .signal-line {
    animation: none;
    transform: none;
  }

  .login-shell * {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
