/*
 * 登入頁面 - 簡約設計
 * 風格：清爽、現代、易用
 */

/* ============================================
   1. 登入頁面容器
   ============================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  padding: 1.5rem;
}

.auth-container {
  width: 100%;
  max-width: 420px;
}

/* ============================================
   2. 登入卡片
   ============================================ */
.auth-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 2.5rem 2rem;
}

/* ============================================
   3. Logo 和標題
   ============================================ */
.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: var(--primary-100);
  border-radius: var(--radius-xl);
  margin-bottom: 1.25rem;
}

.auth-logo i {
  font-size: 1.75rem;
  color: var(--primary);
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ============================================
   4. 表單樣式
   ============================================ */
.auth-form .form-group {
  margin-bottom: 1.25rem;
}

.auth-form .form-label {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.auth-form .form-control {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  transition: var(--transition-base);
  background-color: var(--bg-primary);
}

.auth-form .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--shadow-primary);
  outline: none;
}

.auth-form .form-control::placeholder {
  color: var(--text-muted);
}

/* 密碼輸入框 */
.password-field {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition-fast);
  background: none;
  border: none;
  padding: 0;
}

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

/* ============================================
   5. 記住我 & 忘記密碼
   ============================================ */
.auth-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.auth-options .form-check {
  margin-bottom: 0;
}

.auth-options .form-check-input {
  border-radius: var(--radius-sm);
  border-color: var(--border-color);
}

.auth-options .form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

.auth-options .form-check-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.auth-options a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition-fast);
}

.auth-options a:hover {
  color: var(--primary-dark);
}

/* ============================================
   6. 提交按鈕
   ============================================ */
.auth-submit {
  width: 100%;
  padding: 0.875rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-lg);
  background: var(--primary);
  border: none;
  color: #ffffff;
  transition: var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.auth-submit:hover {
  background: var(--primary-dark);
  color: #ffffff;
}

.auth-submit:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--shadow-primary-lg);
}

.auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Loading 狀態 */
.auth-submit.loading {
  pointer-events: none;
}

.auth-submit .spinner-border {
  width: 1rem;
  height: 1rem;
  border-width: 2px;
}

/* ============================================
   7. 分隔線
   ============================================ */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.auth-divider span {
  padding: 0 1rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
}

/* ============================================
   8. 頁腳連結
   ============================================ */
.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition-fast);
}

.auth-footer a:hover {
  color: var(--primary-dark);
}

/* ============================================
   9. Alert 提示
   ============================================ */
.auth-alert {
  border-radius: var(--radius-lg);
  padding: 0.875rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-alert.success {
  background-color: var(--success-light);
  color: #166534;
}

.auth-alert.error {
  background-color: var(--danger-light);
  color: #991b1b;
}

.auth-alert i {
  font-size: 1rem;
}

/* ============================================
   10. 響應式設計
   ============================================ */
@media (max-width: 576px) {
  .auth-page {
    padding: 1rem;
  }

  .auth-card {
    padding: 2rem 1.5rem;
    border-radius: var(--radius-lg);
  }

  .auth-title {
    font-size: 1.375rem;
  }
}

/* ============================================
   11. 動畫效果
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-card {
  animation: fadeInUp 0.4s ease-out;
}

/* ============================================
   12. 舊版相容樣式
   ============================================ */
/* 相容舊版 auth-fluid 類別 */
.auth-fluid {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
}

.auth-fluid-form-box {
  width: 100%;
  max-width: 420px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 2.5rem 2rem;
  margin: 1.5rem;
  animation: fadeInUp 0.4s ease-out;
}

.auth-brand {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-brand a {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.form-signin-heading {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  text-align: center;
}

.form-signin .form-control {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.form-signin .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--shadow-primary);
}

.form-signin .btn-primary {
  width: 100%;
  padding: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-lg);
  background: var(--primary);
  border: none;
}

.form-signin .btn-primary:hover {
  background: var(--primary-dark);
}

.form-signin a {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.875rem;
}

.footer-alt {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}
