/* ====== 基礎重置 ====== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* ====== 註冊卡片 ====== */
.register-page {
  width: 100%;
  max-width: 480px;
}

.register-card {
  background: #fff;
  border-radius: 24px;
  padding: 48px 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* ====== 標題區 ====== */
.register-header {
  text-align: center;
  margin-bottom: 36px;
}

.register-header .logo {
  font-size: 20px;
  font-weight: 700;
  color: #6c5ce7;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.register-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 8px;
}

.register-header p {
  font-size: 15px;
  color: #888;
}

/* ====== 表單 ====== */
.register-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 14px;
  font-weight: 600;
  color: #555;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.label-icon {
  font-size: 16px;
}

.required {
  color: #e74c3c;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e8e8e8;
  border-radius: 12px;
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: #6c5ce7;
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

.form-input::placeholder {
  color: #ccc;
}

/* ====== 註冊按鈕 ====== */
.btn-register {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #6c5ce7, #5849c2);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.btn-register:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(108, 92, 231, 0.3);
}

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

.btn-register:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

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

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

/* ====== 底部連結 ====== */
.register-footer {
  text-align: center;
  margin-top: 28px;
}

.register-footer a {
  font-size: 14px;
  color: #6c5ce7;
  text-decoration: none;
  transition: color 0.2s;
}

.register-footer a:hover {
  color: #5849c2;
  text-decoration: underline;
}

/* ====== 成功彈窗 ====== */
.success-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.success-modal.show {
  opacity: 1;
  pointer-events: auto;
}

.success-card {
  background: #fff;
  border-radius: 24px;
  padding: 48px 40px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.8);
  transition: transform 0.3s;
}

.success-modal.show .success-card {
  transform: scale(1);
}

.success-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.success-card h2 {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 8px;
}

.success-card p {
  font-size: 15px;
  color: #888;
  margin-bottom: 28px;
}

.btn-close {
  padding: 12px 36px;
  background: #6c5ce7;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-close:hover {
  background: #5849c2;
}

/* ====== Toast ====== */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1a1a2e;
  color: #fff;
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 15px;
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.error {
  background: #e74c3c;
}

/* ====== 響應式 ====== */
@media (max-width: 480px) {
  .register-card {
    padding: 36px 24px;
  }

  .register-header h1 {
    font-size: 24px;
  }
}
