* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #1E40AF;
  --primary-hover: #1D4ED8;
  --primary-light: #DBEAFE;
  --bg-body: #E8F3FF;
  --bg-card: #FFFFFF;
  --text-primary: #1F2937;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --border-color: #E5E7EB;
  --border-focus: #1E40AF;
  --success-color: #10B981;
  --error-color: #EF4444;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  width: 100%;
}

body {
  margin: 0;
}

.login-container {
  width: 100%;
  min-height: 100vh;
  display: flex;
}

.login-wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
  background: var(--bg-card);
  overflow: hidden;
}

.login-left {
  width: 58%;
  background: linear-gradient(135deg, #1E40AF 0%, #3B82F6 100%);
  padding: 60px 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #FFFFFF;
}

.login-left .brand-logo {
  margin-bottom: 40px;
}

.login-left .brand-logo svg {
  width: 56px;
  height: 56px;
}

.login-left .brand-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.3;
}

.login-left .brand-desc {
  font-size: 15px;
  opacity: 0.9;
  margin-bottom: 50px;
  line-height: 1.6;
}

.login-left .features {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.login-left .feature-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.login-left .feature-item .icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.login-left .feature-item .icon svg {
  width: 20px;
  height: 20px;
}

.login-left .feature-item .text h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.login-left .feature-item .text p {
  font-size: 13px;
  opacity: 0.8;
}

.login-right {
  width: 42%;
  padding: 60px 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-right .form-header {
  margin-bottom: 36px;
}

.login-right .form-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.login-right .form-header p {
  font-size: 14px;
  color: var(--text-secondary);
}

.login-tabs {
  display: flex;
  margin-bottom: 32px;
  background: #F3F4F6;
  border-radius: 8px;
  padding: 4px;
}

.login-tabs button {
  flex: 1;
  padding: 11px 20px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.login-tabs button.active {
  background: var(--bg-card);
  color: var(--primary-color);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-group .input-wrapper {
  position: relative;
}

.form-group .input-wrapper svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.form-group input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 46px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-primary);
  background: #FAFAFA;
  transition: all 0.2s ease;
  outline: none;
}

.form-group input:focus {
  border-color: var(--border-focus);
  background: var(--bg-card);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.form-group.password-group .toggle-password {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.form-group.password-group .toggle-password:hover {
  color: var(--text-secondary);
}

.form-group.code-group {
  display: flex;
  gap: 12px;
}

.form-group.code-group .input-wrapper {
  flex: 1;
}

.form-group.code-group .send-code-btn {
  padding: 0 24px;
  height: 44px;
  border: 1px solid var(--primary-color);
  border-radius: 8px;
  background: transparent;
  color: var(--primary-color);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.form-group.code-group .send-code-btn:hover {
  background: var(--primary-color);
  color: #FFFFFF;
}

.form-group.code-group .send-code-btn.disabled {
  border-color: var(--border-color);
  color: var(--text-muted);
  cursor: not-allowed;
}

.form-group .captcha-wrapper {
  display: flex;
  gap: 12px;
  align-items: center;
}

.form-group .captcha-wrapper .captcha-input {
  flex: 1;
}

.form-group .captcha-wrapper .captcha-img {
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  background: #FAFAFA;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.form-group .captcha-wrapper .captcha-img:hover {
  border-color: var(--border-focus);
}

.form-group .captcha-wrapper .captcha-img canvas {
  display: block;
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.form-options label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 0;
}

.form-options input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-right: 8px;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

.form-options a {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.form-options a:hover {
  color: var(--primary-color);
}

.btn {
  width: 100%;
  height: 46px;
  padding: 0 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

.btn-primary {
  background: var(--primary-color);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.register-link {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-secondary);
}

.register-link a {
  color: var(--primary-color);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.register-link a:hover {
  color: var(--primary-hover);
}

.step-indicator {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 32px;
}

.step-indicator .step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.step-indicator .step .step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #F3F4F6;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
}

.step-indicator .step.active .step-number {
  background: var(--primary-color);
  color: #FFFFFF;
}

.step-indicator .step .step-label {
  font-size: 12px;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.step-indicator .step.active .step-label {
  color: var(--text-primary);
  font-weight: 500;
}

.step-indicator .step-line {
  width: 48px;
  height: 2px;
  background: #F3F4F6;
  margin: 0 8px;
  transition: background 0.3s ease;
}

.step-indicator .step-line.active {
  background: var(--primary-color);
}

.btn-back {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.btn-back:hover {
  color: var(--primary-color);
}

.success-icon {
  display: flex;
  justify-content: center;
}

.success-icon svg {
  width: 80px;
  height: 80px;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  z-index: 1000;
  animation: slideUp 0.3s ease;
  max-width: 90%;
}

.toast.success {
  background: #D1FAE5;
  color: #065F46;
}

.toast.error {
  background: #FEE2E2;
  color: #991B1B;
}

.toast.warning {
  background: #FEF3C7;
  color: #92400E;
}

@keyframes slideUp {
  from {
    transform: translate(-50%, 100%);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@media (max-width: 900px) {
  .login-wrapper {
    flex-direction: column;
    max-height: none;
  }
  .login-left {
    width: 100%;
    padding: 40px 30px;
    min-height: 300px;
  }
  .login-right {
    width: 100%;
    padding: 40px 30px;
  }
}

@media (max-width: 768px) {
  body {
    align-items: flex-start;
    padding: 0 !important;
  }
  .login-container {
    width: 100%;
    max-width: 480px;
  }
  .login-left {
    padding: 35px 25px;
    min-height: 280px;
  }
  .login-left .brand-logo {
    margin-bottom: 28px;
  }
  .login-left .brand-logo svg {
    width: 48px;
    height: 48px;
  }
  .login-left .brand-title {
    font-size: 24px;
    margin-bottom: 12px;
  }
  .login-left .brand-desc {
    font-size: 14px;
    margin-bottom: 35px;
  }
  .login-left .features {
    gap: 18px;
  }
  .login-left .feature-item .icon {
    width: 36px;
    height: 36px;
  }
  .login-left .feature-item .icon svg {
    width: 18px;
    height: 18px;
  }
  .login-left .feature-item .text h4 {
    font-size: 14px;
  }
  .login-left .feature-item .text p {
    font-size: 12px;
  }
  .login-right {
    padding: 35px 25px;
  }
  .login-right .form-header h2 {
    font-size: 22px;
  }
  .login-right .form-header p {
    font-size: 13px;
  }
  .login-tabs {
    margin-bottom: 28px;
  }
  .login-tabs button {
    font-size: 13px;
    padding: 10px 16px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 0 !important;
  }
  .login-container {
    max-width: 100%;
  }
  .login-wrapper {
    border-radius: 12px;
  }
  .login-left {
    padding: 30px 20px;
    min-height: 250px;
  }
  .login-left .brand-logo {
    margin-bottom: 24px;
  }
  .login-left .brand-logo svg {
    width: 42px;
    height: 42px;
  }
  .login-left .brand-title {
    font-size: 22px;
  }
  .login-left .brand-desc {
    font-size: 13px;
    margin-bottom: 30px;
  }
  .login-left .features {
    gap: 16px;
  }
  .login-left .feature-item {
    gap: 12px;
  }
  .login-left .feature-item .icon {
    width: 32px;
    height: 32px;
  }
  .login-left .feature-item .icon svg {
    width: 16px;
    height: 16px;
  }
  .login-right {
    padding: 30px 20px;
  }
  .login-right .form-header {
    margin-bottom: 28px;
  }
  .login-right .form-header h2 {
    font-size: 20px;
  }
  .form-group {
    margin-bottom: 18px;
  }
  .form-group label {
    font-size: 13px;
    margin-bottom: 6px;
  }
  .form-group input {
    height: 40px;
    font-size: 13px;
    padding: 0 12px 0 42px;
  }
  .form-group .input-wrapper svg {
    width: 16px;
    height: 16px;
    left: 12px;
  }
  .form-group.code-group .send-code-btn {
    height: 40px;
    padding: 0 16px;
    font-size: 12px;
  }
  .form-options {
    margin-bottom: 24px;
  }
  .form-options label {
    font-size: 12px;
  }
  .form-options a {
    font-size: 12px;
  }
  .btn {
    height: 42px;
    font-size: 14px;
  }
  .register-link {
    margin-top: 20px;
    font-size: 12px;
  }
}

@media (max-width: 360px) {
  body {
    padding: 0 !important;
  }
  .login-left {
    padding: 24px 16px;
    min-height: 220px;
  }
  .login-left .brand-title {
    font-size: 20px;
  }
  .login-left .brand-desc {
    font-size: 12px;
    margin-bottom: 24px;
  }
  .login-right {
    padding: 24px 16px;
  }
  .login-right .form-header h2 {
    font-size: 18px;
  }
  .login-right .form-header p {
    font-size: 12px;
  }
}

@media (orientation: landscape) and (max-width: 900px) {
  body {
    align-items: flex-start;
    padding: 0 !important;
  }
  .login-wrapper {
    flex-direction: row;
    max-height: 90vh;
  }
  .login-left {
    min-height: auto;
    padding: 30px 25px;
  }
  .login-right {
    padding: 30px 25px;
    overflow-y: auto;
  }
}