/* ==================== 登入/註冊模態框 - 新設計 ==================== */

/* 模態框基礎樣式 */
.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.auth-modal-content {
  position: relative;
  background: white;
  border-radius: 16px;
  padding: 40px;
  max-width: 480px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 32px;
  color: #999;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.auth-modal-close:hover {
  background: #f5f5f5;
  color: #333;
}

/* 訊息提示 */
.auth-message {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.5;
}

.auth-message.error {
  background: #fee;
  color: #c33;
  border: 1px solid #fcc;
}

.auth-message.success {
  background: #efe;
  color: #3c3;
  border: 1px solid #cfc;
}

.auth-message.info {
  background: #eef;
  color: #33c;
  border: 1px solid #ccf;
}

/* 表單容器 */
.auth-form-container {
  animation: fadeIn 0.3s ease-out;
}

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

.auth-title {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 8px 0;
  text-align: center;
}

.auth-subtitle {
  font-size: 14px;
  color: #666;
  margin: 0 0 32px 0;
  text-align: center;
  line-height: 1.6;
}

.auth-subtitle strong {
  color: #1a1a1a;
  font-weight: 600;
}

/* 新會員註冊即送樣式 */
.new-member-bonus {
  background: linear-gradient(135deg, #FFF8E1 0%, #FFE082 100%);
  border: 2px solid #FFA500;
  border-radius: 12px;
  padding: 16px 20px;
  margin: 0 0 24px 0;
  display: flex;
  align-items: center;
  gap: 16px;
  animation: bonusPulse 2s ease-in-out infinite;
}

@keyframes bonusPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(255, 165, 0, 0.2);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(255, 165, 0, 0.4);
  }
}

.bonus-icon {
  flex-shrink: 0;
  animation: bonusRotate 3s ease-in-out infinite;
}

@keyframes bonusRotate {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-10deg);
  }
  75% {
    transform: rotate(10deg);
  }
}

.bonus-content {
  flex: 1;
}

.bonus-title {
  font-size: 14px;
  font-weight: 600;
  color: #E65100;
  margin-bottom: 4px;
}

.bonus-amount {
  font-size: 18px;
  font-weight: 700;
  color: #F57C00;
}

.bonus-amount span {
  color: #E65100;
}

/* 表單樣式 */
.auth-form {
  width: 100%;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 20px;
}

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

.required {
  color: #e74c3c;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group select {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  transition: all 0.2s;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #FC3130;
  box-shadow: 0 0 0 3px rgba(252, 49, 48, 0.1);
}

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

.form-hint {
  display: block;
  font-size: 12px;
  color: #999;
  margin-top: 6px;
}

/* 手機號碼輸入組 */
.phone-input-group {
  display: flex;
  align-items: center;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s;
}

.phone-input-group:focus-within {
  border-color: #FC3130;
  box-shadow: 0 0 0 3px rgba(252, 49, 48, 0.1);
}

.phone-prefix {
  background: #f5f5f5;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 600;
  color: #333;
  border-right: 2px solid #e0e0e0;
}

.phone-input-group input {
  flex: 1;
  border: none !important;
  padding: 12px 16px;
  font-size: 16px;
}

.phone-input-group input:focus {
  box-shadow: none !important;
}

/* OTP 輸入組 */
.otp-input-group {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
}

.otp-input {
  width: 50px;
  height: 56px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  transition: all 0.2s;
}

.otp-input:focus {
  outline: none;
  border-color: #FC3130;
  box-shadow: 0 0 0 3px rgba(252, 49, 48, 0.1);
}

.otp-input.filled {
  border-color: #FC3130;
  background: #fff5f5;
}

.otp-input.error {
  border-color: #e74c3c;
  background: #fee;
}

/* 按鈕樣式 */
.auth-submit-btn {
  width: 100%;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #FC3130 0%, #B43228 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.auth-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(252, 49, 48, 0.4);
}

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

.auth-submit-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* OTP 操作按鈕 */
.otp-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

.link-btn {
  background: none;
  border: none;
  color: #FC3130;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.2s;
}

.link-btn:hover {
  background: #fff5f5;
}

.link-btn:disabled {
  color: #999;
  cursor: not-allowed;
}

.link-btn:disabled:hover {
  background: none;
}

/* 切換登入/註冊鏈接 */
.auth-switch-link {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: #666;
}

.auth-switch-link a {
  color: #FC3130;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}

.auth-switch-link a:hover {
  color: #B43228;
  text-decoration: underline;
}

/* 電郵驗證提示樣式 */
.success-icon {
  font-size: 64px;
  text-align: center;
  margin-bottom: 16px;
  animation: bounceIn 0.6s ease-out;
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
  }
}

.info-box {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.info-label {
  color: #666;
}

.info-value {
  font-weight: 700;
  color: #FC3130;
  font-size: 16px;
}

.warning-box {
  background: #fff3cd;
  border: 2px solid #ffc107;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
  text-align: center;
}

.warning-box p {
  margin: 0;
  font-size: 14px;
  color: #856404;
  line-height: 1.6;
}

.warning-box .mt-2 {
  margin-top: 8px;
}

.email-display {
  font-weight: 700;
  color: #1a1a1a;
  font-size: 15px;
}

.feature-list {
  background: #fff5f5;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 24px;
}

.feature-list p {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.feature-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.feature-list li {
  font-size: 14px;
  color: #666;
  padding: 6px 0;
  line-height: 1.6;
}

.resend-link {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: #666;
}

.resend-link a {
  color: #FC3130;
  font-weight: 600;
  text-decoration: none;
}

.resend-link a:hover {
  text-decoration: underline;
}

/* 響應式設計 */
@media (max-width: 768px) {
  .auth-modal {
    align-items: flex-start;
    padding: 20px 0;
    overflow-y: auto;
  }
  
  .auth-modal-content {
    padding: 32px 24px;
    width: 95%;
    max-height: none;
    margin: auto;
  }
  
  .auth-title {
    font-size: 24px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  
  .otp-input-group {
    gap: 8px;
  }
  
  .otp-input {
    width: 44px;
    height: 52px;
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .auth-modal {
    padding: 10px 0;
  }
  
  .auth-modal-content {
    padding: 24px 20px;
    max-height: none;
  }
  
  .auth-title {
    font-size: 22px;
  }
  
  .otp-input {
    width: 40px;
    height: 48px;
    font-size: 18px;
  }
}



/* 返回按鈕樣式 */
.auth-back-btn {
  width: 100%;
  padding: 14px 24px;
  margin-top: 12px;
  background: transparent;
  color: #666;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-back-btn:hover {
  background: #f5f5f5;
  border-color: #ccc;
  color: #333;
}

.auth-back-btn:active {
  transform: scale(0.98);
}

/* 成功圖標樣式 */
.success-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8f5e9;
  border-radius: 50%;
}

.success-icon svg {
  width: 48px;
  height: 48px;
}

/* 郵箱驗證資訊樣式 */
.email-verification-info {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  text-align: left;
}

.email-verification-info p {
  margin: 0 0 12px 0;
  color: #666;
  font-size: 14px;
  line-height: 1.6;
}

.email-verification-info .info-note {
  font-weight: 600;
  color: #333;
  margin-top: 16px;
}

.email-verification-info ul {
  margin: 8px 0 0 0;
  padding: 0 0 0 20px;
  list-style: none;
}

.email-verification-info ul li {
  color: #666;
  font-size: 14px;
  line-height: 1.8;
  position: relative;
  padding-left: 0;
}

.resend-link {
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
  color: #666;
}

.resend-link a {
  color: #FC3130;
  text-decoration: none;
  font-weight: 500;
}

.resend-link a:hover {
  text-decoration: underline;
}

