/* MVN billing pages (invoices, payment, quotes, payment methods): only what the system in
   mvn-ui.css lacks, scoped to these pages, tokens only. Each block is listed for the
   integrator, who folds it into the system. */

/* 2. A document's lines (an invoice, a quote, a mass payment) wrap: their descriptions are
      long WHMCS text with line breaks, so the row title may not cut them. */
html.mvn-ui .mvn-doc .mvn-frame.is-lines .mvn-row-title {
    font-weight: var(--mvn-w-medium);
    white-space: normal;
    overflow-wrap: anywhere;
}
.mvn-doc .mvn-frame.is-lines .mvn-row {
    align-items: start;
}

/* 3. The gateway's own pay button (WHMCS's $paymentbutton is a form with an
      input[type=submit], or a gateway's .btn) reads as the page's primary button.
      Lagom draws it as a default button; its margin and icon rules stay. */
html.mvn-ui body.lagom .mvn-doc-gateway :is(input[type="submit"], button[type="submit"], .btn) {
    min-height: var(--mvn-ctl-h);
    padding-inline: var(--mvn-btn-pad);
    border: var(--mvn-hair) solid var(--mvn-accent);
    border-radius: var(--mvn-r-ctl);
    background: var(--mvn-accent);
    color: var(--mvn-on-accent);
    font-size: var(--mvn-t-small);
    font-weight: var(--mvn-w-strong);
    line-height: var(--mvn-lh-ui);
    box-shadow: none;
}
html.mvn-ui body.lagom .mvn-doc-gateway :is(input[type="submit"], button[type="submit"], .btn):hover {
    border-color: var(--mvn-accent-strong);
    background: var(--mvn-accent-strong);
    color: var(--mvn-on-accent);
}
/* Lagom paints .payment-form text white for its dark summary panel. */
html.mvn-ui body.lagom .mvn-doc-gateway :is(p, td, span, label) {
    color: inherit;
}
.mvn-doc-gateway form {
    margin: 0;
}

/* 4. A button on the line of the field beside it (the invoice's "use credit"). */
.mvn-doc-credit-act {
    align-items: flex-start;
    justify-content: flex-end;
}

/* 5. A gateway's or the bank's page inside the client area (remote card input, 3-D Secure,
      a token gateway's form): one frame at full width; its height stays WHMCS's attribute. */
html.mvn-ui .mvn-pay-frame {
    display: block;
    width: 100%;
    border: var(--mvn-hair) solid var(--mvn-rule);
    border-radius: var(--mvn-r-panel);
    background: var(--mvn-paper);
}

/* 6. Print: the document alone, without the pay part and the back link. */
@media print {
    html.mvn-ui :is(.mvn-doc-pay, .mvn-doc-accept, .mvn-back) {
        display: none !important;
    }
    html.mvn-ui .mvn-doc :is(.mvn-frame, .mvn-room) {
        break-inside: avoid;
    }
    /* A printed page is narrow enough for the phone layout; the details stay side by side. */
    html.mvn-ui .mvn-doc .mvn-rooms {
        grid-auto-flow: column;
    }
    html.mvn-ui .mvn-doc .mvn-room + .mvn-room {
        border-block-start: 0;
        border-inline-start: var(--mvn-hair) solid var(--mvn-rule-soft);
    }
}

/* 7. Payment forms keep WHMCS's wrappers: each field sits in a .form-group (WHMCS marks it
      has-error and shows its .field-error-msg) and the wrappers slide open and closed, so the
      grid is on a frameless div and Lagom's group spacing gives way to the grid's gap. */
.mvn-pay-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--mvn-s-5);
    min-width: 0;
}
.mvn-pay-grid > .is-wide {
    grid-column: 1 / -1;
}
html.mvn-ui body.lagom :is(.mvn-pay-grid > .form-group, .mvn-fields > .form-group, .mvn-fields .form-group:has(> .mvn-checks), #newBankInfoTab > .form-group) {
    margin: 0;
}
/* WHMCS slides these containers open with jQuery, which sets display:block, so they keep
   block layout and space their children with margins. */
:is(#newCardInfoTab > .fieldgroup-creditcard, #newBankInfoTab) > * + * {
    margin-block-start: var(--mvn-s-5);
}
#newCardInfoTab > #paymentGatewayInput:not(:empty) {
    margin-block-end: var(--mvn-s-5);
}
/* Where a gateway mounts its fields; empty, it takes no gap. */
#paymentGatewayInput:empty {
    display: none;
}
/* Lagom's iCheck draws a checked and disabled radio with a white dot on the disabled grey,
   so the choice disappears (a saved payment method's type cannot change). */
html.mvn-ui .mvn-check .radio-styled.checked.disabled {
    border-color: var(--mvn-ink-3);
    background: var(--mvn-ink-3);
}
html.mvn-ui .field-error-msg {
    color: var(--mvn-bad);
    font-size: var(--mvn-t-caption);
    font-weight: var(--mvn-w-medium);
    line-height: var(--mvn-lh-ui);
}
html.mvn-ui .has-error :is(.mvn-input, .mvn-select) {
    border-color: var(--mvn-bad);
}
/* WHMCS's error box (.gateway-errors): its script slides it open, so it sets no display. */
html.mvn-ui .mvn-pay-errors {
    padding: var(--mvn-s-3) var(--mvn-s-4);
    border-radius: var(--mvn-r-panel);
    background: var(--mvn-bad-wash);
    color: var(--mvn-ink);
    font-size: var(--mvn-t-small);
}
.mvn-pay-list {
    margin: 0;
    padding-inline-start: 1.25em;
}
@media (max-width: 599.98px) {
    .mvn-pay-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    /* On phones the pay buttons take the line, as the system's form buttons do. */
    html.mvn-ui body.lagom .mvn-doc-gateway :is(input[type="submit"], button[type="submit"], .btn),
    html.mvn-ui .mvn-doc-credit-act .mvn-btn {
        width: 100%;
    }
    .mvn-doc-credit-act {
        align-items: stretch;
    }
}
/* The gateway's pay button keeps the system's touch target, as .mvn-btn does. */
@media (pointer: coarse) {
    html.mvn-ui body.lagom .mvn-doc-gateway :is(input[type="submit"], button[type="submit"], .btn) {
        min-height: var(--mvn-touch);
    }
}

/* 8. A document's lone total stands under the amounts, at the end side, as the totals do. */
.mvn-doc .mvn-frame.is-lines .mvn-frame-foot > .mvn-sum:only-child {
    margin-inline-start: auto;
}

/* The invoices head's one line (owner, 2026-11-04): what is owed, in its tone, and "תשלום הכול" */
html.mvn-ui .page-clientareainvoices .mvn-pay-alert {
    align-self: stretch;
    align-items: center;
    margin-block-start: var(--mvn-s-5);
    font-size: var(--mvn-t-body);
}
html.mvn-ui .page-clientareainvoices .mvn-pay-alert > i:first-child {
    margin-block-start: 0;
}
@media (max-width: 599.98px) {
    html.mvn-ui .page-clientareainvoices .mvn-pay-alert {
        flex-wrap: wrap;
    }
    html.mvn-ui .page-clientareainvoices .mvn-pay-alert .mvn-alert-body {
        flex-basis: calc(100% - var(--mvn-s-7));
    }
    html.mvn-ui .page-clientareainvoices .mvn-pay-alert > .mvn-btn {
        flex: 1 1 100%;
    }
}
