/* =====================================================================
   Ô NHẬP & TRANG THANH TOÁN
   ===================================================================== */

/* ---------- Ô nhập chung (.input) – sửa lỗi co chiều cao trong .ff ---------- */
.ff .input, .ff textarea.input, .ff select.input { flex: none; }
.input {
  height: 48px; padding: 0 14px; border-radius: 10px; font-size: 15px;
  background: var(--bg-2); border: 1.5px solid transparent; color: var(--text);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.input::placeholder { color: #9e9e9e; }
.input:hover { background: #efefef; }
.input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(255, 91, 0, .12); }
select.input {
  appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23757575%22 stroke-width=%222%22 stroke-linecap=%22round%22%3E%3Cpath d=%22M6 9l6 6 6-6%22/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
}
textarea.input { height: auto; padding: 12px 14px; min-height: 88px; line-height: 1.5; }
.filters .input { height: 42px; }

/* ---------- Ô nhập có nhãn + icon (.fld) ---------- */
.fld { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; min-width: 0; }
.fld__label { font-size: 14px; font-weight: 600; color: var(--text); }
.fld__label i { font-style: normal; color: #d93025; }
.fld__ctl {
  position: relative; display: flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 0 14px; border-radius: 12px;
  background: var(--bg-2); border: 1.5px solid transparent;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.fld__ctl:hover { background: #efefef; }
.fld__ctl:focus-within { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(255, 91, 0, .12); }
.fld__ico { color: #8c8c8c; }
.fld__ctl:focus-within .fld__ico { color: var(--primary); }
.fld__input {
  flex: 1; min-width: 0; height: 50px; border: 0; outline: none; background: transparent;
  font: inherit; font-size: 15px; font-weight: 500; color: var(--text);
}
.fld__input::placeholder { color: #a6a6a6; font-weight: 400; }
select.fld__input { appearance: none; cursor: pointer; padding-right: 26px; }
.fld__chev { position: absolute; right: 14px; color: #8c8c8c; pointer-events: none; }
.fld--area .fld__ctl { align-items: flex-start; }
textarea.fld__input { height: auto; padding: 13px 0; resize: vertical; line-height: 1.5; }
.fld__suffix { display: flex; align-items: center; }
.fld__suffix .paylogo { width: 40px; height: 25px; }
.fld__err { font-size: 12.5px; color: #d93025; }
.fld__err:empty { display: none; }
.fld__hint { font-size: 12.5px; color: var(--text-3); }
.fld--err .fld__ctl { border-color: #d93025; background: #fff6f5; }
.fld--err .fld__ico { color: #d93025; }
.fld--err .fld__hint { display: none; }
.fld-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

/* ---------- Khối trang thanh toán ---------- */
.co-card { padding: 24px; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.co-card__head { display: flex; gap: 14px; margin-bottom: 20px; }
.co-card__head h2 { font-size: 19px; line-height: 1.3; }
.co-card__head p { font-size: 13px; color: var(--text-3); }
.co-step { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; font-weight: 700; }
.co-login { display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 18px; border-radius: 12px; background: var(--primary-soft); color: var(--text-2); }
.co-login .i { color: var(--primary); }
.co-login a { color: var(--primary); font-weight: 700; }
.co-secure { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 12.5px; color: var(--text-3); }

/* Phương thức thanh toán */
.pay-list { display: flex; flex-direction: column; gap: 10px; }
.pay-item {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s;
}
.pay-item:hover { border-color: #c9c9c9; }
.pay-item input { position: absolute; opacity: 0; pointer-events: none; }
.pay-item__radio { flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #8c8c8c; display: grid; place-items: center; }
.pay-item__radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); transform: scale(0); transition: transform .15s; }
.pay-item__text { flex: 1; min-width: 0; }
.pay-item__text b { display: block; font-size: 15px; }
.pay-item__text small { color: var(--text-3); }
.pay-item__logos { display: flex; gap: 6px; }
.paylogo { width: 46px; height: 28px; border-radius: 4px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
.pay-item:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.pay-item:has(input:checked) .pay-item__radio { border-color: var(--primary); }
.pay-item:has(input:checked) .pay-item__radio::after { transform: scale(1); }
.pay-item:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }

.pay-panel { margin-top: 16px; padding: 20px; border-radius: 14px; background: #fafafa; border: 1px solid var(--line); }
.pay-panel[hidden] { display: none; }
.pay-panel .fld__ctl { background: #fff; border-color: var(--line); }
.pay-panel .fld__ctl:hover { border-color: #c9c9c9; }
.pay-panel .fld__ctl:focus-within { border-color: var(--primary); }
.pay-panel .fld--err .fld__ctl { border-color: #d93025; background: #fff6f5; }

/* Thẻ xem trước */
.cc { display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: start; }
.cc__preview {
  position: relative; aspect-ratio: 1.586; padding: 18px 20px; border-radius: 16px; color: #fff; overflow: hidden;
  background: linear-gradient(135deg, #2b2b2b 0%, #4a4a4a 55%, #ff5b00 160%);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .22);
  display: flex; flex-direction: column; justify-content: space-between;
}
.cc__preview::after { content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255, 255, 255, .07); }
.cc__top { display: flex; justify-content: space-between; align-items: center; min-height: 32px; }
.cc__chip { width: 40px; height: 30px; border-radius: 6px; background: linear-gradient(135deg, #f3d27a, #c9a14a); }
.cc__brand .paylogo { width: 52px; height: 32px; }
.cc__num { font-family: ui-monospace, "Courier New", monospace; font-size: 19px; letter-spacing: 2px; }
.cc__bottom { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.cc__bottom small { display: block; font-size: 10px; opacity: .7; text-transform: uppercase; letter-spacing: .5px; }
.cc__bottom span { display: block; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; letter-spacing: .5px; }
.cc__fields .fld-grid .fld { margin-bottom: 0; }

/* Ví điện tử & ngân hàng */
.wallet { display: flex; align-items: center; gap: 20px; }
.wallet .qr { flex-shrink: 0; width: 132px; height: 132px; border: 1px solid var(--line); }
.wallet p { color: var(--text-2); font-size: 14px; margin-top: 4px; }
.banks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 10px; }
.bank { position: relative; cursor: pointer; }
.bank input { position: absolute; opacity: 0; pointer-events: none; }
.bank span {
  display: grid; place-items: center; height: 48px; padding: 0 8px; border-radius: 10px;
  background: #fff; border: 1.5px solid var(--line); font-weight: 700; font-size: 13px; text-align: center; transition: .15s;
}
.bank:hover span { border-color: #c9c9c9; }
.bank input:checked + span { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.bank input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.pay-panel .fld__err { margin-top: 8px; }

/* Đồng ý điều khoản */
.agree { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 4px 2px; cursor: pointer; color: var(--text-2); }
.agree input { position: absolute; opacity: 0; pointer-events: none; }
.agree__box {
  flex-shrink: 0; width: 22px; height: 22px; margin-top: 1px; border-radius: 6px;
  border: 1.5px solid #8c8c8c; display: grid; place-items: center; color: transparent; transition: .15s;
}
.agree input:checked + .agree__box { background: var(--primary); border-color: var(--primary); color: #fff; }
.agree input:focus-visible + .agree__box { outline: 2px solid var(--primary); outline-offset: 2px; }
.agree a { color: var(--primary); font-weight: 600; }
.agree--err .agree__box { border-color: #d93025; box-shadow: 0 0 0 3px rgba(217, 48, 37, .15); }

.btn--lg { height: 52px; font-size: 16px; border-radius: 12px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .cc { grid-template-columns: 1fr; }
  .cc__preview { max-width: 340px; }
  .banks { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .fld-grid { grid-template-columns: 1fr; }
  .co-card { padding: 18px 14px; }
  .pay-panel { padding: 14px; }
  .pay-item__logos .paylogo:nth-child(n+2) { display: none; }
  .wallet { flex-direction: column; align-items: flex-start; }
  .banks { grid-template-columns: repeat(2, 1fr); }
}
