:root {
  --auth-primary: #5b4cf0;
  --auth-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 45%, #a855f7 100%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.auth-page {
  margin: 0;
  touch-action: manipulation;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 15px;
  color: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  padding-top: calc(24px + env(safe-area-inset-top, 0));
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0));
  background:
    radial-gradient(ellipse 100% 70% at 50% -10%, rgba(99, 102, 241, 0.25), transparent 50%),
    radial-gradient(circle at 90% 20%, rgba(14, 165, 233, 0.15), transparent 35%),
    radial-gradient(circle at 10% 80%, rgba(168, 85, 247, 0.12), transparent 40%),
    linear-gradient(180deg, #eef2ff 0%, #f5f3ff 40%, #f8fafc 100%);
  background-attachment: fixed;
}

.auth-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.auth-bg span {
  position: absolute;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(2px);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.auth-bg .b1 { width: 80px; height: 80px; top: 12%; left: 8%; transform: rotate(-15deg); opacity: 0.7; }
.auth-bg .b2 { width: 120px; height: 60px; top: 22%; right: 5%; transform: rotate(20deg); opacity: 0.5; }
.auth-bg .b3 { width: 60px; height: 100px; bottom: 30%; left: 5%; transform: rotate(10deg); opacity: 0.4; }
.auth-bg .b4 { width: 100px; height: 100px; bottom: 15%; right: 10%; border-radius: 50%; opacity: 0.35; }
.auth-bg .b5 { width: 140px; height: 50px; top: 55%; left: 15%; opacity: 0.3; }

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  padding: 32px 28px 28px;
  box-shadow: 0 20px 60px rgba(91, 76, 240, 0.15), 0 4px 16px rgba(15, 23, 42, 0.06);
}

.auth-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  border-radius: 16px;
  background: var(--auth-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(91, 76, 240, 0.35);
}

.auth-logo svg {
  width: 28px;
  height: 28px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
}

.auth-title {
  margin: 0 0 28px;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
  color: #1e293b;
}

.auth-title .highlight {
  display: block;
  margin-top: 4px;
  background: var(--auth-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 14px;
  font-weight: 600;
  color: #334155;
}

.form-label .required {
  color: #ef4444;
  margin-right: 2px;
}

.form-input-wrap {
  position: relative;
}

.form-input-wrap.has-toggle .form-input {
  padding-right: 44px;
}

.form-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  background: #fafbff;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--auth-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(91, 76, 240, 0.12);
}

.form-input::placeholder {
  color: #94a3b8;
}

.toggle-password {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: #64748b;
}

.toggle-password svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.form-hint {
  margin: 0;
  font-size: 12px;
  color: #94a3b8;
}

.btn-primary {
  width: 100%;
  height: 50px;
  margin-top: 4px;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  cursor: pointer;
  background: var(--auth-gradient);
  box-shadow: 0 8px 28px rgba(91, 76, 240, 0.4);
  transition: transform 0.15s, box-shadow 0.2s;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
