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

html.auth-html,
html.auth-html body {
  height: 100%;
  overflow: hidden;
}

body.auth-page {
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  padding: 32px 40px;
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  align-items: center;
  gap: 32px;
  max-width: 1240px;
  margin: 0 auto;
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  color: #334155;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  position: relative;
  background:
    radial-gradient(circle at 12% 20%, rgba(56,189,248,.30), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(37,99,235,.16), transparent 30%),
    radial-gradient(circle at 72% 82%, rgba(255,122,26,.08), transparent 26%),
    linear-gradient(180deg, #F8FAFC 0%, #EEF6FF 100%);
}

.auth-grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(148,163,184,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,163,184,.07) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 45%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 45%, #000 30%, transparent 100%);
}

.auth-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  animation: blobFloat 9s ease-in-out infinite;
  z-index: 0;
}
.auth-blob-1 { width: 340px; height: 340px; background: rgba(56,189,248,.24); top: 6%; left: 2%; }
.auth-blob-2 { width: 380px; height: 380px; background: rgba(37,99,235,.12); bottom: 6%; right: 4%; animation-delay: -3s; }
.auth-blob-3 { width: 260px; height: 260px; background: rgba(255,176,102,.14); top: 42%; left: 38%; animation-delay: -5s; }

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(14px, -10px); }
}

.auth-left {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-height: 100vh;
  overflow: hidden;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  text-decoration: none;
  color: #0F172A;
}
.auth-brand img { width: 40px; height: 40px; }
.auth-brand span { font-size: 20px; font-weight: 700; color: #0F172A; }

.auth-title {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 10px;
  letter-spacing: -0.3px;
  color: #1E293B;
  max-width: 520px;
}

.auth-subtitle {
  font-size: 16px;
  line-height: 1.7;
  color: #475569;
  margin-bottom: 22px;
  max-width: 500px;
}

.demo-card {
  width: 520px;
  height: 490px;
  max-height: calc(100vh - 260px);
  border-radius: 24px;
  padding: 24px;
  overflow: hidden;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(226,232,240,.9);
  box-shadow:
    0 2px 4px rgba(15,23,42,.03),
    0 18px 40px rgba(15,23,42,.08);
  animation: floatSlow 5s ease-in-out infinite;
}

.demo-input {
  height: 48px;
  padding: 0 16px;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-radius: 14px;
  font-size: 14px;
  color: #334155;
  line-height: 48px;
  margin-bottom: 14px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.demo-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #475569;
  margin-bottom: 14px;
}
.demo-progress-label {
  flex-shrink: 0;
  white-space: nowrap;
  min-width: 92px;
  font-weight: 500;
  color: #334155;
}
.demo-progress-bar {
  flex: 1;
  height: 8px;
  background: #E2E8F0;
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}
.demo-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2563EB 0%, #38BDF8 100%);
  border-radius: 99px;
  position: relative;
  will-change: width;
  transition: width 0.35s ease-out;
}
.demo-progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%);
  animation: progressShine 1.6s ease-in-out infinite;
}
@keyframes progressShine {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}
.demo-progress-pct {
  flex-shrink: 0;
  min-width: 38px;
  text-align: right;
  font-weight: 600;
  color: #2563EB;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.demo-image-card {
  height: 150px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #CBD5E1;
  background: #fff;
  text-align: center;
  box-shadow: 0 2px 8px rgba(15,23,42,.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.demo-image-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15,23,42,.10);
}
.demo-image-card .img {
  position: relative;
  height: calc(100% - 32px);
  overflow: hidden;
  background: linear-gradient(135deg, #EFF6FF, #F8FAFC);
}
.demo-image-card .img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.06) contrast(1.04);
}
.demo-image-card .img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(15,23,42,.06) 100%);
  pointer-events: none;
}
.demo-image-card span {
  display: block;
  height: 32px;
  line-height: 32px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  background: #fff;
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.auth-foot {
  margin-top: 12px;
  font-size: 14px;
  color: #475569;
  width: 520px;
}
.auth-foot strong { color: #2563EB; font-weight: 700; }

.auth-card-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  height: 100%;
  max-height: 100vh;
  overflow: hidden;
  padding-left: 4px;
}

.auth-card {
  width: 448px;
  max-height: calc(100vh - 96px);
  padding: 36px 38px;
  border-radius: 26px;
  overflow: hidden;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(226,232,240,.75);
  box-shadow:
    0 1px 2px rgba(15,23,42,.03),
    0 12px 36px rgba(15,23,42,.07);
  transition: box-shadow 0.3s ease;
}
.auth-card.register { padding: 34px 40px; }

.auth-card-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #0F172A;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 18px;
}
.auth-card-logo img { width: 28px; height: 28px; }

.auth-card-perk {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  margin-bottom: 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #2563EB;
  background: linear-gradient(135deg, rgba(37,99,235,.08), rgba(56,189,248,.06));
  border: 1px solid rgba(37,99,235,.14);
}
.auth-card-perk-orange {
  color: #EA580C;
  background: linear-gradient(135deg, rgba(255,122,26,.10), rgba(255,176,102,.08));
  border-color: rgba(255,122,26,.18);
}
.auth-card-perk-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2563EB;
  flex-shrink: 0;
}
.auth-card-perk-orange .auth-card-perk-dot {
  background: #FF7A1A;
}

.auth-card-title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.25;
  color: #1E293B;
  margin-bottom: 6px;
}
.auth-card-desc {
  font-size: 16px;
  color: #475569;
  line-height: 1.7;
  margin-bottom: 24px;
}

.auth-form { margin-top: 0; }

.form-group,
.auth-field {
  margin-bottom: 18px;
}
.register .form-group,
.register .auth-field {
  margin-bottom: 15px;
}

.form-label,
.auth-field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 8px;
}

.input-wrapper,
.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 48px;
  border-radius: 14px;
}
.register .input-wrapper,
.register .auth-input-wrap {
  height: 46px;
}

.auth-input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: #64748B;
  pointer-events: none;
  z-index: 1;
}

.auth-input-wrap input {
  width: 100%;
  height: 100%;
  padding: 0 44px 0 44px;
  border-radius: 14px;
  border: 1.5px solid #CBD5E1;
  background: #FFFFFF;
  font-size: 15px;
  color: #0F172A;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.auth-input-wrap input::placeholder { color: #64748B; }
.auth-input-wrap input:focus,
.auth-input-wrap.is-focus input {
  border-color: #2563EB;
  background: #FFFFFF;
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}
.auth-input-wrap.is-error input {
  border-color: #EF4444;
  box-shadow: 0 0 0 4px rgba(239,68,68,.10);
}
.auth-input-wrap.is-success input {
  border-color: #22C55E;
  box-shadow: 0 0 0 4px rgba(34,197,94,.10);
}

.field-error {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.4;
  color: #EF4444;
}
.field-error[hidden] { display: none; }

.auth-field.has-error { margin-bottom: 14px; }

/* Toast */
.toast-container {
  position: fixed;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  width: min(420px, calc(100vw - 32px));
}

.toast {
  position: relative;
  min-width: 280px;
  max-width: 420px;
  padding: 14px 18px 14px 22px;
  border-radius: 16px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid #BFDBFE;
  box-shadow: 0 12px 30px rgba(15,23,42,.12);
  display: flex;
  align-items: center;
  gap: 10px;
  color: #0F172A;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  animation: toastIn 0.22s ease-out;
  overflow: hidden;
}
.toast-out {
  animation: toastOut 0.18s ease-in forwards;
}

.toast-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #BFDBFE;
  border-radius: 16px 0 0 16px;
}

.toast-icon {
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1;
}

.toast-text { flex: 1; }

.toast-error {
  border-color: #FECACA;
}
.toast-error .toast-bar { background: #EF4444; }
.toast-error .toast-icon { color: #EF4444; }

.toast-warning {
  border-color: #FED7AA;
}
.toast-warning .toast-bar { background: #F97316; }
.toast-warning .toast-icon { color: #F97316; }

.toast-success {
  border-color: #BBF7D0;
}
.toast-success .toast-bar { background: #22C55E; }
.toast-success .toast-icon { color: #22C55E; }

.toast-info,
.toast-loading {
  border-color: #BFDBFE;
}
.toast-info .toast-bar,
.toast-loading .toast-bar { background: #2563EB; }
.toast-info .toast-icon,
.toast-loading .toast-icon { color: #2563EB; }

.toast-loading .toast-icon {
  display: inline-block;
  animation: toastSpin 1s linear infinite;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
}
@keyframes toastSpin {
  to { transform: rotate(360deg); }
}

.auth-eye {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: #64748B;
  padding: 4px;
  display: flex;
  z-index: 1;
}
.auth-eye:hover { color: #334155; }

.submit-button,
.auth-btn {
  width: 100%;
  height: 52px;
  margin-top: 0;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  font-family: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.register .submit-button,
.register .auth-btn {
  height: 50px;
}

.auth-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.22) 50%, transparent 60%);
  transform: translateX(-100%);
  animation: btnShimmer 3.5s ease-in-out infinite;
}
@keyframes btnShimmer {
  0%, 100% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
}
.auth-btn:hover:not(:disabled) { transform: translateY(-2px); }

.auth-btn-blue {
  background: linear-gradient(135deg, #2563EB 0%, #38BDF8 100%);
  box-shadow: 0 10px 24px rgba(37,99,235,.28);
}
.auth-btn-blue:hover:not(:disabled) { box-shadow: 0 16px 32px rgba(37,99,235,.34); }
.auth-btn-orange {
  background: linear-gradient(135deg, #FF7A1A 0%, #FFB066 100%);
  box-shadow: 0 10px 24px rgba(255,122,26,.24);
}
.auth-btn-orange:hover:not(:disabled) { box-shadow: 0 16px 32px rgba(255,122,26,.30); }

.auth-btn.loading span { opacity: 0; }
.auth-btn.loading::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  left: 50%;
  top: 50%;
  margin: -11px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.auth-error {
  color: #EF4444;
  font-size: 13px;
  margin-bottom: 8px;
}
.auth-error.shake { animation: shake 0.4s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.auth-footer-link {
  margin-top: 18px;
  text-align: center;
  font-size: 14px;
  color: #475569;
}
.auth-footer-link a {
  color: #2563EB;
  font-weight: 600;
  text-decoration: none;
}
.auth-footer-link a:hover { text-decoration: underline; }

.auth-footer-cases {
  margin-top: 12px;
  text-align: center;
}
.auth-footer-cases a {
  font-size: 13px;
  color: #94A3B8;
  text-decoration: none;
  font-weight: 400;
  transition: color 0.2s;
}
.auth-footer-cases a:hover {
  color: #64748B;
}

.auth-autofill-trap {
  position: absolute;
  opacity: 0;
  height: 0;
  width: 0;
  pointer-events: none;
}

.auth-btn-hint {
  margin: 2px 0 10px;
  font-size: 13px;
  color: #64748B;
  text-align: center;
}

.auth-alt-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  font-size: 13px;
}
.auth-alt-link {
  color: #64748B;
  text-decoration: none;
  transition: color 0.2s;
}
.auth-alt-link:hover { color: #2563EB; }
.auth-alt-link-accent { color: #FF7A1A; font-weight: 500; }
.auth-alt-link-accent:hover { color: #EA580C; }
.auth-alt-sep { color: #CBD5E1; user-select: none; }

.fade-up {
  animation: fadeUp 0.5s ease forwards;
  opacity: 0;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-stagger {
  animation: fadeUp 0.5s ease forwards;
  animation-delay: calc(0.08s * var(--i, 0) + 0.1s);
  opacity: 0;
}

@media (max-height: 820px) {
  body.auth-page {
    padding: 24px 36px;
    gap: 28px;
  }
  .auth-brand { margin-bottom: 18px; }
  .auth-title {
    font-size: 30px;
    margin-bottom: 10px;
  }
  .auth-subtitle {
    font-size: 15px;
    margin-bottom: 18px;
  }
  .demo-card {
    width: 500px;
    height: 430px;
    padding: 20px;
  }
  .demo-input {
    height: 46px;
    line-height: 46px;
    margin-bottom: 12px;
  }
  .demo-image-card { height: 120px; }
  .auth-card { padding: 30px 36px; width: 440px; }
  .auth-card-title {
    font-size: 26px;
    margin-bottom: 6px;
  }
  .auth-card-desc { margin-bottom: 20px; font-size: 15px; }
  .form-group, .auth-field { margin-bottom: 14px; }
  .input-wrapper, .auth-input-wrap { height: 46px; }
  .submit-button, .auth-btn { height: 50px; }
  .auth-foot { width: 500px; margin-top: 12px; }
}

@media (max-height: 740px) {
  .demo-card { height: 390px; }
  .demo-image-card { height: 100px; }
  .auth-title { font-size: 28px; margin-bottom: 8px; }
  .auth-subtitle { font-size: 14px; margin-bottom: 14px; }
  .auth-card { transform: scale(0.96); }
  .auth-foot { margin-top: 10px; font-size: 13px; }
}

@media (max-width: 1100px) {
  body.auth-page {
    grid-template-columns: 1fr;
    padding: 24px;
    overflow: hidden;
  }
  .auth-left { display: none; }
  .auth-card { width: 100%; max-width: 460px; }
}
