:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --ice: #dceaf5;
  --muted: #9fb3c4;
  --line: rgba(185, 211, 230, 0.24);
  --cyan: #66d7ed;
  --navy: #071729;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100svh;
  overflow-x: hidden;
  background: #07111c;
  color: var(--ice);
}

button,
input {
  font: inherit;
}

.scene,
.atmosphere {
  position: fixed;
  inset: 0;
}

.scene {
  z-index: -3;
  background-image: url("/assets/login-background.webp");
  background-position: center center;
  background-size: cover;
  transform: scale(1.01);
}

.atmosphere {
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(3, 11, 21, 0.22) 0%, rgba(3, 11, 21, 0.14) 42%, rgba(3, 10, 20, 0.68) 75%, rgba(3, 9, 17, 0.88) 100%),
    linear-gradient(180deg, rgba(4, 12, 24, 0.12) 0%, rgba(4, 12, 24, 0.08) 52%, rgba(2, 8, 15, 0.54) 100%);
}

.brand {
  position: fixed;
  top: clamp(24px, 4vw, 52px);
  left: clamp(24px, 5vw, 80px);
  z-index: 2;
  width: clamp(250px, 27vw, 390px);
}

.brand-logo {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.42));
}

.login-layout {
  display: grid;
  min-height: 100svh;
  grid-template-columns: minmax(280px, 1fr) minmax(190px, 280px) minmax(360px, 500px);
  align-items: center;
  gap: clamp(32px, 4vw, 76px);
  padding: clamp(110px, 12vh, 150px) clamp(24px, 4vw, 72px) clamp(88px, 10vh, 120px);
}

.hero-copy {
  align-self: end;
  max-width: 660px;
  padding-bottom: clamp(34px, 7vh, 96px);
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.58);
}

.eyebrow,
.card-kicker {
  margin: 0 0 18px;
  color: #8edbeb;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.24em;
}

.hero-copy h1 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(38px, 5vw, 72px);
  font-weight: 350;
  letter-spacing: -0.04em;
  line-height: 0.98;
}

.hero-text {
  max-width: 520px;
  margin: 24px 0 0;
  color: rgba(226, 238, 247, 0.78);
  font-size: clamp(15px, 1.4vw, 19px);
  line-height: 1.6;
}

.mobile-app-preview {
  display: flex;
  min-width: 0;
  align-items: center;
  align-self: center;
  flex-direction: column;
  gap: 18px;
  text-align: center;
}

.app-preview-copy {
  max-width: 270px;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.68);
}

.app-kicker {
  margin: 0 0 8px;
  color: #8edbeb;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.19em;
}

.app-preview-copy h2 {
  margin: 0;
  color: #f1f8fd;
  font-size: clamp(20px, 1.8vw, 27px);
  font-weight: 440;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.app-preview-copy > p:last-child {
  margin: 10px 0 0;
  color: rgba(211, 229, 240, 0.72);
  font-size: 12px;
  line-height: 1.45;
}

.phone-visual {
  position: relative;
  display: flex;
  width: 100%;
  justify-content: center;
}

.phone-visual img {
  display: block;
  width: auto;
  height: clamp(300px, 52svh, 560px);
  max-width: 100%;
  border-radius: 14% / 7%;
  filter: drop-shadow(0 34px 44px rgba(0, 0, 0, 0.48));
}

.login-card {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(191, 216, 234, 0.22);
  border-radius: 24px;
  background: linear-gradient(155deg, rgba(10, 30, 50, 0.86), rgba(4, 15, 28, 0.76));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  padding: clamp(30px, 4vw, 48px);
  backdrop-filter: blur(24px) saturate(120%);
}

.card-accent {
  position: absolute;
  top: 0;
  left: 48px;
  width: 72px;
  height: 2px;
  background: linear-gradient(90deg, #55d4ed, rgba(85, 212, 237, 0));
  box-shadow: 0 0 18px rgba(85, 212, 237, 0.72);
}

.login-card h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 43px);
  font-weight: 420;
  letter-spacing: -0.04em;
}

.card-intro {
  margin: 10px 0 32px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.account-id {
  display: grid;
  gap: 4px;
  margin: -16px 0 28px;
  border-left: 2px solid rgba(102, 215, 237, 0.72);
  color: #dceaf5;
  padding-left: 12px;
  font-size: 13px;
}

.account-id span {
  color: var(--muted);
  font-size: 12px;
}

.field-group + .field-group {
  margin-top: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #bfd0dd;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.06em;
}

input {
  width: 100%;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: rgba(3, 13, 25, 0.62);
  color: #f4fbff;
  padding: 0 15px;
  caret-color: var(--cyan);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:hover {
  border-color: rgba(191, 216, 234, 0.4);
}

input:focus {
  border-color: rgba(102, 215, 237, 0.92);
  background: rgba(3, 14, 27, 0.8);
  box-shadow: 0 0 0 3px rgba(65, 195, 222, 0.14);
}

.password-field {
  position: relative;
}

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

.password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  display: grid;
  width: 39px;
  height: 39px;
  transform: translateY(-50%);
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #91aabd;
  cursor: pointer;
}

.password-toggle:hover {
  background: rgba(133, 194, 218, 0.1);
  color: #d5edf7;
}

.password-toggle:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 1px;
}

.password-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.password-toggle svg[hidden] {
  display: none;
}

.form-error {
  min-height: 20px;
  margin: 14px 0 2px;
  color: #ffb5b5;
  font-size: 13px;
  line-height: 1.45;
}

.form-error:empty {
  visibility: hidden;
}

.form-help {
  margin: 8px 0 0;
  color: rgba(171, 194, 209, 0.82);
  font-size: 11px;
  line-height: 1.45;
}

.submit-button {
  display: flex;
  width: 100%;
  height: 54px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
  border: 1px solid rgba(133, 225, 242, 0.45);
  border-radius: 12px;
  background: linear-gradient(135deg, #d9edf5 0%, #8bd8e8 100%);
  box-shadow: 0 14px 38px rgba(19, 128, 156, 0.24);
  color: #072036;
  cursor: pointer;
  font-weight: 750;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.submit-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 44px rgba(19, 128, 156, 0.34);
  filter: brightness(1.05);
}

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

.submit-button:focus-visible {
  outline: 2px solid #e9fbff;
  outline-offset: 3px;
}

.submit-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.security-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  color: rgba(171, 194, 209, 0.74);
  font-size: 11px;
}

.security-note svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.secondary-actions {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 18px;
}

.secondary-actions form {
  margin: 0;
}

.secondary-link {
  display: block;
  border: 0;
  background: transparent;
  color: #a8ddeb;
  cursor: pointer;
  font-size: 12px;
  text-align: center;
  text-decoration: none;
}

.secondary-link:hover,
.secondary-link:focus-visible {
  color: #e7f7ff;
  text-decoration: underline;
}

footer {
  position: fixed;
  right: clamp(24px, 5vw, 80px);
  bottom: clamp(20px, 3vw, 38px);
  left: clamp(24px, 5vw, 80px);
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(201, 219, 232, 0.56);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.15em;
}

.footer-separator {
  width: 22px;
  height: 1px;
  background: rgba(201, 219, 232, 0.36);
}

@media (max-width: 1180px) {
  .atmosphere {
    background: linear-gradient(180deg, rgba(3, 11, 21, 0.2), rgba(3, 10, 20, 0.78));
  }

  .login-layout {
    grid-template-columns: minmax(190px, 260px) minmax(360px, 500px);
    justify-content: center;
    justify-items: center;
    padding-top: 124px;
  }

  .hero-copy {
    display: none;
  }

  .phone-visual img {
    height: clamp(300px, 48svh, 460px);
  }

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

@media (max-width: 800px) {
  .login-layout {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 28px;
    padding: 116px 20px 46px;
  }

  .mobile-app-preview {
    display: grid;
    width: min(100%, 480px);
    grid-template-columns: minmax(0, 1fr) minmax(118px, 154px);
    gap: 20px;
    align-items: center;
    border: 1px solid rgba(191, 216, 234, 0.2);
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(10, 30, 50, 0.76), rgba(4, 15, 28, 0.68));
    box-shadow: 0 22px 58px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    padding: 20px 20px 0;
    text-align: left;
    backdrop-filter: blur(20px) saturate(120%);
  }

  .app-preview-copy {
    align-self: center;
    padding-bottom: 20px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.48);
  }

  .app-preview-copy h2 {
    font-size: clamp(21px, 5vw, 27px);
  }

  .phone-visual {
    align-self: end;
    overflow: hidden;
    max-height: 250px;
  }

  .phone-visual img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 24px 28px rgba(0, 0, 0, 0.46));
  }

  footer {
    position: relative;
    right: auto;
    bottom: auto;
    left: auto;
    width: calc(100% - 40px);
    margin: 0 20px 22px;
  }
}

@media (max-width: 520px) {
  .scene {
    background-position: 42% center;
  }

  .brand {
    top: 20px;
    left: 20px;
    width: min(72vw, 310px);
  }

  .login-layout {
    align-items: start;
    padding: 88px 16px 38px;
  }

  .mobile-app-preview {
    grid-template-columns: minmax(0, 1fr) 116px;
    gap: 14px;
    border-radius: 19px;
    padding: 18px 16px 0 18px;
  }

  .app-preview-copy {
    padding-bottom: 18px;
  }

  .app-preview-copy > p:last-child {
    font-size: 11px;
  }

  .phone-visual {
    max-height: 214px;
  }

  .login-card {
    border-radius: 19px;
    padding: 28px 22px;
  }

  footer {
    width: calc(100% - 32px);
    margin: 0 16px 18px;
    font-size: 9px;
  }
}

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