/* ===== CSS Variables (Apple Design) ===== */
/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: var(--font-cn);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== Login Layout ===== */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #11151B;
}
.login-wrapper::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: rgba(17, 21, 27, 0.2);
}

/* ===== Left Panel ===== */
.login-left {
  width: 55%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 60px 80px;
  position: relative;
  overflow: hidden;
  z-index: 2;
  background: transparent;
}
.network-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  touch-action: none;
}
.login-left .brand-mark {
  margin: 0 0 22px;
  position: relative;
  z-index: 2;
}
.login-left .brand-wordmark {
  display: block;
  color: #FFFFFF;
  font-size: 54px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.08em;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

.login-left .brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  background: rgba(0,113,227,0.12);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 28px;
  position: relative;
  z-index: 2;
}
.login-left .brand-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 12px var(--primary);
}

.login-left .brand-title {
  font-family: var(--font-en);
  font-size: 42px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
  position: relative;
  z-index: 2;
}
.login-left .brand-title span {
  color: var(--primary);
}

.login-left .brand-subtitle {
  font-family: var(--font-en);
  font-size: 14px;
  color: rgba(255,255,255,0.68);
  letter-spacing: 0.08em;
  position: relative;
  z-index: 2;
}

.login-left .brand-desc {
  color: rgba(255,255,255,0.6);
  font-size: 15px;
  margin-top: 24px;
  max-width: 400px;
  line-height: 1.8;
  position: relative;
  z-index: 2;
}

.login-left .brand-stats {
  display: flex;
  gap: 32px;
  margin-top: 36px;
  position: relative;
  z-index: 2;
}
.login-left .brand-stat span {
  display: block;
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  margin-bottom: 4px;
}
.login-left .brand-stat strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: #fff;
}
.login-left .brand-stat strong em {
  font-style: normal;
  color: var(--success);
  font-size: 14px;
  font-weight: 500;
}

.login-left .copyright {
  position: absolute;
  bottom: 30px;
  left: 80px;
  color: #86868B;
  font-size: 12px;
  z-index: 2;
}

/* ===== Right Panel ===== */
.login-right {
  width: 45%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
  position: relative;
  z-index: 2;
  background: transparent;
}

.login-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  animation: slideUp 0.6s ease-out;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-card .card-header {
  text-align: center;
  margin-bottom: 36px;
}

.login-card .card-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.login-card .card-header p {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ===== Form ===== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper .input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  pointer-events: none;
  transition: color 0.3s cubic-bezier(0.28, 0.11, 0.32, 1);
}

.input-wrapper input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 42px;
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-cn);
  font-size: 14px;
  color: var(--text-primary);
  background: #FFFFFF;
  transition: all 0.3s cubic-bezier(0.28, 0.11, 0.32, 1);
  outline: none;
}

.input-wrapper input::placeholder {
  color: var(--text-muted);
}

.input-wrapper input:focus {
  border-color: var(--primary);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(0,113,227,0.12);
}

.input-wrapper:has(input:focus) .input-icon {
  color: var(--primary);
}

.password-toggle {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
  transition: color 0.3s cubic-bezier(0.28, 0.11, 0.32, 1);
}

.password-toggle:hover {
  color: var(--text-secondary);
}

/* ===== Checkbox ===== */
.checkbox-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkbox-label .checkmark {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--input-border);
  background: transparent;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.28, 0.11, 0.32, 1);
  flex-shrink: 0;
}

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

.checkbox-label input[type="checkbox"]:checked + .checkmark svg {
  opacity: 1;
}

.checkbox-label .checkmark svg {
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.28, 0.11, 0.32, 1);
}

.forgot-link {
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
  transition: opacity 0.3s cubic-bezier(0.28, 0.11, 0.32, 1);
}

.forgot-link:hover {
  opacity: 0.8;
}

/* ===== Login Button ===== */
.btn-login {
  width: 100%;
  height: 44px;
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-cn);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.28, 0.11, 0.32, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-login:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,113,227,0.2);
}

.btn-login:active {
  transform: translateY(0);
}

.btn-login:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

.btn-login.success {
  background: var(--success);
}

/* ===== Secondary Button ===== */
.btn-secondary {
  width: 100%;
  height: 40px;
  background: transparent;
  color: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-cn);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.28, 0.11, 0.32, 1);
  margin-top: 8px;
}

.btn-secondary:hover {
  background: var(--primary-light);
}

/* ===== Status Message ===== */
.status {
  min-height: 20px;
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
  color: var(--danger);
}

.status.success {
  color: var(--success);
}

/* ===== Captcha ===== */
.captcha-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
}

.captcha-box {
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid #9cbfe5;
  border-radius: var(--radius-sm);
  background: #eef6ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 6px;
  color: var(--primary);
  user-select: none;
  cursor: pointer;
  transition: background 0.3s cubic-bezier(0.28, 0.11, 0.32, 1);
}

.captcha-box:hover {
  background: #F5F5F7;
}

.captcha-box img {
  width: 132px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  pointer-events: none;
}

.captcha-hint {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
  margin-top: 4px;
}

/* ===== Spin Animation ===== */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.hidden {
  display: none !important;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .login-left {
    padding: 40px 50px;
  }
  .login-left .copyright {
    left: 50px;
  }
}

@media (max-width: 768px) {
  .login-wrapper {
    flex-direction: column;
  }
  .login-left {
    width: 100%;
    padding: 40px 30px;
    min-height: 300px;
    align-items: center;
    text-align: center;
  }
  .login-left .brand-title {
    font-size: 32px;
  }
  .login-left .brand-wordmark {
    font-size: 42px;
  }
  .login-left .brand-stats { display: none; }
  .login-left .copyright {
    position: static;
    display: block;
    margin-top: 22px;
  }
  .login-left .brand-desc { display: block; max-width: 520px; font-size: 13px; }
  .login-right {
    width: 100%;
    padding: 20px;
  }
  .login-card {
    padding: 36px 28px;
  }
}
