/* 基本重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 變量定義 - 使用與主網站相同的色彩方案 */
:root {
  --primary: #2b5cff;
  --primary-light: #5a80ff;
  --secondary: #3a0ca3;
  --dark: #121212;
  --gray-dark: #333333;
  --gray: #777777;
  --gray-light: #f5f5f5;
  --white: #ffffff;
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.1);
  --success: #4caf50;
  --error: #f44336;
}

/* 基本頁面樣式 */
body {
  font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--dark);
  background-image: 
      radial-gradient(circle at top left, rgba(90, 128, 255, 0.1), transparent 50%),
      radial-gradient(circle at bottom right, rgba(58, 12, 163, 0.1), transparent 50%);
  color: var(--white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 頁首樣式 */
header {
  background-color: rgba(18, 18, 18, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  border-bottom: 1px solid var(--glass-border);
  padding: 1.2rem 0;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* 導航樣式 */
nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
}

nav a {
  color: var(--gray-light);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: color 0.3s ease;
  position: relative;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

nav a:hover {
  color: var(--primary-light);
}

nav a:hover::after {
  transform: scaleX(1);
}

/* 主要內容區域 */
main {
  flex: 1;
  padding-top: 100px;
  padding-bottom: 50px;
  display: flex;
  align-items: center;
  min-height: 100vh;
}

/* 認證容器樣式 - 使用玻璃擬態效果 */
.auth-container {
  background-color: var(--glass-bg);
  padding: 3rem;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 450px;
  margin: 0 auto;
  border: 1px solid var(--glass-border);
  position: relative;
  overflow: hidden;
}

.auth-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(43, 92, 255, 0.05), rgba(58, 12, 163, 0.05));
  border-radius: inherit;
  z-index: -1;
}

.auth-container h2 {
  text-align: center;
  margin-bottom: 30px;
  color: var(--white);
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* 表單樣式 */
.form-group {
  margin-bottom: 24px;
  position: relative;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 14px;
  color: var(--gray-light);
}

.form-group input {
  width: 100%;
  padding: 15px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  font-size: 15px;
  transition: all 0.3s ease;
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--white);
  font-family: inherit;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(43, 92, 255, 0.2);
}

.form-group input::placeholder {
  color: #adb5bd;
}

/* 按鈕樣式 */
.auth-btn {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--white);
  border: none;
  padding: 16px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 0.8rem;
  box-shadow: 0 4px 10px rgba(43, 92, 255, 0.2);
}

.auth-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(43, 92, 255, 0.3);
}

.auth-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 5px rgba(43, 92, 255, 0.2);
}

/* 切換表單樣式 */
.switch-form {
  text-align: center;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.switch-form p {
  color: var(--gray);
  font-size: 14px;
}

.switch-form a {
  color: var(--primary-light);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  padding-bottom: 2px;
}

.switch-form a::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 1px;
  bottom: 0;
  left: 0;
  background-color: var(--primary);
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.3s ease;
}

.switch-form a:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

/* 錯誤訊息樣式 */
.error-message {
  color: var(--error);
  font-weight: 500;
  padding: .5rem 0;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 25px;
  display: none;
}

.error-message::before {
  content: '\f071';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
}

/* 頁尾樣式 */
footer {
  background-color: rgba(10, 10, 10, 0.9);
  padding: 3rem 5%;
  text-align: center;
  border-top: 1px solid var(--glass-border);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

footer p {
  color: var(--gray);
  font-size: 14px;
}

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

.auth-container {
  animation: fadeIn 0.6s ease-out forwards;
}

/* 特殊卡片效果 */
.auth-container::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, transparent 65%, rgba(58, 12, 163, 0.1) 100%);
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
  z-index: -1;
}

.auth-container:hover::after {
  opacity: 1;
}

/* 忘記密碼連結 */
.forgot-password {
  text-align: right;
  margin-top: 8px;
  font-size: 14px;
}

.forgot-password a {
  color: var(--primary-light);
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
}

.forgot-password a::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 1px;
  bottom: -2px;
  left: 0;
  background-color: var(--primary);
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.3s ease;
}

.forgot-password a:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

/* 分步流程樣式 */
.steps-indicator {
  display: flex;
  justify-content: space-between;
  margin-bottom: 30px;
  position: relative;
}

.steps-indicator::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.1);
  z-index: 1;
}

.step {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.step-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  transition: all 0.3s ease;
}

.step.active .step-circle {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-color: transparent;
}

.step.completed .step-circle {
  background-color: var(--success);
  border-color: transparent;
}

.step-label {
  font-size: 12px;
  color: var(--gray);
  transition: color 0.3s ease;
}

.step.active .step-label {
  color: var(--white);
}

.step.completed .step-label {
  color: var(--success);
}

/* 響應式設計 */
@media (max-width: 768px) {
  header h1 {
    font-size: 1.3rem;
  }
  
  nav ul {
    gap: 15px;
  }
  
  .auth-container {
    padding: 2rem;
  }
  
  .auth-btn {
    padding: 14px;
  }
}

@media (max-width: 480px) {
  nav ul {
    gap: 10px;
  }
  
  header .container {
    flex-wrap: wrap;
  }
  
  .auth-container {
    padding: 1.5rem;
    margin: 0 10px;
  }
  
  .auth-container h2 {
    font-size: 22px;
  }
}

/* 記住我功能 */
.remember-me {
  display: flex;
  align-items: center;
  margin: 15px 0;
}

.remember-me input[type="checkbox"] {
  margin-right: 8px;
  accent-color: var(--primary);
}

.remember-me label {
  color: var(--gray-light);
  font-size: 14px;
}

/* 密碼可見性切換 */
.password-toggle {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--gray);
  cursor: pointer;
  display: none;
}

/* 密碼強度和匹配指示器 */
.password-strength,
.password-match {
    font-size: 0.85em;
    padding: 5px 0;
    margin-top: 5px;
    transition: all 0.3s ease;
}

.password-strength {
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    display: inline-block;
}

/* 驗證碼輸入框 */
.code-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 10px 0 20px;
}

.code-input {
    width: 40px;
    height: 50px;
    text-align: center;
    font-size: 1.5em;
    border: 1px solid var(--gray);
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
    transition: all 0.3s ease;
}

.code-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
    background-color: rgba(255, 255, 255, 0.15);
}

/* 成功提示的圖標 */
.success-icon {
    font-size: 4em;
    color: var(--success);
    margin: 20px 0;
    animation: success-pulse 2s infinite;
}

@keyframes success-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* 重設密碼流程步驟 */
.auth-container {
    position: relative;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

/* 按鈕組樣式 */
.button-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.secondary-btn {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.secondary-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.secondary-btn:disabled {
    background-color: rgba(80, 80, 80, 0.3);
    cursor: not-allowed;
    color: var(--gray);
}

/* 提示和說明文字 */
.instructions {
    margin-bottom: 20px;
    color: var(--gray-light);
    font-size: 0.9em;
    line-height: 1.5;
}

/* 密碼框的查看密碼功能 */
.password-toggle-wrapper {
    position: relative;
}

.password-toggle-icon {
    position: absolute;
    right: 12px;
    top: 12px;
    cursor: pointer;
    color: var(--gray);
    font-size: 1.2em;
    transition: color 0.3s;
}

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

/* 加載動畫 */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 密碼重設成功頁面 */
#reset-success {
    text-align: center;
    padding: 30px 20px;
}

#reset-success h3 {
    font-size: 1.5em;
    margin: 15px 0;
    color: var(--success);
}

#reset-success p {
    margin-bottom: 25px;
    color: var(--gray-light);
}

/* 驗證碼過期時間顯示樣式 */
.expiry-info {
  margin-top: 15px;
  padding: 10px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  text-align: center;
  font-size: 0.9em;
}

.expiry-info p {
  margin: 0 0 8px 0;
  color: var(--gray-light);
}

.expiry-progress-container {
  width: 100%;
  height: 6px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.expiry-progress {
  height: 100%;
  background-color: var(--primary);
  transition: width 1s ease, background-color 0.5s ease;
  width: 100%;
}

/* 自動檢測過期的輸入元素樣式 */
input.expired {
  border-color: var(--error);
  box-shadow: 0 0 0 2px rgba(244, 67, 54, 0.3);
}

/* 驗證碼過期警告消息 */
.expiry-warning {
  color: var(--error);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

/* 響應式設計調整 */
@media (max-width: 480px) {
    .code-inputs {
        gap: 4px;
    }
    
    .code-input {
        width: 35px;
        height: 45px;
        font-size: 1.3em;
    }
    
    .button-group {
        flex-direction: column;
    }
}