/* A focused, mobile-first checkout. */
:root {
    --ink: #20372e;
    --muted: #627167;
    --green: #246348;
    --line: #e2e8e2;
    --paper: #f5f7f4;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}
button, input { font: inherit; }
.site-header {
    max-width: 600px;
    padding: 28px 24px 0;
    margin: auto;
}
.header-image { width: 100%; text-align: center; }
.header-image img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 112px;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
}
.checkout-layout {
    max-width: 600px;
    margin: 24px auto 32px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 12px 40px -24px #233d3026;
    overflow: hidden;
}
.summary-column { padding: 24px 32px; background: #fafbf9; border-bottom: 1px solid var(--line); }
.merchant-card { display: grid; grid-template-columns: 1fr; align-items: center; }
.merchant-heading { grid-column: 1; min-width: 0; }
.eyebrow { font-size: 10px; font-weight: 650; letter-spacing: 1.5px; color: var(--muted); margin-bottom: 4px; }
.merchant-name { margin: 0; font-size: 16px; line-height: 1.45; font-weight: 600; overflow-wrap: anywhere; }
.reference-details { grid-column: 1 / -1; margin-top: 12px; }
summary { cursor: pointer; }
.reference-details summary { color: var(--muted); font-size: 12px; width: fit-content; min-height: 32px; display: flex; align-items: center; gap: 8px; }
.reference-details summary::after { content: '+'; font-size: 17px; }
.reference-details[open] summary::after { content: '−'; }
.reference-number { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--muted); padding: 8px 0; }
.reference-number strong { color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.merchant-extra { grid-column: 1 / -1; overflow-wrap: anywhere; }
.detail-card { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.detail-card h2 { font-size: 14px; color: var(--ink); font-weight: 600; }
.payment-panel { padding: 28px 32px 22px; }
h1 { margin: 0 0 7px; font-size: 26px; font-weight: 650; letter-spacing: -.8px; }
.panel-description { font-size: 14px; line-height: 1.6; color: var(--muted); margin-bottom: 24px; }
.amount-box { border: 1px solid #cfd9cf; background: #fff; border-radius: 12px; padding: 16px 18px; margin-bottom: 24px; transition: border-color .15s, box-shadow .15s; }
.amount-box:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px #24634816; }
.amount-box:has([aria-invalid="true"]) { border-color: #bb3d37; }
.amount-box label { display: block; font-size: 13px; font-weight: 600; }
.amount-row { display: flex; gap: 12px; align-items: center; margin: 5px 0; }
#amount { width: 100%; min-width: 0; border: 0; outline: none; padding: 0; height: 48px; font-size: 34px; font-weight: 600; letter-spacing: -.7px; color: var(--ink); background: transparent; }
#amount::placeholder { color: #89958b; }
#amount:focus-visible { outline: none; }
.amount-currency { font-size: 12px; font-weight: 600; color: var(--muted); padding: 4px 8px; background: #f1f4ef; border-radius: 6px; }
#amount-help { display: block; font-size: 12px; color: var(--muted); }
.field-error { font-size: 13px; color: #a52f29; margin: -12px 0 20px; }
.methods-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.methods-heading h2 { margin: 0; font-size: 14px; font-weight: 600; }
.methods-heading > span { font-size: 12px; color: var(--muted); }
.accordion-item { border: 1px solid var(--line) !important; border-radius: 12px !important; overflow: hidden; margin-bottom: 10px; }
.accordion-button { min-height: 76px; padding: 16px; gap: 12px; color: var(--ink); background: #fff; box-shadow: none !important; }
.accordion-button:not(.collapsed) { background: #f4f8f1; color: var(--ink); }
.accordion-button::after { width: 15px; height: 15px; background-size: 15px; opacity: .6; }
.method-summary::after { display: none; }
.method-icon { display: grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.method-icon img { max-width: 28px; max-height: 26px; object-fit: contain; }
.method-title { font-size: 14px; font-weight: 600; line-height: 1.4; }
.method-title small { display: block; margin-top: 4px; font-size: 12px; font-weight: 400; color: var(--muted); }
.accordion-body { padding: 16px; }
.sub-methods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sub-method { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 52px; padding: 12px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; text-align: left; }
.sub-method img { max-width: 28px; max-height: 24px; object-fit: contain; }
.sub-method strong { font-weight: 600; overflow-wrap: anywhere; }
.sub-method.active { border-color: var(--green); background: #f1f7ed; }
.selection-indicator { width: 16px; height: 16px; flex-shrink: 0; margin-left: auto; border: 1px solid #a9b7a7; border-radius: 50%; }
.active .selection-indicator { border: 5px solid var(--green); }
.provider-description { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 0 0 12px; }
.customer-details { border-top: 1px solid var(--line); }
.customer-details summary { display: flex; align-items: center; gap: 8px; min-height: 48px; font-size: 13px; font-weight: 500; }
.customer-details summary span { font-size: 12px; color: var(--muted); font-weight: 400; }
.customer-details summary::after { content: '+'; font-size: 20px; color: var(--muted); margin-left: auto; }
.customer-details[open] summary::after { content: '−'; }
summary::-webkit-details-marker { display: none; }
.customer-fields { padding: 2px 0 8px; }
.field-label { display: block; margin: 6px 0; font-size: 13px; font-weight: 500; }
.form-control { min-height: 48px; border: 1px solid #cfd9cf; border-radius: 8px; padding: 11px 12px; font-size: 16px; color: var(--ink); }
.form-control::placeholder { color: #7b877f; font-size: 14px; }
.form-control:focus { border-color: var(--green); box-shadow: 0 0 0 3px #24634816; }
.btn-success, .retry-button { min-height: 50px; padding: 12px 18px; border: 1px solid var(--green); border-radius: 9px; font-size: 15px; font-weight: 600; color: #fff; background: var(--green); }
.btn-success:hover, .retry-button:hover { background: #194d36; border-color: #194d36; }
.btn-success:disabled { background: #496b56; border-color: #496b56; }
.payment-notice { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0 20px; color: var(--muted); }
.payment-notice > span { font-size: 18px; }
.payment-notice p { font-size: 12px; line-height: 1.65; margin: 0; }
.site-footer { max-width: 600px; margin: 0 auto 24px; padding: 0 4px; display: flex; justify-content: center; gap: 12px; color: var(--muted); font-size: 11px; }
.payment-state { background: #f5f8f1; border-radius: 10px; padding: 20px; font-size: 14px; color: var(--muted); }
.payment-state strong { display: block; color: var(--ink); }
.payment-state p { margin: 8px 0 16px; }
.payment-state .spinner-border { margin-right: 8px; }
:focus-visible { outline: 3px solid #4c8867; outline-offset: 3px; }
@media (hover: hover) {
    .sub-method:hover, .accordion-button:not(.method-summary):hover { background: #f1f6ed; }
}
@media (max-width: 640px) {
    body { background: #fff; }
    .site-header { padding: 20px; border-bottom: 1px solid var(--line); }
    .checkout-layout { max-width: none; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
    .summary-column { padding: 18px 20px 10px; }
    .header-image img { max-height: 88px; }
    .merchant-name { font-size: 14px; }
    .reference-details { margin-top: 4px; }
    .reference-details summary { min-height: 44px; }
    .payment-panel { padding: 24px 20px 20px; }
    h1 { font-size: 24px; }
    .panel-description { margin-bottom: 20px; font-size: 13px; }
    .amount-box { margin-bottom: 22px; padding: 14px 16px; }
    #amount { font-size: 32px; }
    .accordion-button { padding: 14px; }
    .accordion-body { padding: 14px; }
    .site-footer { padding: 4px 20px max(24px, env(safe-area-inset-bottom)); margin: 0; }
    .toast { width: min(350px, calc(100vw - 32px)); }
}
@media (max-width: 360px) {
    .site-header { padding: 18px 16px; }
    .summary-column { padding-left: 16px; padding-right: 16px; }
    .payment-panel { padding-left: 16px; padding-right: 16px; }
    .sub-methods { grid-template-columns: 1fr; }
    .methods-heading > span { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Optional merchant-configured attribution. Respect the hidden attribute. */
.powered-by-footer {
    border-top: 1px solid var(--line);
    padding-top: 18px;
    margin-top: 4px;
    text-align: center;
    font-size: 12px;
    color: var(--muted);
}
.powered-by-logo { display: block; width: 120px; max-width: 100%; height: auto; margin: 0 auto; object-fit: contain; }
