/* =========================================================
   topup.css — หน้าเติมเงิน + หน้าประวัติเติมเงิน
   ========================================================= */

/* ---------- หน้าเติมเงิน ---------- */
.topup { max-width: 520px; margin: 0 auto; padding-bottom: 28px; }
.topup-intro { line-height: 1.5; }
.topup-intro small { display: block; font-size: 13px; color: var(--c-blue-pale); }
.topup-intro p { font-size: 17px; color: var(--c-blue); }

.bank { margin-top: 22px; text-align: center; }
.bank-name { font-size: 14px; font-weight: 500; color: var(--c-text); }
.account-box {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  margin-top: 10px;
  padding: 4px 4px 4px 12px;
  border: 1px solid var(--c-blue);
  border-radius: 12px;
  background: #fff;
}
.account-no { font-size: 22px; font-weight: 500; letter-spacing: 0.5px; color: var(--c-text); }
.copy-acc {
  width: 40px;
  height: 40px;
  border: 1px solid var(--c-blue);
  border-radius: 10px;
  background: var(--c-cream);
  color: var(--c-blue);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
}
.copy-acc svg { width: 22px; height: 22px; }
.copy-acc.is-done { background: var(--c-green); border-color: var(--c-green); color: #fff; }
.account-name { margin-top: 10px; font-size: 20px; font-weight: 500; color: var(--c-text); }
.account-name strong { font-weight: 500; color: #0D74E3; }
.bank-warn { font-size: 12px; color: var(--c-red); }
.bank-howto { margin-top: 16px; font-size: 17px; line-height: 1.5; color: var(--c-blue); }

/* กรอบอัปโหลดสลิป */
.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  margin-top: 24px;
  padding: 16px;
  border: 1.5px dashed var(--c-blue);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover,
.dropzone.is-dragover { border-color: var(--c-blue-strong); background: #F7FAFE; }
.dropzone:focus-within { border-color: var(--c-blue-strong); box-shadow: 0 0 0 3px rgba(94, 150, 210, 0.18); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone-content { display: flex; flex-direction: column; align-items: center; }
.dropzone-icon { width: 43px; }
.dropzone-title { margin-top: 10px; font-size: 17px; font-weight: 500; color: var(--c-text); }
.dropzone-sub { margin-top: 4px; font-size: 12px; line-height: 1.6; color: var(--c-blue); }
.dropzone-preview { max-height: 220px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); }

/* ระหว่างตรวจสลิป: ทับกรอบด้วยข้อความ + วงกลมหมุน */
.checking {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 500;
  color: var(--c-text);
}
.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--c-blue-soft);
  border-top-color: var(--c-blue-strong);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }
.topup .form-alert { margin-top: 12px; }

.topup-rules { margin-top: 24px; text-align: center; }
.topup-rules h2 { font-size: 22px; font-weight: 500; color: #4193EA; }
.topup-rules .rule-red { margin-top: 10px; font-size: 14px; font-weight: 500; line-height: 1.7; color: var(--c-red); }
.topup-rules .rule-red strong { font-weight: 700; }
.topup-rules .rule-blue { margin-top: 14px; font-size: 13px; font-weight: 500; line-height: 1.6; color: var(--c-blue-strong); }

.btn-outline-wide {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 40px;
  margin-top: 24px;
  border: 1px solid var(--c-blue);
  border-radius: 12px;
  background: var(--c-cream);
  color: var(--c-blue);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
}

/* ป๊อปอัปผลการเติมเงิน */
.result-amount { text-align: center; font-size: 30px; font-weight: 600; color: var(--c-green); }
.result-reason { text-align: center; font-size: 16px; font-weight: 500; color: var(--c-red); }
.result-icon { display: flex; justify-content: center; margin-bottom: 6px; }
.result-icon svg { width: 46px; height: 46px; }

/* ---------- หน้าประวัติเติมเงิน ---------- */
.topup-list { display: grid; gap: 16px; padding-bottom: 20px; }
.topup-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 8px;
  padding: 7px 8px 10px 5px;
  background: var(--c-cream);
  border: 1px solid var(--c-blue);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
}
.topup-icon {
  width: 34px;
  height: 34px;
  border: 1px solid var(--c-blue);
  border-radius: 50%;
  background: #fff;
  color: var(--c-text);
  display: flex;
  align-items: center;
  justify-content: center;
}
.topup-icon svg { width: 20px; height: 20px; }
.topup-amount { font-size: 22px; font-weight: 500; line-height: 1.35; color: var(--c-text); }
.topup-desc { font-size: 13px; line-height: 1.5; color: var(--c-blue); overflow-wrap: anywhere; }
.topup-desc.is-red { color: var(--c-red); }
.topup-date { font-size: 13px; line-height: 1.5; color: var(--c-blue); }
.status-pill {
  margin-top: 2px;
  padding: 1px 10px;
  border: 1px solid var(--c-text);
  border-radius: 999px;
  background: #DFE9F3;
  color: var(--c-text);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}
.status-pill.is-failed { border-color: #F3A3A3; background: var(--c-red-soft); color: var(--c-red-dark); }
.status-pill.is-refund { border-color: #E9C46A; background: #FFF4D6; color: #A86B00; }
.status-pill.is-admin { border-color: #B8A6E3; background: #F1ECFC; color: #6A4FB3; }
.topup-card.is-failed .topup-amount { color: var(--c-blue); }

@media (min-width: 640px) {
  .topup-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
