/* Payment block — single block for any instant payment provider.
   5 size levels (1=compact, 3=default, 5=signage) via data-size.
   Currency symbol on the left (R$ for Pix, $ generic), centered value,
   action button on the right.

   Provider-specific UI variations (different currency symbol, etc.)
   are handled at the template level via {{ currency_symbol }}; the
   layout stays identical across providers. */

.payment-block {
    /* Defaults = size 3. Each tier below overrides via data-size. */
    --pb-h: 64px;
    --pb-radius: 12px;
    --pb-pad-x: 12px;
    --pb-currency-font: 1rem;
    --pb-font: 1.25rem;
    --pb-btn-pad-x: 14px;
    --pb-btn-font: 0.95rem;
    --pb-label-font: 0.875rem;

    margin: 8px 0;
}
.payment-block[data-size="1"] {
    --pb-h: 44px;
    --pb-pad-x: 10px;
    --pb-currency-font: 0.8125rem;
    --pb-font: 0.95rem;
    --pb-btn-pad-x: 10px;
    --pb-btn-font: 0.8125rem;
    --pb-label-font: 0.75rem;
}
.payment-block[data-size="2"] {
    --pb-h: 52px;
    --pb-pad-x: 11px;
    --pb-currency-font: 0.9375rem;
    --pb-font: 1.0625rem;
    --pb-btn-pad-x: 12px;
    --pb-btn-font: 0.875rem;
    --pb-label-font: 0.8125rem;
}
.payment-block[data-size="4"] {
    --pb-h: 80px;
    --pb-pad-x: 16px;
    --pb-currency-font: 1.125rem;
    --pb-font: 1.5rem;
    --pb-btn-pad-x: 18px;
    --pb-btn-font: 1.0625rem;
    --pb-label-font: 0.9375rem;
}
.payment-block[data-size="5"] {
    --pb-h: 100px;
    --pb-pad-x: 20px;
    --pb-currency-font: 1.375rem;
    --pb-font: 1.875rem;
    --pb-btn-pad-x: 22px;
    --pb-btn-font: 1.25rem;
    --pb-label-font: 1rem;
}

.payment-label {
    font-size: var(--pb-label-font);
    color: var(--color-text-soft, #475569);
    margin-bottom: 6px;
    font-weight: 500;
}

/* Shell holds the brand icon (outside the box) + the input row (the box).
   The icon is INTENTIONALLY outside so the box is dedicated to the
   amount editing UX and the brand identity reads as a label/badge. */
.payment-shell {
    display: flex;
    align-items: center;
    gap: 10px;
}
.payment-brand {
    flex-shrink: 0;
    width: var(--pb-brand);
    height: var(--pb-brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.payment-brand img {
    width: 100%;
    height: 100%;
    display: block;
}
.payment-block {
    --pb-brand: 32px;
}
.payment-block[data-size="1"] { --pb-brand: 22px; }
.payment-block[data-size="2"] { --pb-brand: 26px; }
.payment-block[data-size="4"] { --pb-brand: 44px; }
.payment-block[data-size="5"] { --pb-brand: 56px; }

/* Pill wrapper — R$ chip + value input. Mirrors the Pix modal's
   amount UI. The button is a SIBLING outside this pill (see below). */
.payment-input-wrap {
    flex: 1 1 0%;          /* grow to fill remaining shell space */
    min-width: 0;          /* allow shrink below content min */
    display: flex;
    align-items: stretch;
    height: var(--pb-h);
    background: #ffffff;
    border: 1px solid #cbd5e1;
    /* Exactly half the pill height — guaranteed perfect-pill shape
       on every engine (avoids WebKit quirks with `9999px` radii on
       inputs with overflow:hidden). */
    border-radius: calc(var(--pb-h) / 2);
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.payment-currency {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Tight padding — the pill rounded ends already give visual breath. */
    padding: 0 8px 0 14px;
    flex-shrink: 0;
    background: #f8fafc;   /* slate-50 chip background */
    border-right: 1px solid #cbd5e1;
    color: #475569;        /* slate-600 — same as modal prefix */
    font-size: var(--pb-currency-font);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    box-sizing: border-box;
}
.payment-block[data-size="1"] .payment-currency { padding: 0 5px 0 10px; }
.payment-block[data-size="2"] .payment-currency { padding: 0 6px 0 12px; }
.payment-block[data-size="4"] .payment-currency { padding: 0 10px 0 16px; }
.payment-block[data-size="5"] .payment-currency { padding: 0 12px 0 18px; }
.payment-amount {
    flex: 1 1 auto;        /* grow inside the pill */
    min-width: 0;
    border: 0;
    background: transparent;
    font-size: var(--pb-font);
    font-weight: 600;
    color: #0f172a;
    padding: 0 8px;
    outline: none;
    font-variant-numeric: tabular-nums;
    text-align: center;
    appearance: textfield;
    -webkit-appearance: none;
    -moz-appearance: textfield;
}
.payment-amount::placeholder {
    color: #cbd5e1;
    font-weight: 400;
}

/* Action button — separate pill, Pix-blue, sibling of the input pill.
   Padding tight so it doesn't eat into the value pill. */
.payment-button {
    flex-shrink: 0;
    height: var(--pb-h);
    padding: 0 var(--pb-btn-pad-x);
    background: #2563eb; /* Pix-blue fixed */
    color: #ffffff;
    border: 0;
    /* Exactly half height — perfect pill on every engine (WebKit
       included). 9999px caused breakage on iPhone. */
    border-radius: calc(var(--pb-h) / 2);
    font-size: var(--pb-btn-font);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
    white-space: nowrap;
    /* Defeat iOS Safari default button styling that breaks rounded
       corners + custom background on submit/button elements. */
    -webkit-appearance: none;
    appearance: none;
}
.payment-button:hover:not(:disabled) { background: #1d4ed8; }
.payment-button:disabled { opacity: 0.5; cursor: not-allowed; }
