/* PayMyBill — minimal, self-contained styles for the public payment page.
   No framework dependency (theme_config sets bootstrap_missing). */

:root {
    --pmb-brand: #1f6feb;
    --pmb-brand-dark: #1657c0;
    --pmb-ink: #1a1f29;
    --pmb-muted: #5b6573;
    --pmb-canvas: #eef2f7;
    --pmb-paper: #ffffff;
    --pmb-line: #d7dee8;
    --pmb-success: #1a7a4d;
    --pmb-error: #b53237;
    --pmb-radius: 12px;
}

* { box-sizing: border-box; }

body.pmb-shell {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--pmb-ink);
    background: var(--pmb-canvas);
    line-height: 1.5;
}

.pmb-main {
    max-width: 480px;
    margin: 0 auto;
    padding: 32px 20px 48px;
}

.pmb-brand {
    text-align: center;
    margin-bottom: 24px;
}

.pmb-brand__logo {
    max-height: 64px;
    max-width: 240px;
    width: auto;
}

.pmb-brand__name {
    font-size: 1.4rem;
    font-weight: 700;
}

.pmb-notices { margin-bottom: 16px; }

.pmb-notice {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.pmb-notice--error {
    color: var(--pmb-error);
    background: rgba(181, 50, 55, 0.07);
    border: 1px solid rgba(181, 50, 55, 0.2);
}

.pmb-notice--success {
    color: var(--pmb-success);
    background: rgba(26, 122, 77, 0.08);
    border: 1px solid rgba(26, 122, 77, 0.22);
}

.pmb-card {
    background: var(--pmb-paper);
    border: 1px solid var(--pmb-line);
    border-radius: var(--pmb-radius);
    padding: 28px 24px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
}

.pmb-card__title {
    margin: 0 0 6px;
    font-size: 1.5rem;
}

.pmb-card__lead {
    margin: 0 0 22px;
    color: var(--pmb-muted);
}

.pmb-field { margin-bottom: 18px; }

.pmb-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.pmb-field__label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.pmb-field input[type="text"] {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--pmb-line);
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
    color: var(--pmb-ink);
}

.pmb-field input[type="text"]:focus {
    outline: none;
    border-color: var(--pmb-brand);
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.15);
}

/* Payment method — modern selectable card radios */
.pmb-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.pmb-method {
    display: block;
    cursor: pointer;
}

/* Visually hidden but still focusable for keyboard/AT users. */
.pmb-method__input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.pmb-method__box {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 52px;
    padding: 14px;
    border: 1.5px solid var(--pmb-line);
    border-radius: 10px;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.pmb-method:hover .pmb-method__box {
    border-color: #b9c4d4;
}

.pmb-method__name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--pmb-ink);
    line-height: 1.2;
}

/* Selected state — shown purely by the highlighted card (no radio dot). */
.pmb-method__input:checked + .pmb-method__box {
    border-color: var(--pmb-brand);
    background: rgba(31, 111, 235, 0.05);
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.12);
}

.pmb-method__input:checked + .pmb-method__box .pmb-method__name {
    color: var(--pmb-brand-dark);
}

/* Keyboard focus ring */
.pmb-method__input:focus-visible + .pmb-method__box {
    border-color: var(--pmb-brand);
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.25);
}

/* Public one-off payments never store the card, so hide the embedded gateway
   forms' "Save Card Details" toggle (it is ignored server-side). */
.pmb-gateway-screen .card-radio-button:has(input[id$="_saveCard"]) {
    display: none;
}

/* ------------------------------------------------------------------
   Embedded credit-card entry form (shared creditCardEntry.tpl, used by
   ezidebit and the other credit-card gateways). That template assumes
   Bootstrap, which this theme deliberately does not load, so re-style its
   markup here. Everything is scoped under .pmb-gateway-screen so the
   back-office / members-area screens (which DO load Bootstrap) are untouched.
   ------------------------------------------------------------------ */

/* The "What is the CCV?" Bootstrap modal can't open without Bootstrap JS and,
   un-styled, renders its contents inline. Hide it and its (now dead) trigger. */
.pmb-gateway-screen .modal { display: none !important; }
.pmb-gateway-screen a[data-target="#ccv_modal"] { display: none; }

/* Card-number field carries a sprite background (creditCardImages.png) that
   only lines up under the Bootstrap layout — drop it for a plain input. */
.pmb-gateway-screen input[id$="_cardNumber"] {
    background-image: none !important;
    padding-left: 12px !important;
}

/* Bootstrap inputs/selects -> match this theme's field styling. */
.pmb-gateway-screen .form-control {
    width: 100%;
    height: auto;
    padding: 11px 12px;
    border: 1px solid var(--pmb-line);
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
    color: var(--pmb-ink);
}

.pmb-gateway-screen .form-control:focus {
    outline: none;
    border-color: var(--pmb-brand);
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.15);
}

.pmb-gateway-screen label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Bootstrap grid columns collapse to stacked, full-width blocks. */
.pmb-gateway-screen [class*="col-"] {
    width: 100%;
    float: none;
    padding: 0;
    margin-bottom: 14px;
}

/* ...except the nested expiry month/year row, which stays side by side.
   Only nested rows (inside .card-form) are flexed — the outer #..._form.row
   must keep stacking its fields vertically. */
.pmb-gateway-screen .card-form .row {
    display: flex;
    gap: 10px;
    margin: 0;
}

.pmb-gateway-screen .card-form .row > [class*="col-"] {
    flex: 1;
    width: auto;
    margin-bottom: 0;
}

/* Confirmation screen */
.pmb-confirm__note {
    margin: 0 0 20px;
    color: var(--pmb-muted);
    font-size: 0.85rem;
}

.pmb-amount {
    display: flex;
    align-items: center;
    border: 1px solid var(--pmb-line);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.pmb-amount:focus-within {
    border-color: var(--pmb-brand);
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.15);
}

.pmb-amount__sign {
    padding: 0 12px;
    color: var(--pmb-muted);
    font-weight: 600;
}

.pmb-amount input {
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.pmb-gateway-screen {
    margin: 4px 0 18px;
    padding-top: 4px;
}

.pmb-btn {
    display: inline-block;
    width: 100%;
    text-align: center;
    padding: 13px 16px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.pmb-btn--primary {
    background: var(--pmb-brand);
    color: #fff;
}

.pmb-btn--primary:hover { background: var(--pmb-brand-dark); }

.pmb-btn--ghost {
    background: transparent;
    color: var(--pmb-brand);
    border: 1px solid var(--pmb-line);
    margin-top: 8px;
}

/* Receipt */
.pmb-receipt { text-align: center; }

.pmb-receipt__tick {
    width: 56px;
    height: 56px;
    line-height: 56px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: rgba(26, 122, 77, 0.12);
    color: var(--pmb-success);
    font-size: 1.6rem;
}

.pmb-receipt__lead {
    color: var(--pmb-muted);
    margin: 0 0 22px;
}

.pmb-summary {
    text-align: left;
    margin: 0 0 22px;
    border-top: 1px solid var(--pmb-line);
}

.pmb-summary__row {
    display: flex;
    justify-content: space-between;
    padding: 11px 2px;
    border-bottom: 1px solid var(--pmb-line);
}

.pmb-summary__row dt { color: var(--pmb-muted); margin: 0; }
.pmb-summary__row dd { margin: 0; font-weight: 600; }

.pmb-footer {
    margin-top: 22px;
    text-align: center;
    color: var(--pmb-muted);
    font-size: 0.82rem;
}
