/* ─────────────────────────────────────────────────────────────────────────────
   Pesapal

   Three surfaces, two design languages:

     .pesapal-admin   settings panel, admin only  → monochrome (admin-mono.css)
     .pesapal-payment payment facts + refund, admin only → monochrome
     .pesapal-methods payment-method badges at checkout → frontend theme

   The first two are back-office and follow the house monochrome rules: black
   ink on white, hairline rules, no fills, 12px, square corners. Semantic hue
   survives only where it carries meaning (a failed payment, a live-mode
   warning), matching the deliberate exception admin-mono.css makes for
   --success / --danger.

   The third is a traveller-facing surface on the normal themed site, so it
   takes its type and spacing from design-tokens.css instead. Do not "unify"
   them — checkout is not the back office.
   ───────────────────────────────────────────────────────────────────────────── */

/* ═══════════════════════════════════════════════════════════════════════════
   1. Admin settings panel
   ═══════════════════════════════════════════════════════════════════════════ */

.pesapal-admin {
    font-size: 12px;
    line-height: 1.5;
}

.pesapal-admin__head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Status chips. Outline only — a fill here would be the one thing
   admin-mono.css asks this file not to do. */
.pesapal-chip {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    border: 1px solid var(--tm-ink, #000);
    background: transparent;
    color: var(--tm-ink, #000);
}

.pesapal-chip--muted {
    border-color: #9ca3af;
    color: #6b7280;
}

.pesapal-chip--warn {
    border-color: var(--warning, #b45309);
    color: var(--warning, #b45309);
}

.pesapal-chip--danger {
    border-color: var(--danger, #b91c1c);
    color: var(--danger, #b91c1c);
}

.pesapal-chip--ok {
    border-color: var(--success, #15803d);
    color: var(--success, #15803d);
}

/* A section of the panel. The rule between sections does the grouping work
   that a background tint would do elsewhere. */
.pesapal-section {
    padding: 18px 0;
    border-top: 1px solid #e5e7eb;
}

.pesapal-section:first-child {
    border-top: 0;
    padding-top: 4px;
}

.pesapal-section__title {
    margin: 0 0 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tm-ink, #000);
}

.pesapal-section__note {
    margin: 0 0 14px;
    font-size: 12px;
    color: #6b7280;
    max-width: 62ch;
}

.pesapal-section__note code {
    font-size: 11px;
    padding: 1px 4px;
    border: 1px solid #e5e7eb;
    background: transparent;
    color: var(--tm-ink, #000);
    word-break: break-all;
}

/* Key/value readout — IPN state, resolved URL, currency. */
.pesapal-facts {
    margin: 0 0 14px;
    border: 1px solid #e5e7eb;
}

.pesapal-facts__row {
    display: flex;
    gap: 14px;
    padding: 8px 12px;
    border-top: 1px solid #f0f0f0;
}

.pesapal-facts__row:first-child {
    border-top: 0;
}

.pesapal-facts__key {
    flex: 0 0 132px;
    color: #6b7280;
}

.pesapal-facts__val {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--tm-ink, #000);
    font-weight: 600;
    word-break: break-all;
}

.pesapal-facts__val--mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 500;
}

.pesapal-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.pesapal-result {
    font-size: 12px;
}

.pesapal-result--ok {
    color: var(--success, #15803d);
}

.pesapal-result--err {
    color: var(--danger, #b91c1c);
}

.pesapal-result--busy {
    color: #6b7280;
}

/* Live-mode warning. Left rule instead of a tinted box. */
.pesapal-warning {
    margin: 0 0 14px;
    padding: 8px 0 8px 12px;
    border-left: 2px solid var(--warning, #b45309);
    color: var(--warning, #b45309);
    font-size: 12px;
    max-width: 62ch;
}

/* ═══════════════════════════════════════════════════════════════════════════
   2. Payment facts + refund, on the booking screen
   ═══════════════════════════════════════════════════════════════════════════ */

.pesapal-payment {
    margin-bottom: 28px;
    font-size: 12px;
}

.pesapal-payment__title {
    margin: 0 0 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.pesapal-payment .pesapal-facts {
    margin-bottom: 12px;
}

.pesapal-refund {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
}

.pesapal-refund__note {
    margin: 0 0 12px;
    padding: 8px 0 8px 12px;
    border-left: 2px solid #9ca3af;
    color: #6b7280;
    font-size: 12px;
    max-width: 62ch;
}

.pesapal-refund__fields {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.pesapal-refund__field {
    flex: 1 1 180px;
    min-width: 0;
}

.pesapal-refund__field label {
    display: block;
    margin: 0 0 4px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
}

.pesapal-refund__field input {
    width: 100%;
    padding: 6px 8px;
    font-size: 12px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: var(--tm-ink, #000);
}

.pesapal-refund__field input:focus {
    outline: 0;
    border-color: var(--tm-ink, #000);
}

/* ═══════════════════════════════════════════════════════════════════════════
   3. Checkout — payment-method badges
   ═══════════════════════════════════════════════════════════════════════════ */

.pesapal-methods {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin: 0 0 10px;
    padding: 0;
    list-style: none;
}

/* Wordmarks rather than brand artwork: no trademarked image is shipped with
   the platform, and a wrong or stale logo reads worse than clean type. An
   operator who has licensed artwork can upload it to the gateway's Logo field. */
.pesapal-methods li {
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #4b5563;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background: #fff;
    white-space: nowrap;
}

.pesapal-note {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: #64748b;
}

.pesapal-note strong {
    color: #0f172a;
    font-weight: 600;
}

@media (max-width: 480px) {
    .pesapal-facts__row {
        flex-direction: column;
        gap: 2px;
    }

    .pesapal-facts__key {
        flex-basis: auto;
    }
}
