:root {
  --black: #030507;
  --charcoal: #0a0d12;
  --charcoal-2: #111722;
  --navy: #071426;
  --ink: #e9eef5;
  --muted: #9aa5b4;
  --silver: #c7d0dc;
  --silver-soft: rgba(213, 221, 232, 0.14);
  --gold: #d5bd74;
  --gold-soft: rgba(213, 189, 116, 0.2);
  --line: rgba(218, 226, 237, 0.14);
  --danger: #f07f7b;
  --danger-soft: rgba(240, 127, 123, 0.12);
  --field: rgba(255, 255, 255, 0.055);
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--black);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  background:
    radial-gradient(circle at 72% 16%, rgba(216, 193, 123, 0.12), transparent 24rem),
    linear-gradient(135deg, #020305 0%, #09101a 58%, #05070b 100%);
}

button,
input {
  font: inherit;
}

a {
  color: var(--silver);
  text-decoration: none;
  transition: color 180ms ease;
}

a:hover {
  color: var(--gold);
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
  min-height: 100vh;
  isolation: isolate;
}

.brand-panel {
  position: relative;
  display: flex;
  min-height: 100vh;
  overflow: hidden;
  padding: clamp(2rem, 4vw, 4.5rem);
  background: #05080d;
}

.brand-panel::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  background:
    linear-gradient(90deg, rgba(3, 5, 7, 0.18), rgba(3, 5, 7, 0.56)),
    radial-gradient(circle at 20% 82%, rgba(216, 193, 123, 0.13), transparent 19rem);
}

.brand-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.76), transparent 90%);
}

.brand-art {
  position: absolute;
  inset: -7% -12% -10% -10%;
  width: 124%;
  height: 118%;
  object-fit: cover;
  opacity: 0.9;
  transform: scale(1.02);
  animation: drift 18s ease-in-out infinite alternate;
}

.brand-content {
  position: relative;
  z-index: 3;
  align-self: flex-end;
  width: min(620px, 100%);
  padding-bottom: clamp(1rem, 4vw, 3rem);
  animation: rise-in 650ms ease-out both;
}

.mark {
  display: grid;
  width: 76px;
  height: 76px;
  margin-bottom: 1.7rem;
  place-items: center;
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.02)),
    rgba(8, 14, 22, 0.76);
  border: 1px solid rgba(229, 235, 244, 0.22);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 18px 46px rgba(0, 0, 0, 0.38);
}

.mark span {
  position: relative;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(216, 193, 123, 0.58);
  border-radius: 50%;
  color: #f5f0df;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.mark span::before,
.mark span::after {
  position: absolute;
  top: 50%;
  width: 28px;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(216, 193, 123, 0.84), transparent);
}

.mark span::before {
  right: 100%;
}

.mark span::after {
  left: 100%;
}

.mark.compact {
  width: 46px;
  height: 46px;
  margin: 0;
}

.mark.compact span {
  width: 30px;
  height: 30px;
  font-size: 0.68rem;
}

.eyebrow {
  margin: 0 0 0.78rem;
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 12ch;
  margin-bottom: 0.95rem;
  font-size: clamp(3.1rem, 7vw, 6.9rem);
  font-weight: 650;
  line-height: 0.92;
  text-wrap: balance;
}

.brand-subtitle {
  margin-bottom: 1.35rem;
  color: rgba(237, 242, 248, 0.86);
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  font-weight: 500;
}

.domain-chip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 0.85rem;
  color: rgba(238, 243, 249, 0.84);
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid rgba(233, 238, 245, 0.16);
  border-radius: 8px;
  backdrop-filter: blur(16px);
}

.telemetry-strip {
  position: absolute;
  right: clamp(2rem, 4vw, 4rem);
  bottom: clamp(2rem, 5vw, 5rem);
  z-index: 4;
  display: grid;
  width: 118px;
  gap: 0.52rem;
}

.telemetry-strip span {
  display: block;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--silver), var(--gold));
  opacity: 0.82;
  animation: scan 2200ms ease-in-out infinite;
}

.telemetry-strip span:nth-child(2) {
  width: 76%;
  margin-left: auto;
  animation-delay: 280ms;
}

.telemetry-strip span:nth-child(3) {
  width: 54%;
  margin-left: auto;
  animation-delay: 560ms;
}

.form-panel {
  position: relative;
  display: grid;
  min-height: 100vh;
  padding: clamp(1.25rem, 4vw, 4rem);
  place-items: center;
}

.form-panel::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 34%),
    radial-gradient(circle at 76% 25%, rgba(158, 179, 204, 0.12), transparent 20rem);
  pointer-events: none;
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
  padding: clamp(1.45rem, 4vw, 2.45rem);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.035)),
    rgba(9, 13, 19, 0.76);
  border: 1px solid rgba(233, 238, 245, 0.16);
  border-radius: 8px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(22px);
  animation: card-in 520ms ease-out 130ms both;
}

.login-card::before {
  position: absolute;
  inset: 0;
  content: "";
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(216, 193, 123, 0.26), transparent 28%, rgba(222, 231, 242, 0.08) 68%, transparent);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  padding: 1px;
}

.mobile-brand {
  display: none;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.65rem;
}

.mobile-brand p {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
}

.mobile-brand span {
  color: var(--muted);
  font-size: 0.86rem;
}

.card-heading {
  margin-bottom: 1.5rem;
}

.card-heading h2 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 2.45rem);
  font-weight: 650;
}

.alert {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.72rem;
  align-items: center;
  margin-bottom: 1.25rem;
  padding: 0.95rem 1rem;
  color: #ffd8d6;
  background: var(--danger-soft);
  border: 1px solid rgba(240, 127, 123, 0.28);
  border-radius: 8px;
}

.alert p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
}

.alert-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(240, 127, 123, 0.12);
}

.login-form {
  display: grid;
  gap: 1rem;
}

.field {
  position: relative;
  display: grid;
  gap: 0.48rem;
  color: var(--silver);
  font-size: 0.88rem;
  font-weight: 650;
}

.field input {
  width: 100%;
  height: 54px;
  padding: 0 1rem;
  color: var(--ink);
  background: var(--field);
  border: 1px solid rgba(220, 229, 240, 0.15);
  border-radius: 8px;
  outline: none;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.field input::placeholder {
  color: rgba(194, 204, 216, 0.48);
}

.field input:hover {
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(220, 229, 240, 0.24);
}

.field input:focus {
  background: rgba(255, 255, 255, 0.082);
  border-color: rgba(216, 193, 123, 0.62);
  box-shadow: 0 0 0 4px rgba(216, 193, 123, 0.11);
}

.password-field input {
  padding-right: 3.35rem;
}

.password-toggle {
  position: absolute;
  right: 0.72rem;
  bottom: 8px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: rgba(228, 235, 244, 0.76);
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 8px;
  transition: color 160ms ease, background 160ms ease;
}

.password-toggle:hover,
.password-toggle:focus-visible,
.password-toggle.is-visible {
  color: var(--gold);
  background: rgba(216, 193, 123, 0.1);
  outline: none;
}

.password-toggle svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.2rem 0 0.55rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.remember {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  cursor: pointer;
}

.remember input {
  width: 17px;
  height: 17px;
  accent-color: var(--gold);
}

.submit-button {
  position: relative;
  display: inline-grid;
  min-height: 54px;
  place-items: center;
  overflow: hidden;
  color: #0a0d12;
  font-weight: 800;
  cursor: pointer;
  background: linear-gradient(135deg, #f5f0df, #d5bd74 48%, #a58c50);
  border: 0;
  border-radius: 8px;
  box-shadow: 0 18px 46px rgba(153, 125, 56, 0.23);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.submit-button::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.42) 42%, transparent 68%);
  transform: translateX(-120%);
}

.submit-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 24px 58px rgba(153, 125, 56, 0.28);
}

.submit-button:hover::before {
  animation: button-sheen 950ms ease;
}

.submit-button:active {
  transform: translateY(0);
  filter: brightness(0.97);
}

.login-form.is-submitting .submit-button {
  cursor: wait;
  opacity: 0.84;
}

footer {
  position: absolute;
  right: clamp(1.25rem, 4vw, 4rem);
  bottom: 1.2rem;
  z-index: 1;
  color: rgba(199, 208, 220, 0.58);
  font-size: 0.84rem;
}

.system-error {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 1.5rem;
}

.system-error main {
  width: min(100%, 460px);
  padding: 2rem;
  background: rgba(9, 13, 19, 0.84);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.system-error h1 {
  max-width: 12ch;
  margin-bottom: 1rem;
  font-size: clamp(2rem, 8vw, 3.5rem);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

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

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }

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

@keyframes drift {
  from {
    transform: scale(1.02) translate3d(0, 0, 0);
  }

  to {
    transform: scale(1.045) translate3d(-1.2%, 1%, 0);
  }
}

@keyframes scan {
  0%,
  100% {
    opacity: 0.3;
    transform: translateX(0);
  }

  50% {
    opacity: 0.9;
    transform: translateX(10px);
  }
}

@keyframes button-sheen {
  to {
    transform: translateX(120%);
  }
}

@media (max-width: 1040px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    min-height: 34vh;
  }

  .brand-content {
    align-self: center;
    padding: 0;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(2.6rem, 8vw, 4.8rem);
  }

  .form-panel {
    min-height: 66vh;
  }
}

@media (max-width: 720px) {
  body {
    background:
      radial-gradient(circle at 50% 0%, rgba(216, 193, 123, 0.14), transparent 18rem),
      linear-gradient(180deg, #05080d, #030507);
  }

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

  .brand-panel {
    display: none;
  }

  .form-panel {
    min-height: 100vh;
    padding: 1rem;
  }

  .login-card {
    padding: 1.25rem;
  }

  .mobile-brand {
    display: flex;
  }

  .card-heading {
    margin-bottom: 1.25rem;
  }

  .form-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.75rem;
  }

  footer {
    position: static;
    margin-top: 1rem;
    text-align: center;
  }
}

@media (max-width: 380px) {
  .field input,
  .submit-button {
    min-height: 50px;
  }

  .login-card {
    padding: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
