:root {
  --card: #ffffff;
  --primary: #dc2626;      /* đỏ — CTA & nhấn mạnh */
  --primary-d: #b91c1c;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --ok: #16a34a;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px 14px 40px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(160deg, #1c1917 0%, #44403c 60%, #dc2626 170%);
  color: var(--text);
}

.card {
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  padding: 22px 20px 24px;
}

/* --- Quote (phần nhấn mạnh, chữ TO) --- */
.quote { margin-bottom: 22px; }
.quote-main {
  margin: 0 0 14px;
  font-size: 1.32rem;
  font-weight: 700;
  line-height: 1.5;
  font-style: italic;
}
.quote-sub {
  margin: 0;
  font-size: 1.02rem;
  color: var(--text);
  line-height: 1.55;
  font-style: italic;
}

/* --- Fields (nhỏ, nằm ngang: nhãn trái · ô nhập phải) --- */
.field {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.field > span {
  flex: 0 0 78px;
  font-size: 0.82rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
}
.field-note { align-items: flex-start; }
.field-note > span { padding-top: 9px; }
.field .optional { color: var(--muted); font-weight: 400; font-style: normal; font-size: 0.72rem; }
.field .req { color: var(--primary); font-style: normal; }

input, textarea {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 9px 11px;
  font-size: 0.92rem;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text);
  resize: vertical;
}
input:focus, textarea:focus { outline: 2px solid var(--primary); background: #fff; }
input.invalid { border-color: var(--primary); background: #fef2f2; }

/* --- Tier buttons --- */
.tiers { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; }
.tier {
  flex: 1 1 calc(33.333% - 6px);
  min-width: 64px;
  padding: 9px 6px;
  font-size: 0.9rem;
  font-weight: 700;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text);
  cursor: pointer;
}
.tier.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35);
}

/* --- CTA bar (đỏ, dưới cùng) --- */
.cta-bar {
  width: 100%;
  margin-top: 8px;
  padding: 16px;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(220, 38, 38, 0.4);
}
.cta-bar:active { background: var(--primary-d); }
.cta-bar:disabled { opacity: 0.6; cursor: default; }

/* Nút "Em đã trả giá..." ở tab 2: tách khỏi hàng nút dưới, giảm bóng để không đè lên */
#done-transfer {
  margin-top: 4px;
  margin-bottom: 18px;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}
#step-qr .actions { margin-top: 4px; }

/* --- Step 2: QR --- */
.head h1 { margin: 0 0 4px; font-size: 1.3rem; }
.head .sub { margin: 0 0 18px; color: var(--muted); font-size: 0.9rem; }

.qr-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  min-height: 220px;
  margin-bottom: 16px;
}
#qr { width: 280px; max-width: 100%; height: auto; border-radius: 10px; }
.loading {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 0.9rem;
}

.info { margin: 0 0 16px; display: grid; gap: 9px; }
.info > div { display: flex; justify-content: space-between; gap: 10px; font-size: 0.92rem; }
.info dt { color: var(--muted); margin: 0; }
.info dd { margin: 0; font-weight: 600; text-align: right; word-break: break-word; }

.copy {
  margin-left: 6px; padding: 2px 8px; font-size: 0.72rem;
  border: 1px solid var(--primary); color: var(--primary);
  background: #fff; border-radius: 6px; cursor: pointer;
}

.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions button { min-width: 120px; }
.btn-secondary, .btn-ghost {
  flex: 1; padding: 12px; font-size: 0.95rem; font-weight: 600;
  border-radius: 10px; cursor: pointer;
}
.btn-secondary { color: #fff; background: var(--primary); border: none; }
.btn-ghost { color: var(--muted); background: #fff; border: 1px solid var(--border); }

/* --- Bước 3: cảm ơn --- */
.thanks { text-align: center; padding: 6px 0 4px; }
.thanks-img {
  width: 100%; max-width: 300px; height: auto;
  border-radius: 16px; margin: 0 auto 20px; display: block;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}
.thanks-title {
  font-size: 1.28rem; font-weight: 800; line-height: 1.4;
  color: var(--primary); margin: 0 0 16px;
}
.thanks-quote {
  font-size: 1.02rem; font-style: italic; line-height: 1.6;
  color: var(--text); margin: 0;
}

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--ok); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 0.88rem; box-shadow: 0 8px 20px rgba(0,0,0,.3); z-index: 9;
}
