/* ─────────────────────────────────────────────────────────────────────────
   HORMACHUELOS — the checkout pages

   Step 2 of a purchase: the GCash QR for the plan, the receipt upload and the
   "Done paying" confirmation on pay.html, and the order tracker on track.html.
   Same sky-blue glass as the rest of the site; nothing animates on its own.
   ───────────────────────────────────────────────────────────────────────── */

.pay-view[hidden],
.pay-thumb[hidden],
.pay-error[hidden] {
  display: none !important;
}

/* The payment card itself: the same glass as the account pages, but broad.
   A QR is the one thing on this page that must stay big enough to scan, and
   building the rest around it at dialog scale is what made the page feel
   magnified on a desktop - so the card uses the screen instead. */
.pay-page {
  display: grid;
  gap: 4px;
  width: min(840px, 100%);
  padding: 32px 40px 30px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 46px 90px -36px rgba(4, 40, 100, 0.7);
  color: var(--ink);
}

/* ── Head ───────────────────────────────────────────────────────────────── */

.pay-head {
  display: grid;
  gap: 4px;
}

.pay-step {
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.pay-head h1 {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ── The pay view ───────────────────────────────────────────────────────── */

.pay-amount {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 14px 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(10, 61, 143, 0.12);
}

.pay-pill {
  padding: 5px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #1667d8, #0b4ea2);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.pay-amount strong {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.pay-amount span.quiet {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}

/* ── Three ways to pay ──────────────────────────────────────────────────── */

.pay-methods {
  display: flex;
  gap: 6px;
  margin: 0 0 18px;
  padding: 5px;
  border-radius: 999px;
  border: 1px solid rgba(10, 61, 143, 0.12);
  background: rgba(14, 95, 203, 0.06);
}

.pay-method {
  flex: 1;
  padding: 9px 14px;
  border: 0;
  border-radius: 999px;
  background: none;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.pay-method.on {
  background: linear-gradient(180deg, #1667d8, #0b4ea2);
  color: var(--white);
  box-shadow: 0 8px 18px -12px rgba(4, 40, 100, 0.7);
}

.pay-method[hidden] {
  display: none;
}

.pay-pp {
  display: grid;
  gap: 14px;
  align-content: start;
}

.pay-pp[hidden] {
  display: none;
}

.pay-ppbtn {
  display: grid;
  gap: 6px;
  place-items: center;
  padding: 26px 18px;
  border-radius: 18px;
  border: 1px solid rgba(10, 61, 143, 0.16);
  background: linear-gradient(180deg, #ffffff, #f2f7ff);
  text-decoration: none;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

/* QR Ph: a button rather than a link, because going to PayMongo is a call
   that has to be made first - the payment page does not exist until asked. */
/* One plain button in the site's own ink-and-sanguine style: "Pay ₱99". */
.pay-go {
  display: flex;
  gap: 8px;
  align-items: baseline;
  justify-content: center;
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--line, #2b2118);
  border-radius: var(--wobble-pill, 999px);
  background: var(--sanguine, #8e3a1c);
  color: #fffcf6;
  cursor: pointer;
  box-shadow: 0 4px 14px -10px rgba(42, 32, 22, 0.24);
  transition: box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.pay-go:hover:not(:disabled),
.pay-go:focus-visible:not(:disabled) {
  background: #7a3116;
  box-shadow: 0 4px 14px -10px rgba(42, 32, 22, 0.24);
  transform: translate(-1px, -2px);
}

.pay-go:disabled {
  opacity: 0.62;
  cursor: progress;
}

.pay-go-label,
.pay-go-amount {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
}

.pay-side[hidden],
.pay-pp[hidden],
[data-pay-gcash][hidden] {
  display: none;
}

.pay-ppbtn:hover,
.pay-ppbtn:focus-visible {
  box-shadow: 0 16px 34px -18px rgba(4, 40, 100, 0.5);
  transform: translateY(-1px);
}

.pay-ppbtn-label {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--azure-deep);
}

.pay-ppbtn-amount {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.pay-pp-or {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-soft);
  text-align: center;
}

.pay-pp-or a {
  color: var(--azure);
  font-weight: 600;
}

.pay-cols {
  display: grid;
  gap: 20px;
}

/* QR Ph is one full-width column: the button is the whole step, and there is
   no receipt beside it. Without this it would be squeezed into the narrow
   code column the other two methods use. */
.pay-cols.pay-solo {
  grid-template-columns: minmax(0, 1fr);
}

/* QR Ph on its own: one short, centred column. */
.pay-cols.pay-solo .pay-pp {
  width: 100%;
  max-width: 360px;
  margin: 8px auto 4px;
}

.pay-qrbtn {
  position: relative;
  display: block;
  width: min(100%, 300px);
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: none;
  cursor: zoom-in;
}

.pay-qr {
  display: block;
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(10, 61, 143, 0.14);
  background: #ffffff;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.pay-qrbtn:hover .pay-qr,
.pay-qrbtn:focus-visible .pay-qr {
  box-shadow: 0 16px 34px -18px rgba(4, 40, 100, 0.5);
  transform: translateY(-1px);
}

.pay-qrbtn:focus-visible {
  outline: none;
}

.pay-qrzoom {
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(10, 61, 143, 0.12);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 16px -10px rgba(4, 40, 100, 0.45);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--azure-deep);
  pointer-events: none;
}

/* The enlarged code: a tap anywhere (or Escape) puts it away. */

.pay-zoom {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 26, 58, 0.72);
  cursor: zoom-out;
}

.pay-zoom[hidden] {
  display: none !important;
}

.pay-zoom img {
  max-width: min(94vw, 520px);
  max-height: min(90vh, 720px);
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: #ffffff;
  box-shadow: 0 40px 90px -30px rgba(2, 14, 40, 0.8);
}

.pay-zoom-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--azure-deep);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.pay-zoom-close:hover {
  background: #ffffff;
}

.pay-hint {
  margin: 12px 0 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-soft);
  text-align: center;
}

.pay-side {
  display: grid;
  gap: 14px;
  align-content: start;
}

.pay-drop {
  display: grid;
  gap: 4px;
  place-items: center;
  padding: 20px 16px;
  border: 1px solid rgba(10, 61, 143, 0.28);
  border-radius: 18px;
  background: rgba(14, 95, 203, 0.04);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.pay-drop:hover {
  border-color: var(--azure);
  background: rgba(14, 95, 203, 0.08);
}

.pay-drop strong {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 600;
}

.pay-drop span {
  font-size: 12.5px;
  color: var(--ink-soft);
}

.pay-thumb {
  width: 100%;
  max-height: 190px;
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid rgba(10, 61, 143, 0.14);
  background: #ffffff;
}

.pay-field {
  display: grid;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
}

.pay-field input {
  padding: 13px 15px;
  border: 1px solid rgba(10, 61, 143, 0.18);
  border-radius: 14px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  background: #ffffff;
}

.pay-field input:focus {
  outline: 2px solid rgba(14, 95, 203, 0.35);
  outline-offset: 1px;
}

.pay-error {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #a3220f;
}

.pay-error.good {
  color: var(--azure-deep);
}

.pay-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  margin-top: 6px;
}

.pay-link {
  border: 0;
  background: none;
  padding: 0;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--azure);
  cursor: pointer;
}

.pay-link:hover {
  text-decoration: underline;
}

.pay-link[disabled] {
  color: var(--ink-soft);
  cursor: default;
  text-decoration: none;
}

/* The same quiet link when it is an anchor rather than a button. */
a.pay-link {
  text-decoration: none;
}

button.buy {
  border: 0;
  width: 100%;
  cursor: pointer;
  font-family: var(--font-display);
}

button.buy[disabled] {
  opacity: 0.55;
  cursor: default;
  transform: none;
  box-shadow: none;
}

/* ── The prose views ────────────────────────────────────────────────────── */

/* "Order placed" and "create an account first" are a short message and one
   action. Across the broad card they would stretch into an unreadable line and
   a button the width of the page, so both hold a centred column instead. */
.pay-view[data-view="done"] {
  max-width: 560px;
  margin: 0 auto;
}

.pay-view[data-view="auth"] {
  display: grid;
  gap: 14px;
  max-width: 440px;
  margin: 0 auto;
  padding: 16px 0 20px;
}

/* ── The done view ──────────────────────────────────────────────────────── */

.pay-mark {
  width: 62px;
  height: 62px;
  margin: 22px auto 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #1667d8, #0b4ea2);
  color: var(--white);
  font-size: 30px;
  box-shadow: var(--glow);
}

.pay-thanks {
  /* A paragraph across a broad card becomes an unreadable line, so the prose
     views hold a comfortable measure and stay centred. */
  margin: 0 auto 16px;
  max-width: 62ch;
  font-size: 15px;
  line-height: 1.55;
  text-align: center;
}

.pay-order {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(10, 61, 143, 0.16);
  border-radius: 16px;
  background: #ffffff;
}

.pay-order span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.pay-order code {
  font-family: "Consolas", "Cascadia Mono", monospace;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.pay-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 16px 0 18px;
}

.pay-chip {
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.pay-chip.pending {
  background: rgba(14, 95, 203, 0.12);
  color: var(--azure-deep);
}

.pay-chip.approved {
  background: linear-gradient(180deg, #1667d8, #0b4ea2);
  color: var(--white);
}

.pay-chip.rejected {
  background: transparent;
  border: 1px solid rgba(10, 61, 143, 0.32);
  color: var(--ink-soft);
}

/* ── The tracker ────────────────────────────────────────────────────────── */

.pay-orders {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.pay-card {
  padding: 14px 16px;
  border: 1px solid rgba(10, 61, 143, 0.16);
  border-radius: 16px;
  background: #ffffff;
  display: grid;
  gap: 6px;
}

.pay-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pay-card-top code {
  font-family: "Consolas", "Cascadia Mono", monospace;
  font-size: 13.5px;
  font-weight: 600;
}

.pay-card-line {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.pay-card-note {
  margin: 0;
  font-size: 13px;
  color: var(--ink);
}

.pay-empty {
  padding: 20px 4px;
  font-size: 13.5px;
  color: var(--ink-soft);
  text-align: center;
}

.pay-lookup {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: end;
  padding-top: 14px;
  border-top: 1px solid rgba(10, 61, 143, 0.12);
}

.pay-lookup label {
  display: grid;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.pay-lookup input {
  padding: 11px 13px;
  border: 1px solid rgba(10, 61, 143, 0.18);
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
  background: #ffffff;
  text-transform: none;
  letter-spacing: normal;
}

.pay-lookup input#pay-find-email {
  text-transform: none;
}

/* The "Find" button rides at the height of its two fields. */
.pay-lookup .buy {
  width: auto;
  padding: 12px 20px;
}

/* The quiet "track your order" entry on the pricing cards and the account. */
.plan-track {
  justify-self: center;
  border: 0;
  background: none;
  padding: 0;
  margin-top: 12px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--azure);
  cursor: pointer;
}

.plan-track:hover {
  text-decoration: underline;
}

/* ── The note under the code: the wait, and who to ask ──────────────────── */

/* Says up front how long a confirmation takes and where to go when something
   is wrong, so a buyer is not left refreshing a page with no idea. */
.pay-note {
  display: grid;
  gap: 9px;
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(10, 61, 143, 0.14);
  border-radius: 18px;
  background: rgba(14, 95, 203, 0.05);
}

/* Inside the payment column the grid gap already spaces it from the button. */
.pay-side .pay-note {
  margin-top: 0;
}

.pay-note h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.005em;
}

.pay-note p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.pay-note p.pay-note-lead {
  color: var(--ink);
}

.pay-note a {
  color: var(--azure);
  font-weight: 600;
}

/* The same quiet link when it is an anchor rather than a button. */
a.plan-track {
  text-decoration: none;
}

a.plan-track:hover {
  text-decoration: underline;
}

/* ── Wider screens: the QR sits beside the steps ────────────────────────── */

/* The nav is a fixed bar, and the standard clearance is sized for a form that
   scrolls anyway. On these two cards it leaves a strip of scroll the page has
   no use for - the whole step is meant to be taken in at once. */
.pay-main {
  padding-top: 96px;
  padding-bottom: 56px;
}

@media (min-width: 640px) {
  .pay-cols {
    grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
  }

  /* A solo method keeps its one column whatever the screen width. */
  .pay-cols.pay-solo {
    grid-template-columns: minmax(0, 1fr);
  }

  .pay-qrbtn {
    width: 100%;
  }
}

/* Wide screens: the code takes a roomier column so it is easy to scan, and
   the columns above stay side by side while the card is broad. */
@media (min-width: 900px) {
  .pay-cols {
    grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
    gap: 40px;
  }

  .pay-cols.pay-solo {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pay-drop,
  .pay-go,
  .pay-link,
  .pay-method,
  .pay-ppbtn,
  .pay-qr {
    transition: none;
  }
}

/* Order lookup on a phone: the two fields and the button stack, and a field
   may shrink below its natural width - three columns of inputs were pushing
   the whole card past the screen edge. */
.pay-lookup label {
  min-width: 0;
}

.pay-lookup input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

@media (max-width: 560px) {
  .pay-page {
    padding: 24px 18px 22px;
  }

  .pay-lookup {
    grid-template-columns: 1fr;
  }

  .pay-lookup .buy {
    width: 100%;
  }
}

/* ── Before a downgrade ─────────────────────────────────────────────────── */
.switch-view .switch-lede {
  margin: 0 0 12px;
  font-size: 16px;
}

.switch-list {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.switch-list li {
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid rgba(42, 32, 22, 0.25);
  background: rgba(255, 253, 248, 0.8);
  font-size: 15px;
  line-height: 1.45;
}

.switch-list .switch-keep {
  border-color: rgba(77, 106, 42, 0.5);
  background: rgba(77, 106, 42, 0.08);
}

.switch-list .switch-lose {
  border-color: rgba(176, 118, 0, 0.55);
  background: rgba(176, 118, 0, 0.09);
}

.switch-tip {
  margin: 0 0 16px;
  font-size: 14.5px;
  line-height: 1.5;
}

.switch-tip:empty {
  display: none;
}

.switch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.switch-actions .buy {
  flex: 1 1 200px;
  text-align: center;
}
