:root { color-scheme: light; font-family: Arial, Helvetica, sans-serif; color: #183746; background: #edf3f5; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
.page { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background: radial-gradient(circle at top left, #d6e9ed, transparent 42%), #edf3f5; }
.portal { width: min(100%, 510px); overflow: hidden; border: 1px solid #dbe7eb; border-radius: 18px; background: #fff; box-shadow: 0 18px 50px rgba(18, 61, 81, .1); }
.portal.is-invoice { width: min(100%, 850px); }
.brand { display: flex; align-items: center; justify-content: center; padding: 21px 32px; border-bottom: 1px solid #dce7ec; background: #fff; }
.brand-logo { display: block; width: min(330px, 82%); height: auto; background: #fff; }
.content { padding: 34px 32px 38px; }
.eyebrow { margin: 0 0 10px; color: #28738a; font-size: 12px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
h1 { margin: 0; color: #123d51; font-size: clamp(25px, 5vw, 31px); line-height: 1.18; }
.intro { margin: 14px 0 28px; color: #526874; line-height: 1.55; }
.field { margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; color: #244351; font-size: 14px; font-weight: 700; }
input { display: block; width: 100%; height: 48px; padding: 0 14px; border: 1px solid #b6cbd3; border-radius: 8px; outline: none; background: #fff; color: #183746; font: inherit; }
input::placeholder { color: #82959d; }
input:focus { border-color: #237992; box-shadow: 0 0 0 3px rgba(35, 121, 146, .16); }
input[aria-invalid="true"] { border-color: #b84646; }
.message { margin: 0 0 16px; padding: 12px 14px; border-radius: 8px; background: #fff1ef; color: #923a35; font-size: 14px; line-height: 1.45; }
button { font: inherit; cursor: pointer; }
#submit-button { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 49px; border: 0; border-radius: 8px; background: #12647e; color: #fff; font-weight: 700; }
#submit-button:hover:not(:disabled) { background: #0d5268; }
#submit-button:focus-visible, .pay-button:focus-visible, .secondary-button:focus-visible, .text-button:focus-visible { outline: 3px solid #77c5d8; outline-offset: 3px; }
#submit-button:disabled { cursor: wait; opacity: .8; }
.spinner { width: 17px; height: 17px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.invoice-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.invoice-topline .eyebrow { margin: 0; }
.status-badge { padding: 6px 10px; border-radius: 999px; background: #e8f4f8; color: #195d72; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.status-badge.is-paid { background: #e7f5ed; color: #1d6a4d; }
.invoice h1 { margin-top: 12px; overflow-wrap: anywhere; }
.invoice-customer { margin: 8px 0 25px; color: #526874; font-size: 16px; }
.invoice-meta { display: flex; flex-wrap: wrap; gap: 18px 36px; margin: 0 0 25px; padding: 18px 0; border-top: 1px solid #e2eaed; border-bottom: 1px solid #e2eaed; }
.invoice-meta div { min-width: 135px; }
dt { color: #637985; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
dd { margin: 5px 0 0; overflow-wrap: anywhere; font-size: 14px; }
.address-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin-bottom: 25px; }
.address-grid h2 { margin: 0 0 8px; color: #234656; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.address-grid p { margin: 0; color: #526874; font-size: 14px; line-height: 1.5; white-space: pre-line; }
.items-wrap { overflow-x: auto; border: 1px solid #e0e9ec; border-radius: 9px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 12px; border-bottom: 1px solid #e9eff1; vertical-align: top; text-align: left; font-size: 14px; }
tr:last-child td { border-bottom: 0; }
th { background: #f3f7f8; color: #526874; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.number { text-align: right; white-space: nowrap; }
.item-name { color: #204250; font-weight: 700; overflow-wrap: anywhere; }
.item-detail { margin-top: 3px; color: #637985; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; white-space: pre-line; }
.empty-items { color: #637985; }
.totals { width: min(100%, 360px); margin: 22px 0 26px auto; }
.totals div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 14px; }
.totals dt { color: #526874; font-size: 14px; font-weight: 400; text-transform: none; letter-spacing: 0; }
.totals dd { margin: 0; font-weight: 600; white-space: nowrap; }
.totals .grand-total { margin-top: 7px; padding-top: 15px; border-top: 1px solid #cbdbe0; }
.totals .grand-total dt, .totals .grand-total dd { color: #123d51; font-size: 17px; font-weight: 800; }
.totals .balance-row { margin-top: 8px; padding: 13px 10px; border-radius: 8px; background: #eef6f8; }
.totals .balance-row dt, .totals .balance-row dd { color: #155a70; font-weight: 800; }
.payment-note { margin: 0 0 18px; padding: 13px 15px; border-radius: 8px; background: #f2f6f7; color: #526874; font-size: 14px; line-height: 1.5; }
.invoice-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 18px; }
.pay-button { flex: 1 0 100%; min-height: 49px; padding: 0 18px; border: 0; border-radius: 8px; background: #12647e; color: #fff; font-weight: 800; }
.pay-button:hover:not(:disabled) { background: #0d5268; }
.pay-button:disabled { cursor: wait; opacity: .72; }
.secondary-button { min-height: 44px; padding: 0 18px; border: 1px solid #12647e; border-radius: 8px; background: #fff; color: #12647e; font-weight: 700; }
.secondary-button:hover:not(:disabled) { background: #eef6f8; }
.secondary-button:disabled { cursor: wait; opacity: .65; }
.text-button { padding: 0; border: 0; background: transparent; color: #12647e; font-size: 14px; font-weight: 700; text-decoration: underline; }
footer { padding: 19px 32px 21px; border-top: 1px solid #e4ecef; background: #f7fafb; color: #526874; font-size: 13px; text-align: center; }
footer strong { display: block; margin-bottom: 7px; color: #183746; font-size: 13px; }
.contact-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px 10px; }
.contact-links a { color: #12647e; font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.contact-links a:hover { color: #0d5268; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
@media (max-width: 600px) { .page { padding: 0; background: #fff; } .portal, .portal.is-invoice { min-height: 100vh; border: 0; border-radius: 0; box-shadow: none; } .brand { padding: 18px 22px; } .brand-logo { width: min(330px, 82%); } .content { padding: 30px 22px; } .address-grid { grid-template-columns: 1fr; } th, td { padding: 11px 7px; } .items-wrap { margin-inline: -10px; } .item-detail { font-size: 11px; } footer { padding-inline: 22px; } }
@media (max-width: 430px) { .brand-logo { width: min(300px, 88%); } .contact-links { align-items: center; flex-direction: column; gap: 6px; } .contact-links span { display: none; } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 1.5s; } }
