/* ============================================================
   The Rent Guru — pay.trg.im
   Modern, mobile-first reservation payment page.
   ============================================================ */

:root {
  --green: #5eb51c;        /* primary action (darker TRG green for contrast) */
  --green-dark: #4c9a15;
  --lime: #7ed321;         /* brand accent */
  --ink: #1d2330;
  --muted: #6b7280;
  --line: #e2e6ee;
  --bg: #f4f6f9;
  --card: #ffffff;
  --error: #b91c1c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 640px; margin: 0 auto; padding: 20px 16px 48px; }

.site-head { display: flex; justify-content: center; padding: 12px 0 20px; }
.logo { height: 56px; width: auto; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(20, 30, 60, 0.06);
  padding: clamp(20px, 5vw, 36px);
}

.card-head h1 { font-size: clamp(21px, 5vw, 26px); font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.card-head .sub { color: var(--muted); font-size: 14.5px; margin: 6px 0 0; }
.card-head .sub strong { color: var(--ink); }

.section { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 22px; }
.section:first-of-type { border-top: none; margin-top: 18px; padding-top: 0; }
.section h2 { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; margin: 0 0 16px; }
.step {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: #eef7e6; color: var(--green-dark);
  font-size: 13.5px; font-weight: 700; flex: none;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 540px) { .grid-2 { grid-template-columns: 1fr; } }

.field { margin-bottom: 14px; min-width: 0; }
.field label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.hint-inline { color: var(--muted); font-weight: 400; }

.field input {
  width: 100%; padding: 12px 14px;
  border: 1px solid #cfd6e2; border-radius: 10px;
  font: inherit; font-size: 16px; color: var(--ink);
  background: #fff;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.field input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(94, 181, 28, 0.18); }
.field.invalid input { border-color: var(--error); }
.field .field-error { display: none; color: var(--error); font-size: 12.5px; margin-top: 5px; }
.field.invalid .field-error { display: block; }

.seg { display: flex; gap: 8px; }
.seg-btn {
  flex: 1; padding: 12px 8px;
  background: #fff; border: 1px solid #cfd6e2; border-radius: 10px;
  font: inherit; font-size: 14.5px; font-weight: 600; color: var(--ink);
  cursor: pointer; transition: border-color 0.12s, background 0.12s;
  white-space: nowrap;
}
.seg-btn:hover { border-color: var(--green); }
.seg-btn.selected {
  background: #eef7e6; border-color: var(--green);
  color: var(--green-dark); box-shadow: 0 0 0 1px var(--green) inset;
}
.field.invalid .seg-btn { border-color: var(--error); }
@media (max-width: 420px) { .seg { flex-direction: column; } .seg-btn { white-space: normal; } }

.amount-box { position: relative; }
.amount-box .currency {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-weight: 600; pointer-events: none;
}
.amount-box input { padding-left: 30px; }

.note { color: var(--muted); font-size: 13.5px; line-height: 1.55; margin: 4px 0 0; }
.linklike {
  background: none; border: none; padding: 0; font: inherit;
  color: var(--green-dark); font-weight: 600; cursor: pointer; text-decoration: underline;
}

#payment-element { margin: 6px 0 4px; }
.pe-placeholder {
  border: 1px dashed #cfd6e2; border-radius: 10px; padding: 22px 14px;
  color: var(--muted); font-size: 14px; text-align: center;
}

.errorBox {
  display: none; margin-top: 12px; padding: 11px 14px;
  background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px;
  color: var(--error); font-size: 14px; line-height: 1.5;
}
.errorBox.show { display: block; }

#payBtn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; margin-top: 16px; padding: 15px 20px;
  background: var(--green); border: none; border-radius: 12px;
  color: #fff; font: inherit; font-size: 16.5px; font-weight: 700;
  cursor: pointer; transition: background 0.12s;
}
#payBtn:hover { background: var(--green-dark); }
#payBtn:disabled { opacity: 0.6; cursor: default; }
#payBtn svg { width: 18px; height: 18px; }

.secure-note {
  display: flex; align-items: flex-start; gap: 8px;
  color: var(--muted); font-size: 12.5px; line-height: 1.55; margin: 14px 0 0;
}
.secure-note svg { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--green-dark); }

.site-foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 22px; }
.site-foot a { color: var(--muted); }

/* ---- Property search dropdown ---- */
.prop-wrap { position: relative; }
.prop-panel {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  background: #fff; border: 1px solid #cfd6e2; border-radius: 12px;
  box-shadow: 0 12px 32px rgba(20, 30, 60, 0.16);
  max-height: 300px; overflow-y: auto; overscroll-behavior: contain;
}
.prop-opt {
  padding: 11px 14px; font-size: 14.5px; color: var(--ink);
  cursor: pointer; border-bottom: 1px solid var(--line);
}
.prop-opt:last-child { border-bottom: none; }
.prop-opt:hover, .prop-opt.active { background: #eef7e6; }
.prop-manual {
  position: sticky; bottom: 0; background: #f8fafc;
  color: var(--muted); font-size: 13.5px; font-weight: 600;
  border-top: 1px solid var(--line);
}
.prop-manual:hover, .prop-manual.active { background: #f1f4f8; }
.prop-none { padding: 11px 14px; color: var(--muted); font-size: 13.5px; }

/* ---- Billing address lookup ---- */
.pc-row { display: flex; gap: 8px; }
.pc-row input { flex: 1; min-width: 0; }
.pc-row .btn-ghost { flex: none; white-space: nowrap; }
.pc-results {
  display: block; width: 100%; margin-top: 10px; padding: 12px 14px;
  border: 1px solid #cfd6e2; border-radius: 10px;
  font: inherit; font-size: 15px; color: var(--ink); background: #fff;
}
.pc-msg { color: var(--muted); font-size: 12.5px; margin: 6px 0 0; min-height: 0; }
.pc-msg:empty { display: none; }

/* ---- Bank transfer dialog ---- */
dialog#bankDialog {
  border: none; border-radius: 16px; padding: 22px;
  width: min(92vw, 520px);
  box-shadow: 0 24px 60px rgba(10, 20, 40, 0.35);
}
dialog#bankDialog::backdrop { background: rgba(8, 12, 20, 0.55); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dialog-head h3 { margin: 0; font-size: 18px; }
.dialog-close {
  background: #eef1f6; border: none; width: 34px; height: 34px; border-radius: 50%;
  font-size: 20px; line-height: 1; cursor: pointer; color: var(--ink);
}
.dialog-actions { display: flex; gap: 8px; margin: 10px 0 14px; }
.btn-ghost {
  background: #fff; border: 1px solid #cfd6e2; border-radius: 8px;
  padding: 8px 14px; font: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--ink); cursor: pointer;
}
.btn-ghost:hover { background: #f4f6f9; }
.bank-list { margin: 0; font-size: 14px; }
.bank-list div { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.bank-list dt { flex: 0 0 140px; color: var(--muted); }
.bank-list dd { margin: 0; font-weight: 600; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.copy-line {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px;
  background: #fff; border: 1px solid #cfe8b8; color: var(--lime); cursor: pointer;
  position: relative;
}
.copy-line:hover { background: #f3fbe9; color: var(--green-dark); border-color: var(--lime); }
.copy-line svg { width: 14px; height: 14px; }
.copy-line.copied { border-color: var(--green); color: var(--green-dark); }
.copy-line.copied::after {
  content: '✓'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: #eef7e6; border-radius: 7px; font-weight: 700; font-size: 14px;
}
.copy-line.copied svg { visibility: hidden; }
@media (max-width: 540px) { .bank-list dt { flex-basis: 108px; } }
.bank-ref { font-size: 13.5px; color: var(--muted); line-height: 1.55; margin: 14px 0 0; }

/* ---- Thank-you page ---- */
.confirm-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: #eef7e6; color: var(--green-dark);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}
.confirm-icon svg { width: 30px; height: 30px; }
.confirm-title { text-align: center; font-size: clamp(21px, 5vw, 25px); margin: 0 0 4px; }
.confirm-sub { text-align: center; color: var(--muted); font-size: 14.5px; margin: 0 0 22px; }
.summary { margin: 0; font-size: 14.5px; }
.summary div { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.summary div:last-child { border-bottom: none; }
.summary dt { flex: 0 0 150px; color: var(--muted); }
.summary dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.status-pill {
  display: inline-block; padding: 3px 12px; border-radius: 999px;
  background: #eef7e6; color: var(--green-dark); font-weight: 700; font-size: 13px;
}
.status-pill.pending { background: #fef9e7; color: #92400e; }
.status-pill.failed { background: #fef2f2; color: var(--error); }
.back-btn {
  display: block; text-align: center; margin-top: 22px; padding: 14px 20px;
  background: var(--green); border-radius: 12px;
  color: #fff; font-weight: 700; text-decoration: none;
}
.back-btn:hover { background: var(--green-dark); }
@media (max-width: 540px) {
  .summary dt { flex-basis: 120px; }
}
