:root {
    --accent: #111111;
    --ink: #16181d;
    --muted: #6b7280;
    --line: #e5e7eb;
    --paper: #f6f7f9;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--paper);
    color: var(--ink);
}

.pay-shell {
    max-width: 640px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem 4rem;
}

.pay-card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgb(17 24 39 / 0.06);
}

/* ── Division header: the originating division, prominently, as part of Angry Monkey ── */

.division-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 1.75rem;
    border-bottom: 4px solid var(--accent);
}

.division-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.division-monogram {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--accent);
    color: #ffffff;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.division-header h1 {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.2;
}

.division-of {
    margin: 0.15rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

/* ── Signed-in identity: whose account a card payment will land on ── */

.pay-identity {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.7rem 1.75rem;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    font-size: 0.85rem;
    color: var(--muted);
}

.pay-identity-who strong {
    color: var(--ink);
}

.pay-identity-email {
    margin-left: 0.4rem;
}

.pay-identity-email::before {
    content: "·";
    margin-right: 0.4rem;
}

.pay-identity-signout {
    color: var(--muted);
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
}

.pay-identity-signout:hover,
.pay-identity-signout:focus-visible {
    color: var(--ink);
}

/* ── Order facts ── */

.order-facts {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.45rem 1.25rem;
    margin: 0;
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid var(--line);
}

.order-facts dt {
    color: var(--muted);
    font-size: 0.9rem;
}

.order-facts dd {
    margin: 0;
    font-size: 0.95rem;
}

.order-amount {
    font-size: 1.25rem !important;
    font-weight: 700;
}

.status {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    background: #eef2ff;
    color: #3730a3;
}

.status-paid,
.status-completed {
    background: #dcfce7;
    color: #14532d;
}

.status-awaitingpayment,
.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-cancelled,
.status-failed,
.status-refunded {
    background: #fee2e2;
    color: #7f1d1d;
}

/* ── Methods ── */

.methods-heading {
    margin: 1.5rem 1.75rem 0.5rem;
    font-size: 1.05rem;
}

.methods {
    display: grid;
    gap: 0.9rem;
    padding: 0.5rem 1.75rem 1.75rem;
}

.method {
    border: 1px solid var(--line);
    border-left: 4px solid var(--method-accent, var(--accent));
    border-radius: 12px;
    padding: 1rem 1.25rem;
}

.method-title,
.method-manual summary {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: default;
    font-size: 1rem;
}

.method-manual summary {
    cursor: pointer;
    list-style: none;
}

.method-manual summary::-webkit-details-marker {
    display: none;
}

.method-manual summary::after {
    content: "+";
    margin-left: auto;
    color: var(--muted);
    font-weight: 700;
}

.method-manual[open] summary::after {
    content: "–";
}

.method-badge {
    padding: 0.12rem 0.55rem;
    border-radius: 999px;
    background: var(--method-accent, var(--accent));
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.method-note {
    margin: 0.6rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.method-fields {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.4rem 1rem;
    margin: 0.9rem 0 0;
    font-size: 0.9rem;
}

.method-fields dt {
    color: var(--muted);
}

.method-fields dd {
    margin: 0;
    word-break: break-word;
}

.method-fields em {
    color: var(--muted);
}

.method-action {
    display: inline-block;
    margin-top: 0.9rem;
    padding: 0.65rem 1.3rem;
    border: none;
    border-radius: 10px;
    background: var(--method-accent, var(--accent));
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.method-hint {
    margin: 0.6rem 0 0;
    color: var(--muted);
    font-size: 0.85rem;
}

/* ── States ── */

.pay-empty,
.pay-settled,
.pay-error {
    padding: 1.75rem;
}

.pay-empty h2,
.pay-settled h2,
.pay-error h2 {
    margin-top: 0;
    font-size: 1.15rem;
}

.pay-settled h2 {
    color: #14532d;
}

.pay-error h2 {
    color: #7f1d1d;
}

.card-summary {
    margin: 1.25rem 1.75rem 0;
}

#stripe-payment {
    padding: 1rem 1.75rem 1.75rem;
}

/* ── Footer ── */

.pay-footer {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
}

.pay-footer a {
    color: inherit;
}

.pay-footer-links span {
    margin: 0 0.4rem;
}
