* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html, body {
  margin: 0;
  min-height: 100%;
  color: #f8fafc;
  font-family: "Instrument Sans", system-ui, sans-serif;
  background: #161616;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
}

.login-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: transparent;
  padding:
    max(20px, env(safe-area-inset-top, 0px))
    max(16px, env(safe-area-inset-right, 0px))
    max(48px, calc(env(safe-area-inset-bottom, 0px) + 36px))
    max(16px, env(safe-area-inset-left, 0px));
}

.login-bg-video,
.login-bg-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.login-bg-video {
  object-fit: cover;
  z-index: 0;
  background: #161616 url("/login-bg-poster.jpg") center / cover no-repeat;
}

.login-bg-overlay {
  z-index: 1;
  background:
    linear-gradient(#0a0c108c 0%, #101216b8 48%, #080a0ed1 100%),
    radial-gradient(120% 80% at 50% 20%, #87ceeb1f, #0000 55%);
}

.login-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 380px;
  margin: auto;
  padding: 24px 20px 20px;
  background: #121418b8;
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  border: 1px solid #ffffff1f;
  border-radius: 20px;
  box-shadow: 0 24px 60px #00000066;
}

.brand {
  font-family: Sora, sans-serif;
  font-size: clamp(22px, 6vw, 28px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #f8fafc;
}

.sub {
  margin: 4px 0 18px;
  color: #a8b3c4;
  font-size: 14px;
}

.lbl {
  display: block;
  margin: 12px 0 6px;
  color: #dbe5f3;
  font-size: 13px;
  font-weight: 500;
}

.form-control {
  width: 100%;
  height: 48px;
  padding: 10px 12px;
  font-size: 16px;
  line-height: 1.2;
  color: #f8fafc;
  background: #0b0e14cc;
  border: 1px solid #ffffff24;
  border-radius: 10px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.form-control::placeholder {
  color: #7d8a9c;
}

.form-control:focus {
  border-color: #87ceeb;
  box-shadow: 0 0 0 3px #87ceeb33;
}

.btn {
  width: 100%;
  min-height: 48px;
  margin-top: 18px;
  padding: 12px 16px;
  font-family: Sora, sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #0b1220;
  background: linear-gradient(#87ceeb 0%, #5eb0d4 100%);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  filter: brightness(1.05);
}

.btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.err {
  color: #ff8d8d;
  font-weight: 600;
  font-size: 13px;
  margin: 12px 0 0;
  text-align: center;
}

@media (max-height: 560px) {
  .login-wrap {
    align-items: flex-start;
  }
  .login-card {
    padding: 16px 16px 14px;
  }
  .sub {
    margin-bottom: 10px;
  }
  .btn {
    margin-top: 12px;
  }
}

.copy {
  position: fixed;
  z-index: 3;
  right: max(20px, env(safe-area-inset-right, 0px));
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  margin: 0;
  color: #c8c8c8;
  font-family: "Instrument Sans", Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.01em;
  pointer-events: none;
  white-space: nowrap;
}

@media (max-width: 380px) {
  .login-card {
    border-radius: 16px;
    padding: 20px 14px 16px;
  }
  .copy {
    font-size: 12px;
    right: 12px;
  }
}
