/* ============================================
   PawSitter 共用樣式
   配色：奶茶橘 + 薄荷綠 + 米白
   ============================================ */

:root {
  --primary: #F5A86C;          /* 奶茶橘 */
  --primary-dark: #E08A4D;
  --secondary: #88C9A1;        /* 薄荷綠 */
  --secondary-dark: #5FA67C;
  --bg: #FFF7EE;               /* 米白 */
  --bg-2: #FCE9D4;
  --text: #4A3728;             /* 深咖啡 */
  --text-soft: #8A7B6B;
  --card: #FFFFFF;
  --shadow: 0 8px 24px rgba(74, 55, 40, 0.08);
  --shadow-hover: 0 14px 32px rgba(74, 55, 40, 0.15);
  --radius: 18px;
  --disabled: #C9C0B6;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* 背景 Canvas */
#bgCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============== 頂部錢包 Bar ============== */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(245, 168, 108, 0.18);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 12px rgba(74, 55, 40, 0.05);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 20px;
  color: var(--primary-dark);
}

.brand .paw {
  font-size: 22px;
  animation: paw-wiggle 2.4s ease-in-out infinite;
}

@keyframes paw-wiggle {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(8deg); }
}

.wallet-info {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.wallet-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 24px;
  font-weight: 700;
  font-size: 14px;
}

.wallet-chip.money {
  background: linear-gradient(135deg, #FFE6CC, #FFD0A6);
  color: #B66C2A;
}

.wallet-chip.orders {
  background: linear-gradient(135deg, #D6F0E0, #B6E1C7);
  color: #3E7A55;
}

.wallet-chip .icon {
  font-size: 16px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F5A86C, #E08A4D);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform .2s;
}
.avatar:hover { transform: scale(1.08); }

/* ============== 按鈕 ============== */
.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 16px;
  padding: 14px 28px;
  border-radius: 14px;
  transition: all .25s cubic-bezier(.4,.0,.2,1);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 6px 16px rgba(245, 168, 108, 0.4);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(245, 168, 108, 0.55);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
  color: #fff;
  box-shadow: 0 6px 16px rgba(136, 201, 161, 0.4);
}
.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(136, 201, 161, 0.55);
}

.btn-ghost {
  background: #fff;
  color: var(--text);
  border: 2px solid var(--bg-2);
}
.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.btn-disabled {
  background: var(--disabled);
  color: #fff;
  cursor: not-allowed;
  position: relative;
}
.btn-disabled:hover { transform: none; }

/* 點擊漣漪 */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--rx, 50%) var(--ry, 50%), rgba(255,255,255,.4) 0%, transparent 60%);
  opacity: 0;
  transition: opacity .4s;
}
.btn:active::after { opacity: 1; transition: opacity 0s; }

/* ============== 通用 ============== */
.container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.h1 {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
  text-align: center;
}

.h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.subtitle {
  font-size: 16px;
  color: var(--text-soft);
  margin-bottom: 36px;
  text-align: center;
}

.step-dots {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}
.step-dots .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--bg-2);
}
.step-dots .dot.active {
  background: var(--primary);
  width: 24px;
  border-radius: 4px;
}

/* Toast */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(74, 55, 40, 0.92);
  color: #fff;
  padding: 12px 22px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transition: all .3s;
  z-index: 100;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 600px) {
  .top-bar { padding: 10px 14px; gap: 8px; }
  .brand { font-size: 16px; }
  .wallet-chip { padding: 6px 10px; font-size: 12px; }
  .h1 { font-size: 24px; }
  .h2 { font-size: 18px; }
  .avatar { width: 30px; height: 30px; font-size: 12px; }
}

/* ============== Modal ============== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(74, 55, 40, 0.4);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop.show { display: flex; animation: fade-in .25s ease; }
@keyframes fade-in { from { opacity: 0 } to { opacity: 1 } }

.modal {
  background: #fff;
  border-radius: 20px;
  max-width: 380px;
  width: 100%;
  padding: 32px 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  text-align: center;
  animation: modal-pop .35s cubic-bezier(.34,1.56,.64,1);
}
@keyframes modal-pop {
  0%   { opacity: 0; transform: scale(.85) translateY(20px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 32px;
}
.modal-icon.loading {
  background: var(--bg-2);
}
.modal-icon.success {
  background: linear-gradient(135deg, #B6E1C7, #88C9A1);
  color: #fff;
  animation: success-pop .5s cubic-bezier(.34,1.56,.64,1);
}
@keyframes success-pop {
  0%   { transform: scale(.4); opacity: 0; }
  60%  { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); }
}

.spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 4px solid var(--bg-2);
  border-top-color: var(--primary);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.modal h3 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
}
.modal p {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.6;
  margin-bottom: 22px;
}
.modal .info-card {
  background: var(--bg);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--text);
  text-align: left;
}
.modal .info-card div { margin: 4px 0; }
.modal .info-card .label { color: var(--text-soft); display: inline-block; width: 60px; }
.modal-actions {
  display: flex;
  gap: 10px;
}
.modal-actions .btn { flex: 1; }
