/* The payment page.
 *
 * One page. Every way to pay is a tile with its own mark on it, and touching
 * the tile starts that payment. There is no button on this screen and no step
 * between choosing and paying.
 *
 * What it replaces was a stack of full-width outlined boxes with two lines of
 * blue text in each - every option the same shape and the same weight, so
 * nothing could be found at a glance and the whole screen read as a form. A
 * payment screen is looked at for two seconds and recognised by its marks, not
 * read.
 *
 * The marks carry the meaning, so the type gets quiet: one name, one small
 * line, high contrast, no colour competing with the icons.
 */

.ml-pay-page { margin-top: 4px; }

/* The amount, stated once, in the largest type on the page. It is the one
   number a person checks before paying and it was previously tucked into a
   pale green strip that ran off the edge of the phone. */
.ml-pay-total {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  padding: 18px 20px; margin: 0 0 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .28);
}
.ml-pay-total .ml-pay-what { min-width: 0; }
.ml-pay-total b { display: block; font-size: 19px; font-weight: 800; letter-spacing: -.2px; }
.ml-pay-total small { display: block; margin-top: 3px; color: #94a3b8; font-size: 13.5px; font-weight: 600; }
.ml-pay-total .ml-pay-amount { font-size: 34px; font-weight: 900; letter-spacing: -1.2px; line-height: 1; white-space: nowrap; }
.ml-pay-total .ml-pay-amount s { display: block; font-size: 15px; font-weight: 700; color: #64748b; letter-spacing: -.2px; }

.ml-pay-head {
  margin: 0 0 12px; font-size: 14px; font-weight: 800;
  letter-spacing: .5px; text-transform: uppercase; color: #94a3b8;
}

/* Two across on a phone, three from tablet up. Square-ish, so the mark has
   room to be the thing you see rather than a bullet beside a sentence. */
.ml-pay-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 620px) { .ml-pay-tiles { grid-template-columns: repeat(3, 1fr); } }

.ml-pay-tile {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px;
  min-height: 132px;
  padding: 18px 12px 16px;
  border: 1.5px solid #e6ebf3;
  border-radius: 22px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(15, 23, 42, .04);
  transition: transform .16s cubic-bezier(.2,.9,.2,1), box-shadow .16s, border-color .16s;
  -webkit-tap-highlight-color: transparent;
}
.ml-pay-tile:hover { border-color: #c7d3e6; box-shadow: 0 14px 30px rgba(15, 23, 42, .12); transform: translateY(-2px); }
.ml-pay-tile:active { transform: translateY(0) scale(.985); }
.ml-pay-tile:focus-visible { outline: 3px solid #2563eb; outline-offset: 3px; }

.ml-pay-tile .ml-pay-mark {
  width: 54px; height: 54px;
  display: grid; place-items: center;
  flex: none;
  border-radius: 16px;
  background: #f4f7fb;
  color: #0f172a;
}
/* The round brand marks (USDT, Wise) fill their plate; the drawn ones (card,
   bank) sit inside it with air, so all six read at the same optical size. */
.ml-pay-tile .ml-pay-mark svg { width: 34px; height: 34px; }
.ml-pay-tile .ml-pay-mark.is-round svg { width: 44px; height: 44px; }
.ml-pay-tile .ml-pay-mark svg { display: block; }

.ml-pay-tile .ml-pay-name {
  font-size: 15px; font-weight: 800; letter-spacing: -.2px; line-height: 1.15;
}
.ml-pay-tile .ml-pay-sub {
  font-size: 11.5px; font-weight: 650; color: #8a94a6; line-height: 1.2;
  letter-spacing: .1px;
}

/* The card tile is the one most people want, so it is the only one allowed to
   be loud, and it spans the row on a phone where the wallets matter most. */
.ml-pay-tile.is-primary {
  grid-column: 1 / -1;
  flex-direction: row; justify-content: flex-start; gap: 16px;
  min-height: 92px; padding: 16px 20px; text-align: left;
  border-color: transparent;
  background: linear-gradient(135deg, #1d4ed8, #4f46e5);
  color: #fff;
  box-shadow: 0 16px 34px rgba(37, 99, 235, .3);
}
.ml-pay-tile.is-primary:hover { box-shadow: 0 22px 44px rgba(37, 99, 235, .38); }
.ml-pay-tile.is-primary .ml-pay-sub { color: rgba(255, 255, 255, .8); }
.ml-pay-tile.is-primary .ml-pay-mark {
  width: 46px; height: 46px; border-radius: 14px;
  background: rgba(255, 255, 255, .17);
  color: #fff;
}
.ml-pay-tile.is-primary .ml-pay-mark svg { width: 28px; height: 28px; }
/* The two lines have to STACK. As inline spans they ran together and the tile
   read "CardApple Pay · Google Pay" on a phone - the one thing on the screen
   that had to be legible at a glance was the one thing that was not. */
.ml-pay-tile.is-primary .ml-pay-copy {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 3px; align-items: flex-start;
}

/* The wallet marks sit beside the name, each on its own white chip.
   They were hidden below 400px, which is every phone - so on the device most
   people pay from, nothing said Apple Pay was here. They are the reason the
   tile is pressed, so they stay at every width and only get smaller. */
.ml-pay-tile.is-primary .ml-pay-wallets { display: flex; align-items: center; gap: 7px; flex: none; }
.ml-pay-tile.is-primary .ml-pay-wallets i {
  width: 34px; height: 34px; border-radius: 10px;
  background: #fff; display: grid; place-items: center; flex: none;
  box-shadow: 0 2px 8px rgba(2, 6, 23, .18);
}
/* Apple's mark is drawn in currentColor; on the white chip it must be dark. */
.ml-pay-tile.is-primary .ml-pay-wallets i { color: #0f172a; }
.ml-pay-tile.is-primary .ml-pay-wallets svg { width: 19px; height: 19px; display: block; }
@media (max-width: 380px) {
  .ml-pay-tile.is-primary .ml-pay-wallets i { width: 30px; height: 30px; border-radius: 9px; }
  .ml-pay-tile.is-primary .ml-pay-wallets svg { width: 17px; height: 17px; }
}

.ml-pay-note {
  margin: 16px 2px 2px;
  font-size: 12.5px; line-height: 1.45; color: #8a94a6; text-align: center;
}

/* The provider's own screen, once one is chosen. Kept plain on purpose: the
   PayPal buttons and the wallet address bring their own styling and anything
   of ours around them just competes. */
.ml-pay-stage { padding-top: 4px; }
.ml-pay-back {
  display: inline-flex; align-items: center; gap: 7px;
  border: 0; background: transparent; padding: 8px 2px; margin-bottom: 4px;
  color: #2563eb; font: inherit; font-weight: 800; font-size: 15px; cursor: pointer;
}
.ml-pay-back svg { width: 16px; height: 16px; }

/* Waiting, while a redirect is being prepared. A tile that has been touched
   has to say so immediately or it gets touched again. */
.ml-pay-tile[aria-busy="true"] { pointer-events: none; opacity: .72; }
.ml-pay-tile[aria-busy="true"] .ml-pay-mark { animation: mlPayPulse 1s ease-in-out infinite; }
@keyframes mlPayPulse { 50% { opacity: .35; } }

@media (prefers-reduced-motion: reduce) {
  .ml-pay-tile, .ml-pay-tile:hover, .ml-pay-tile:active { transition: none; transform: none; }
  .ml-pay-tile[aria-busy="true"] .ml-pay-mark { animation: none; }
}
