/* ==========================================================================
   會員中心頁專屬樣式
   ========================================================================== */

.member-main {
  padding: 40px 0 72px;
}

.member-layout {
  display: grid;
  grid-template-columns: 253px 1fr;
  gap: 24px;
  align-items: start;
}

/* Sidebar */

.member-sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.profile-card {
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 22px;
  text-align: center;
}

.profile-avatar {
  width: 87px;
  height: 87px;
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: var(--shadow-md);
  object-fit: cover;
  margin: 0 auto 12px;
  display: block;
}

.profile-card h2 {
  font-size: 18px;
  margin: 0 0 4px;
}

.profile-card .email {
  font-size: 12.5px;
  color: var(--color-text-muted);
  margin: 0 0 16px;
}

.points-card {
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  padding: 14px;
  color: #fff;
  text-align: left;
}

.points-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 8px;
}

.points-card-head svg {
  width: 18px;
  height: 18px;
}

.points-value {
  font-size: 27px;
  font-weight: 700;
  text-align: center;
  margin: 0 0 6px;
}

.points-card .member-since {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  margin: 0;
}

.member-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.member-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.6);
  font-family: inherit;
  font-size: 14.5px;
  color: var(--color-text);
  text-align: left;
  position: relative;
}

.member-nav button svg {
  width: 18px;
  height: 18px;
  color: var(--color-text);
}

.member-nav button.is-active {
  background: #fff;
  box-shadow: var(--shadow-sm);
  color: var(--color-primary);
  font-weight: 500;
}

.member-nav button.is-active svg {
  color: var(--color-primary);
}

.member-nav button.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: var(--radius-pill) 0 0 var(--radius-pill);
  background: var(--gradient-primary);
}

.member-nav button:disabled {
  background: transparent;
  color: var(--color-text-muted);
  cursor: not-allowed;
}

.member-nav button:disabled svg {
  color: var(--color-text-muted);
  opacity: 0.6;
}

.member-nav .planned-tag {
  margin-left: auto;
}

/* Panels */

.member-panel {
  display: none;
}

.member-panel.is-active {
  display: block;
}

.member-panel-head {
  margin-bottom: 22px;
}

.member-panel-head h2 {
  font-size: 22px;
  margin: 0 0 4px;
}

.member-panel-head p {
  margin: 0;
  font-size: 12.5px;
  color: var(--color-text-muted);
}

.wallet-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.wallet-card {
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 22px;
}

.wallet-card.is-muted {
  opacity: 0.65;
  box-shadow: var(--shadow-sm);
}

.wallet-card-top {
  border-bottom: 1.5px dashed var(--color-border);
  padding-bottom: 14px;
  margin-bottom: 14px;
}

.wallet-card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.wallet-card-title-row h3 {
  font-size: 16px;
  margin: 0 0 4px;
}

.wallet-code {
  font-family: "SFMono-Regular", Menlo, monospace;
  font-size: 11px;
  color: var(--color-text-muted);
}

.wallet-status {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
}

.wallet-status svg {
  width: 12px;
  height: 12px;
}

.wallet-status.tone-ok {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.wallet-status.tone-soon {
  background: #fff4e0;
  color: var(--color-warning);
}

.wallet-status.tone-delay {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.wallet-status.tone-pending {
  background: var(--color-neutral-bg);
  color: var(--color-text-muted);
}

.wallet-detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  margin-bottom: 8px;
}

.wallet-detail-row span:first-child {
  color: var(--color-text-muted);
}

.wallet-detail-row span:last-child {
  font-weight: 500;
}

.wallet-actions {
  display: flex;
  gap: 10px;
}

.wallet-qr-btn,
.wallet-transfer-btn {
  flex: 1;
  border: none;
  border-radius: var(--radius-lg);
  padding: 12px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.wallet-qr-btn {
  background: var(--gradient-primary);
  color: #fff;
}

.wallet-transfer-btn {
  background: #fff;
  border: 1.5px solid var(--color-border);
  color: var(--color-text);
}

.wallet-qr-btn svg,
.wallet-transfer-btn svg {
  width: 16px;
  height: 16px;
}

.wallet-qr-btn:disabled,
.wallet-transfer-btn:disabled {
  background: var(--color-bg);
  color: var(--color-text-muted);
  border-color: transparent;
  cursor: not-allowed;
}

.placeholder-note {
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 40px 24px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 14px;
}

/* QR Modal（沿用 style.css 的 .modal-overlay / .modal-panel），這裡只放 QR 專屬內容樣式 */

.qr-modal-body {
  text-align: center;
}

.qr-modal-body .wallet-code {
  display: block;
  margin-bottom: 18px;
}

.qr-placeholder {
  width: 180px;
  height: 180px;
  margin: 0 auto 18px;
  border-radius: var(--radius-md);
  background: repeating-conic-gradient(#1a1a1a 0% 25%, #fff 0% 50%) 0 0 / 20px 20px;
  border: 8px solid #fff;
  outline: 1.5px solid var(--color-border);
}

/* 票券轉贈表單 */

.transfer-form {
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 24px;
  max-width: 480px;
}

.form-field {
  margin-bottom: 18px;
}

.form-field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
}

.form-field select,
.form-field input {
  width: 100%;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 15px;
  color: var(--color-text);
}

.form-field input.has-error,
.form-field select.has-error {
  border-color: var(--color-danger);
}

.form-error {
  display: none;
  align-items: center;
  gap: 6px;
  color: var(--color-danger);
  font-size: 12.5px;
  margin-top: 6px;
}

.form-error.is-visible {
  display: flex;
}

.form-error svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.transfer-rules {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  padding: 14px;
  font-size: 12.5px;
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: 18px;
}

.transfer-confirm-card {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 18px;
  font-size: 13.5px;
}

.transfer-confirm-card div {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.transfer-confirm-card div:last-child {
  margin-bottom: 0;
}

.transfer-actions {
  display: flex;
  gap: 10px;
}

.transfer-actions .btn-outline {
  flex: 1;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 13px;
  background: #fff;
  color: var(--color-text);
  font-size: 14px;
  font-weight: 500;
}

.transfer-actions .btn-primary {
  flex: 1;
}

@media (max-width: 900px) {
  .member-layout {
    grid-template-columns: 1fr;
  }

  .wallet-grid {
    grid-template-columns: 1fr;
  }
}
