:root {
  color-scheme: light;
}

.auth-page {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 14%, rgba(255, 255, 255, 0.92) 0 7%, transparent 31%),
    radial-gradient(circle at 88% 78%, rgba(156, 217, 255, 0.56), transparent 34%),
    linear-gradient(135deg, #dcecff 0%, #eef2ff 46%, #eadfff 100%);
  color: #17233f;
  font: 14px/1.6 Inter, ui-sans-serif, system-ui, "Microsoft YaHei", sans-serif;
}

.auth-page::before,
.auth-page::after {
  position: fixed;
  z-index: 0;
  border-radius: 999px;
  content: "";
  filter: blur(2px);
  pointer-events: none;
}

.auth-page::before {
  top: -110px;
  right: 8%;
  width: 320px;
  height: 320px;
  background: linear-gradient(145deg, rgba(102, 112, 255, 0.26), rgba(106, 213, 255, 0.14));
}

.auth-page::after {
  bottom: -170px;
  left: 5%;
  width: 390px;
  height: 390px;
  background: linear-gradient(145deg, rgba(112, 215, 255, 0.24), rgba(175, 116, 255, 0.18));
}

.auth-page #root {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  display: grid;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 40px 24px;
  place-items: center;
}

.auth-card {
  box-sizing: border-box;
  width: min(420px, 100%);
  padding: 40px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow:
    0 30px 80px rgba(62, 72, 131, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
}

.auth-mark {
  display: grid;
  width: 58px;
  height: 58px;
  border-radius: 19px;
  background: linear-gradient(135deg, #4b8cff, #7657ee);
  box-shadow: 0 14px 28px rgba(83, 92, 226, 0.28);
  color: #fff;
  font-size: 27px;
  font-weight: 800;
  place-items: center;
  transform: rotate(-3deg);
}

.auth-card h1 {
  margin: 22px 0 4px;
  color: #14203a;
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: -0.6px;
}

.auth-card > p {
  margin: 0;
  color: #72809c;
}

.auth-tabs {
  display: flex;
  gap: 4px;
  margin: 26px 0 22px;
  padding: 4px;
  border: 1px solid rgba(111, 127, 166, 0.12);
  border-radius: 13px;
  background: rgba(225, 232, 248, 0.68);
}

.auth-tabs button {
  flex: 1;
  padding: 9px 18px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #7a86a0;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.auth-tabs .active {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 5px 16px rgba(55, 68, 116, 0.12);
  color: #3156c7;
}

.auth-card label {
  display: block;
  margin: 14px 0;
  color: #4b5873;
  font-weight: 600;
}

.auth-card label[hidden] {
  display: none;
}

.auth-card input {
  box-sizing: border-box;
  width: 100%;
  margin-top: 7px;
  padding: 13px 14px;
  border: 1px solid rgba(112, 129, 164, 0.24);
  border-radius: 12px;
  outline: none;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 2px rgba(40, 52, 89, 0.04);
  color: #17233f;
  font: inherit;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.auth-card input::placeholder {
  color: #a1aac0;
}

.auth-card input:focus {
  border-color: #6687ec;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(80, 112, 230, 0.12);
}

.auth-sms-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px;
  gap: 9px;
  margin-top: 7px;
}

.auth-sms-row input {
  margin-top: 0;
}

.auth-sms-row button {
  border: 1px solid rgba(80, 112, 230, 0.24);
  border-radius: 12px;
  background: rgba(238, 242, 255, 0.92);
  color: #405ec2;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.auth-sms-row button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.auth-card .auth-message {
  min-height: 20px;
  margin: 5px 0 0;
  color: #19845b;
  font-size: 13px;
}

.auth-card .auth-error {
  min-height: 22px;
  margin: 5px 0 9px;
  color: #d84b5b;
  font-size: 13px;
}

.auth-submit {
  width: 100%;
  padding: 13px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(105deg, #408df4, #7459ee);
  box-shadow: 0 13px 25px rgba(79, 88, 218, 0.24);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.08em;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.auth-submit:hover:not(:disabled) {
  box-shadow: 0 16px 30px rgba(79, 88, 218, 0.32);
  transform: translateY(-1px);
}

.auth-submit:active:not(:disabled) {
  transform: translateY(0);
}

.auth-submit:disabled {
  cursor: wait;
  opacity: 0.55;
}

.admin-link {
  display: block;
  margin-top: 24px;
  color: #73809b;
  text-align: center;
  text-decoration: none;
  transition: color 160ms ease;
}

.admin-link:hover {
  color: #405ec2;
}

@media (max-width: 520px) {
  .auth-page #root {
    padding: 20px 16px;
  }

  .auth-card {
    padding: 30px 24px;
    border-radius: 23px;
  }
}

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