/* ========== 登錄/註冊彈窗樣式 ========== */

/* 彈窗遮罩層 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-overlay.active {
  display: flex;
}

/* 彈窗容器 */
.modal {
  background-color: #2a2a2a;
  width: 400px;
  border-radius: 8px;
  padding: 25px;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

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

/* 彈窗關閉按鈕 */
.close-modal {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.close-modal:hover {
  background-color: rgba(255, 30, 144, 0.2);
  color: #ff1e90;
  transform: rotate(90deg);
}

/* 彈窗標題 */
.modal-title {
  font-size: 22px;
  margin-bottom: 20px;
  text-align: center;
  color: #fff;
  font-weight: bold;
}

/* 表單群組 */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #ccc;
  font-size: 14px;
  font-weight: 500;
}

/* 表單輸入框 */
.form-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid #444;
  border-radius: 4px;
  background-color: #333;
  color: #fff;
  outline: none;
  font-size: 16px;
  transition: all 0.3s ease;
}

.form-group input:focus {
  border-color: #007bff;
  background-color: #3a3a3a;
  box-shadow: 0 0 8px rgba(0, 123, 255, 0.3);
}

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

/* 表單提交按鈕 */
.submit-btn {
  width: 100%;
  padding: 12px;
  background-color: #007bff;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.submit-btn:hover:not(:disabled) {
  background-color: #0056b3;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
  transform: translateY(-2px);
}

.submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.submit-btn:disabled {
  background-color: #666;
  cursor: not-allowed;
  opacity: 0.6;
}

/* 驗證碼按鈕特殊樣式 */
#sendCodeBtn {
  flex-shrink: 0;
  width: auto;
  padding: 12px 15px;
  white-space: nowrap;
}

/* 表單驗證碼輸入框容器 */
.form-group > div {
  display: flex;
  gap: 8px;
  align-items: center;
}

.form-group > div input {
  flex: 1;
}

/* 彈窗頁籤切換 */
.modal-switch {
  text-align: center;
  margin-top: 15px;
  font-size: 14px;
  color: #ccc;
}

.modal-switch a {
  color: #007bff;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: bold;
}

.modal-switch a:hover {
  color: #0056b3;
  text-decoration: underline;
}

/* 響應式設計 */
@media (max-width: 480px) {
  .modal {
    width: 90vw;
    max-width: 400px;
    padding: 20px;
  }

  .modal-title {
    font-size: 18px;
  }

  .form-group input,
  .submit-btn {
    font-size: 14px;
    padding: 10px;
  }

  .close-modal {
    width: 28px;
    height: 28px;
    font-size: 24px;
  }
}