/* ------------------------------------------------------------------ */
/* Login                                                               */
/* ------------------------------------------------------------------ */

.login-body {
  min-height: 100dvh;
  display: grid;
  place-items: center;
}

.login-wrap {
  width: 100%;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px 20px;
}

.login-card {
  width: min(100%, 382px);
  padding: 40px 34px 28px;
  border-radius: 30px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  margin-bottom: 22px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow:
    0 10px 30px rgba(var(--accent-rgb), 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.brand-mark::after {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.92);
  border-right-color: transparent;
  transform: rotate(-25deg);
}

.login-card h1 {
  margin: 0 0 30px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.2;
  background: linear-gradient(120deg, #fff 20%, rgba(255, 255, 255, 0.62));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-card .field {
  margin-bottom: 16px;
}
.login-card .field input {
  height: 52px;
  background: rgba(255, 255, 255, 0.055);
}
.login-card .btn.primary {
  width: 100%;
  height: 52px;
  margin-top: 10px;
  font-size: 15px;
  letter-spacing: 0.18em;
}

.form-msg {
  min-height: 22px;
  margin: 14px 0 0;
  color: #ffb7c7;
  font-size: 13px;
  text-align: center;
  line-height: 1.5;
}
.form-msg.ok {
  color: var(--accent-2);
}

.login-foot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 18px;
  text-align: center;
  color: rgba(255, 255, 255, 0.22);
  font-size: 11px;
  letter-spacing: 0.24em;
  pointer-events: none;
}

/* ------------------------------------------------------------------ */
/* Captcha                                                             */
/* ------------------------------------------------------------------ */

.captcha-card {
  width: min(100%, 430px);
  max-height: 94dvh;
  overflow: auto;
  padding: 20px 20px 22px;
  border-radius: 24px;
}

.cap-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.cap-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.1em;
}
.cap-head .cap-step {
  margin-left: auto;
  margin-right: 8px;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.cap-stage {
  position: relative;
}

.puzzle {
  position: relative;
  width: 100%;
  aspect-ratio: 360 / 200;
  border-radius: 14px;
  overflow: hidden;
  background: #101018;
  user-select: none;
  touch-action: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.puzzle .cap-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}
.puzzle .cap-piece {
  position: absolute;
  pointer-events: none;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.45));
  will-change: left;
}

.slider-track {
  position: relative;
  height: 46px;
  margin-top: 12px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  touch-action: none;
}
.slider-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.18), rgba(var(--accent-rgb), 0.42));
  transition: width 0.04s linear;
}
.slider-handle {
  position: absolute;
  left: 4px;
  top: 4px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px rgba(var(--accent-rgb), 0.4);
  cursor: grab;
  touch-action: none;
}
.slider-handle:active {
  cursor: grabbing;
}
.slider-handle svg {
  width: 18px;
  height: 18px;
  color: #fff;
}

.cap-hint {
  margin: 10px 2px 0;
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-align: center;
}

.click-wrap {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  touch-action: none;
  cursor: crosshair;
  background: #eef2f8;
}
.click-wrap img {
  width: 100%;
  display: block;
  pointer-events: none;
}
.click-mark {
  position: absolute;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  animation: markIn 0.14s ease both;
}
@keyframes markIn {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
}

.cap-order {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.cap-order b {
  display: inline-flex;
  gap: 6px;
  font-weight: 500;
}
.cap-order .order-char {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 16px;
}
.cap-order .order-char.done {
  background: rgba(var(--accent-rgb), 0.28);
  border-color: rgba(var(--accent-rgb), 0.6);
  color: #fff;
}

.cap-error {
  min-height: 18px;
  margin: 10px 2px 0;
  color: #ffb0c2;
  font-size: 12px;
  text-align: center;
}

.cap-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(10, 10, 16, 0.45);
  border-radius: 14px;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 2;
}

/* Small screens */
@media (max-width: 420px) {
  .login-card {
    padding: 32px 24px 24px;
    border-radius: 26px;
  }
  .login-card h1 {
    font-size: 26px;
  }
  .captcha-card {
    padding: 16px;
  }
}
