.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 140px);
  padding: 40px 20px;
  background: radial-gradient(circle at center, rgba(0, 142, 255, 0.03) 0%, transparent 70%);
}

.auth-box {
  width: 100%;
  max-width: 420px;
  background: #050505;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 40px;
  box-shadow:
    0 4px 24px -1px rgba(0, 0, 0, 0.2),
    0 0 1px 0 rgba(255, 255, 255, 0.1) inset;
  position: relative;
  overflow: hidden;
  animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-primary);
  margin-top: 0;
}

.auth-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 0;
}

.auth-form .form-group {
  margin-bottom: 20px;
  position: relative;
}

.auth-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.3s;
}

.auth-form input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 4px rgba(0, 142, 255, 0.1);
}

.auth-form input:focus + label {
  color: var(--accent);
}

.auth-form .form-hint {
  margin: 8px 2px 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 7px;
  transition: color 0.2s ease;
}

.auth-form .form-hint::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
  opacity: 0.55;
}

.auth-form .form-hint.is-ok {
  color: #2ec27e;
}

.auth-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 22px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0, 142, 255, 0.07);
  border: 1px solid rgba(0, 142, 255, 0.22);
}

.auth-note svg {
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--accent);
}

.auth-note p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.auth-footer a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.auth-form input:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.auth-form input.invalid {
  border-color: rgba(239, 68, 68, 0.6);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.08);
  animation: auth-shake 360ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes auth-shake {
  10%,
  90% {
    transform: translate3d(-1px, 0, 0);
  }
  20%,
  80% {
    transform: translate3d(2px, 0, 0);
  }
  30%,
  50%,
  70% {
    transform: translate3d(-4px, 0, 0);
  }
  40%,
  60% {
    transform: translate3d(4px, 0, 0);
  }
}

.form-group.checkbox-group {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary);
  user-select: none;
  width: 100%;
}

.checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-content: center;
}

.checkbox-label input[type="checkbox"]::before {
  content: "";
  width: 10px;
  height: 10px;
  transform: scale(0) rotate(15deg);
  transition: 120ms transform ease-in-out;
  box-shadow: inset 1em 1em white;
  transform-origin: center;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.checkbox-label input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox-label input[type="checkbox"]:checked::before {
  transform: scale(1) rotate(15deg);
}

.link-privacy {
  color: var(--accent);
  text-decoration: none;
  transition: all 0.2s;
  font-weight: 500;
  position: relative;
}

.link-privacy::after {
  content: "";
  position: absolute;
  width: 100%;
  transform: scaleX(0);
  height: 1px;
  bottom: -2px;
  left: 0;
  background-color: var(--accent);
  transform-origin: bottom right;
  transition: transform 0.25s ease-out;
}

.link-privacy:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

.link-privacy:hover {
  color: var(--accent-hover);
}

.recaptcha-wrapper {
  display: flex;
  justify-content: center;
}

.auth-footer-text {
  margin-bottom: 10px;
}

.forgot-password-link {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.auth-footer a.auth-cancel-link,
a.auth-cancel-link {
  color: #c0392b;
  font-size: 0.85rem;
  transition: color 0.15s ease;
}

.auth-footer a.auth-cancel-link:hover,
a.auth-cancel-link:hover {
  color: #e57368;
}

.auth-2fa-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-box--2fa .auth-header h2 {
  font-size: 1.35rem;
}

.auth-box--2fa .auth-2fa-form .btn-block {
  min-height: 44px;
  padding: 10px 24px;
  font-size: 0.9rem;
  border-radius: 12px;
}

.auth-2fa-form .admin-input--code {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
  font-size: 1.3rem;
}

.auth-2fa-form .recaptcha-wrapper {
  display: flex;
  justify-content: center;
}

.otp-input {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.otp-input__digit {
  width: 48px;
  height: 58px;
  text-align: center;
  font-size: 1.6rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f4f4f5;
  border-radius: 10px;
  padding: 0;
  outline: none;
  transition:
    border-color 0.18s ease,
    background 0.18s ease;
  caret-color: #60a5fa;
}

.otp-input__digit::placeholder {
  color: #3f3f46;
}

.otp-input__digit:focus {
  border-color: rgba(96, 165, 250, 0.6);
  background: rgba(96, 165, 250, 0.06);
}

.otp-input__digit.is-filled {
  border-color: rgba(96, 165, 250, 0.35);
}
.otp-input__digit.is-error {
  border-color: rgba(239, 68, 68, 0.55);
  background: rgba(239, 68, 68, 0.06);
}

.auth-box--2fa .otp-input__digit {
  caret-color: #60a5fa;
}
.auth-box--2fa .otp-input__digit:focus {
  border-color: rgba(96, 165, 250, 0.75);
  background: rgba(96, 165, 250, 0.12);
}
.auth-box--2fa .otp-input__digit.is-filled {
  border-color: rgba(96, 165, 250, 0.5);
  background: rgba(96, 165, 250, 0.08);
}

@media (max-width: 420px) {
  .otp-input {
    gap: 6px;
  }
  .otp-input__digit {
    width: 40px;
    height: 50px;
    font-size: 1.3rem;
  }
}

.auth-2fa-link {
  display: block;
  margin-top: 14px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  text-align: center;
  width: 100%;
  padding: 6px 0;
  font-family: inherit;
  text-decoration: none;
}

.auth-2fa-link:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.auth-2fa-link--muted {
  color: #71717a;
  font-size: 0.8rem;
  margin-top: 4px;
  margin-bottom: 0;
}
.auth-2fa-link--muted:hover {
  color: #fca5a5;
}

.auth-recover-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-2fa-hint {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: 0 0 6px;
  line-height: 1.4;
}

.auth-backup-input {
  width: 100%;
  box-sizing: border-box;
  height: auto;
  min-width: 0;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  transition: all 0.3s ease;
}

.auth-backup-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
  letter-spacing: 0.12em;
}

.auth-backup-input:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.auth-backup-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 4px rgba(0, 142, 255, 0.1);
}
