/* TSSKB 登录页 —— 移植自 ale-dan-cpl-system 登录页设计（全屏轮播 + 毛玻璃卡片）。 */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

body.login-page {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #0d001a;
  color: #fff;
  -webkit-font-smoothing: antialiased;
}

/* ==================== 全屏轮播背景 ==================== */

.login-root {
  position: relative;
  display: flex;
  min-height: 100vh;
}

.login-carousel {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #1a0533 0%, #2d1b4e 50%, #0f1b3d 100%);
}

.login-carousel .carousel-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.4s ease-in-out;
  transform: translate3d(0, 0, 0);
  will-change: transform, opacity;
}

.login-carousel .carousel-layer.is-active { opacity: 1; }

.login-carousel .carousel-layer.ken-left  { animation: kb-left  8s linear forwards; }
.login-carousel .carousel-layer.ken-right { animation: kb-right 8s linear forwards; }

@keyframes kb-left {
  from { transform: scale(1) translateX(0); }
  to   { transform: scale(1.12) translateX(-15px); }
}

@keyframes kb-right {
  from { transform: scale(1) translateX(0); }
  to   { transform: scale(1.12) translateX(15px); }
}

/* 渐变遮罩层 */
.login-carousel .overlay-h {
  position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(26, 5, 51, 0.85), rgba(26, 5, 51, 0.5) 50%, rgba(26, 5, 51, 0.3));
}
.login-carousel .overlay-v {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(13, 0, 26, 0.6), transparent 50%, rgba(26, 5, 51, 0.4));
}
.login-carousel .overlay-grain {
  position: absolute; inset: 0; opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* 轮播指示点 */
.carousel-indicators {
  position: absolute;
  left: 4rem;
  bottom: 2.5rem;
  display: flex;
  gap: 0.625rem;
  z-index: 5;
}
.carousel-indicators .dot {
  width: 8px;
  height: 4px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.3);
  transition: width 0.5s ease, background-color 0.5s ease;
}
.carousel-indicators .dot.is-active {
  width: 32px;
  background: rgba(255, 255, 255, 0.8);
}

/* ==================== 内容层 ==================== */

.login-content {
  position: relative;
  z-index: 10;
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* 左侧品牌区 */
.login-brand {
  display: none;
  flex: 1;
  flex-direction: column;
  padding: 4rem 4rem 2rem;
}
@media (min-width: 1024px) {
  .login-brand { display: flex; }
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.brand-mark {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-mark img { width: 70%; height: 70%; object-fit: contain; }
.brand-row .brand-name {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.brand-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 32rem;
  margin-top: -2rem;
}
.brand-title {
  margin: 0 0 1rem;
  font-size: 3.75rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.05em;
  color: #fff;
}
.brand-subtitle {
  font-size: 1.5rem;
  font-weight: 300;
  letter-spacing: 0.025em;
  color: rgba(255, 255, 255, 0.5);
}

/* 旋转文案区 */
.rotating-text { margin-top: 1.5rem; }
.rotating-line-wrap {
  height: 1px;
  width: 4rem;
  margin-bottom: 1rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.3);
}
.rotating-line {
  height: 100%;
  width: 100%;
  background: #c084fc;
  transform-origin: left;
  transform: scaleX(0);
}
.rotating-line.is-in { animation: line-in 0.6s cubic-bezier(0.215, 0.61, 0.355, 1) forwards; }
@keyframes line-in { to { transform: scaleX(1); } }

.rotating-chars {
  overflow: hidden;
  min-height: 3.5rem;
  display: flex;
  flex-wrap: wrap;
  font-size: 1.25rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.025em;
  line-height: 1.75;
}
@media (min-width: 1024px) {
  .rotating-chars { font-size: 1.5rem; }
}
.rotating-chars .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.35s ease-out, transform 0.35s ease-out;
  white-space: pre;
}
.rotating-chars .char.is-in { opacity: 1; transform: translateY(0); }
.rotating-chars.is-out .char {
  opacity: 0;
  transform: translateY(-12px);
  transition-duration: 0.3s;
  transition-timing-function: ease-in;
}

.progress-track {
  margin-top: 1.25rem;
  height: 2px;
  width: 100%;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  border-radius: 9999px;
  background: rgba(192, 132, 252, 0.6);
  transform-origin: left;
  transform: scaleX(0);
}
.progress-bar.is-filling { animation: progress-fill 6s linear forwards; }
@keyframes progress-fill { to { transform: scaleX(1); } }

.brand-footer {
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.875rem;
}

/* ==================== 右侧登录面板 ==================== */

.login-panel {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
@media (min-width: 640px) { .login-panel { padding: 3rem; } }
@media (min-width: 1024px) { .login-panel { width: 480px; } }
@media (min-width: 1280px) { .login-panel { width: 520px; } }

.login-card-wrap { width: 100%; max-width: 380px; }

/* 移动端 logo */
.mobile-brand {
  display: flex;
  margin-bottom: 2rem;
  text-align: center;
  justify-content: center;
}
@media (min-width: 1024px) { .mobile-brand { display: none; } }
.mobile-brand .inner { display: inline-flex; align-items: center; gap: 0.5rem; }
.mobile-brand .mini-mark {
  width: 2rem; height: 2rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex; align-items: center; justify-content: center;
}
.mobile-brand .mini-mark img { width: 70%; height: 70%; object-fit: contain; }
.mobile-brand .mini-name { color: rgba(255, 255, 255, 0.8); font-weight: 500; }

/* 毛玻璃卡片 */
.login-card {
  position: relative;
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background-color 0.3s, border-color 0.3s;
  will-change: transform, opacity;
}
@media (min-width: 640px) { .login-card { padding: 2.5rem; } }
.login-card:focus-within {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.card-heading { margin-bottom: 2rem; }
.card-heading h2 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: rgba(255, 255, 255, 0.9);
}
.card-heading p {
  margin: 0;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.5);
}

.field { margin-bottom: 1.25rem; }
.field label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
}
.input-wrap { position: relative; }
.input-wrap svg {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: rgba(255, 255, 255, 0.5);
  pointer-events: none;
}
.field input {
  width: 100%;
  height: 3rem;
  padding: 0 1rem 0 2.75rem;
  font-size: 0.9375rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.75rem;
  outline: none;
  transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.field input::placeholder { color: rgba(255, 255, 255, 0.4); }
.field input:focus {
  background: rgba(255, 255, 255, 0.2);
  border-color: #c084fc;
  box-shadow: 0 0 0 1px #c084fc;
}

.form-error {
  display: none;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
}
.form-error.is-visible { display: block; }

.login-btn {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 3rem;
  border: 0;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(to right, #9333ea, #4f46e5);
  box-shadow: 0 10px 15px -3px rgba(124, 58, 237, 0.3);
  transition: background 0.2s, transform 0.1s;
}
.login-btn:hover { background: linear-gradient(to right, #a855f7, #6366f1); }
.login-btn:active { transform: scale(0.98); }
.login-btn:disabled { opacity: 0.75; cursor: not-allowed; }

.btn-shimmer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.btn-shimmer::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -100%;
  width: 50%;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 3.5s ease-in-out infinite;
}
@keyframes shimmer {
  0% { left: -100%; }
  55%, 100% { left: 125%; }
}

.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  margin-right: 0.5rem;
  vertical-align: -2px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.card-footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
}

/* ==================== 入场动画 ==================== */

@keyframes fade-slide-right { from { opacity: 0; transform: translateX(-60px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fade-rise { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade-rise-sm { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.anim-brand { animation: fade-slide-right 0.8s cubic-bezier(0.215, 0.61, 0.355, 1) 0.2s backwards; }
.anim-card { animation: fade-rise 0.7s cubic-bezier(0.215, 0.61, 0.355, 1) 0.3s backwards; }
.anim-field:nth-child(1) { animation: fade-rise-sm 0.6s ease-out 0.4s backwards; }
.anim-field:nth-child(2) { animation: fade-rise-sm 0.6s ease-out 0.48s backwards; }
.anim-error { animation: fade-rise-sm 0.6s ease-out 0.56s backwards; }
.anim-btn { animation: fade-rise-sm 0.5s ease-out 0.6s backwards; }
