/* Public portal refinements, scoped to preserve other public documents. */
.public-payment-body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: #f4f6f9; color: #0b1830; }
.public-payment-body .public-document-header { min-height: 68px; padding: 12px max(24px, calc((100vw - 1200px) / 2)); background: #fff; color: #202731; border-bottom: 1px solid #e5e7eb; }
.public-payment-body .public-document-brand { min-width: 0; color: inherit; font-size: 14px; }
.public-payment-body .public-document-brand strong { overflow-wrap: anywhere; }
.public-payment-body .brand-mark { background: color-mix(in srgb, var(--color-primary), white 94%); color: var(--color-primary); border: 1px solid color-mix(in srgb, var(--color-primary), white 80%); box-shadow: none; font-style: normal; }
.public-payment-body .brand-mark::before, .public-payment-body .brand-mark::after { display: none; }
.public-payment-body .public-document-header > span { display: block; flex-shrink: 0; color: #616975; font-size: 12px; }
.public-payment-body .public-document-shell { width: min(1600px, 100%); margin: 0 auto; padding: 0 0 40px; flex: 1; }
.public-payment-body .button.primary { background: var(--color-primary); border-color: var(--color-primary); color: var(--portal-on-primary); box-shadow: none; }
.public-payment-body .button { min-height: 44px; border-radius: 7px; }
.public-payment-body .button:hover { transform: none; }
.payment-portal-intro { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; min-height: min(740px, calc(100vh - 160px)); padding-right: 4%; }
/* Show only the device composition from the supplied reference, excluding its header and form. */
.payment-portal-visual { align-self: stretch; min-height: 570px; background: url('../img/payment-portal-reference.png') left bottom / auto 110% no-repeat; mask-image: linear-gradient(to right, #000 85%, transparent); }
.payment-portal-panel { position: relative; min-width: 0; margin: 48px 0; padding: clamp(28px, 3vw, 48px); background: #fff; border-radius: 12px; }
.payment-portal-hero { display: flex; align-items: center; gap: 24px; max-width: none; margin: 0 0 40px; text-align: left; }
.payment-portal-hero h1 { margin: 0 0 6px; font-size: clamp(28px, 2.65vw, 42px); letter-spacing: -.04em; line-height: 1.15; color: #080f24; }
.payment-portal-hero p { margin: 0; color: #7584a1; font-size: clamp(14px, 1.25vw, 18px); line-height: 1.5; }
.payment-portal-title-icon { display: grid; place-items: center; flex: 0 0 70px; height: 70px; border-radius: 12px; color: #0876ff; background: #e7f1ff; }
.payment-portal-title-icon svg { width: 36px; height: 36px; }
.payment-portal-search { max-width: none; margin: 0; border: 0; box-shadow: none; }
.payment-portal-search .card-body { padding: 0; }
.payment-portal-search label { font-size: 14px; font-weight: 650; color: #0b1830; }
.payment-portal-search-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
.payment-portal-input { position: relative; }
.payment-portal-input svg { position: absolute; top: 17px; left: 18px; width: 24px; height: 24px; color: #7888a3; pointer-events: none; }
.payment-portal-search-row input { width: 100%; min-width: 0; height: 58px; padding: 0 18px 0 58px; font-size: 18px; font-weight: 400; letter-spacing: normal; border: 1px solid #d4deed; border-radius: 8px; background: #fff; box-shadow: none; }
.payment-portal-search-row input::placeholder { color: #8b9bb7; }
.payment-portal-search small { font-size: 13px; color: #7584a1; line-height: 1.6; }
.public-payment-body .payment-portal-search .button { width: 100%; min-height: 58px; margin-top: 30px; background: #08294c; border-color: #08294c; color: #fff; font-size: 16px; }
.payment-portal-search .button::after { content: '⟶'; margin-left: 16px; font-size: 24px; font-weight: 400; line-height: 1; }
.public-payment-body .payment-portal-search .button:disabled { opacity: .75; }
.payment-portal-trust { margin-top: 30px; padding-top: 24px; border-top: 1px solid #edf0f5; color: #7584a1; }
.payment-portal-payment-brands { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; }
.payment-portal-payment-brands svg { width: 22px; height: 25px; flex-shrink: 0; }
.payment-portal-payment-brands span { margin-right: auto; }
.payment-portal-payment-brands img { width: 81px; height: auto; flex-shrink: 0; }
.payment-portal-trust p { margin: 16px 0 0; font-size: 11px; line-height: 1.6; }
.public-payment-body [data-payment-results]:not(:empty), .public-payment-body .public-document-shell > .alert { margin: 24px auto 0; width: min(1200px, calc(100% - 48px)); }
.public-payment-body .public-document-footer { padding: 23px 16px; border-top: 1px solid #e5e9ef; color: #7c8592; background: #fff; font-size: 12px; }
.public-payment-body .public-document-footer a { margin-left: 4px; color: #616d7c; text-decoration: none; }
.public-payment-body .public-document-footer a:hover { text-decoration: underline; }
.payment-portal-wordmark { font-size: 30px; font-weight: 800; letter-spacing: -1.5px; color: #414141; }
.payment-portal-wordmark > span { color: #1010ed; }
.public-payment-body .public-document-header > span { position: relative; color: #0b1830; padding: 14px 0; }
.public-payment-body .public-document-header > span::after { content: ''; position: absolute; bottom: 0; left: 0; width: 28px; height: 2px; background: #2478ff; }
.payment-portal-search .field-error { color: var(--danger); }
.public-payment-body [data-payment-intro][hidden] { display: none; }
.payment-results-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px 0 32px; margin-bottom: 32px; border-bottom: 1px solid #e0e6ee; }
.payment-results-eyebrow { margin: 0 0 10px; color: #748094; font-size: 12px; }
.payment-results-heading h1 { margin: 0; color: #0b1830; font-size: clamp(28px, 3vw, 38px); font-weight: 650; line-height: 1.2; letter-spacing: -.035em; }
.payment-results-heading h1:focus { outline: none; }
.payment-results-rut { margin: 14px 0 0; color: #748094; font-size: 14px; }
.payment-results-rut strong { margin-left: 10px; color: #23374d; font-weight: 600; white-space: nowrap; }
.public-payment-body .payment-change-rut { flex-shrink: 0; gap: 14px; padding: 11px 18px; border: 1px solid #dbe2eb; background: #fff; color: #23374d; font-size: 13px; font-weight: 550; box-shadow: none; }
.public-payment-body .payment-change-rut:hover { background: #f8fafc; border-color: #aab9cb; }
.payment-change-rut:focus-visible { outline: 2px solid #2478ff; outline-offset: 3px; }
.payment-results-trust { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 16px; margin-top: 36px; color: #7c8797; }
.payment-results-trust img { width: 81px; height: auto; }
.payment-results-trust p { margin: 0; font-size: 11px; line-height: 1.6; }
.payment-portal-intro.is-compact { display: block; min-height: 0; padding: 0 16px; }
.payment-portal-intro.is-compact .payment-portal-visual { display: none; }
.payment-portal-intro.is-compact .payment-portal-panel { max-width: 620px; margin: 48px auto 16px; border: 1px solid #e5e9ef; }
.payment-portal-intro.is-compact .payment-portal-hero h1 { font-size: 30px; }
.payment-portal-grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; align-items: start; gap: 26px; }
.payment-portal-documents { min-width: 0; }
.payment-portal-section-head { align-items: center; gap: 16px; margin-bottom: 17px; }
.payment-portal-section-head h2 { margin-bottom: 5px; font-size: 18px; color: #202731; }
.payment-portal-section-head p { color: #616975; }
.payment-portal-section-head > span { flex-shrink: 0; color: #616975; font-size: 12px; font-weight: 400; }
.payment-portal-list { gap: 12px; }
.payment-document { position: relative; grid-template-columns: 22px minmax(0, 1fr) 150px; gap: 16px; padding: 20px; border-color: #dfe3e8; border-radius: 9px; box-shadow: none; }
.public-payment-body .payment-document:hover { border-color: #b8bec6; box-shadow: none; transform: none; }
.payment-document.is-selected { border-color: color-mix(in srgb, var(--color-primary), white 45%); background: color-mix(in srgb, var(--color-primary), white 97%); box-shadow: none; }
.payment-document-check { width: 21px; height: 21px; }
.payment-document > input:checked + .payment-document-check:after { border-color: var(--portal-on-primary); }
.payment-document-main { gap: 8px; }
.payment-document-title { flex-wrap: wrap; gap: 8px; }
.payment-document-title > strong { color: #202731; overflow-wrap: anywhere; }
.payment-document-title .status { padding: 4px 8px; font-size: 10px; line-height: 1.2; border: 0; }
.payment-document .status.overdue { background: #fff0ef; color: #ab3833; }
.payment-document .status.pending { background: #edf0f4; color: #515f70; }
.payment-document .status.paid { background: #eaf5ee; color: #326849; }
.payment-document-concept { color: #616975; font-size: 13px; white-space: normal; overflow-wrap: anywhere; }
.payment-document-dates { gap: 6px 16px; color: #68717c; font-size: 11px; }
.payment-document-dates b { font-weight: 500; color: #454e59; white-space: nowrap; }
.payment-document-amounts { gap: 10px; border-left: 1px solid #e5e7eb; padding-left: 18px; text-align: left; }
.payment-document-amounts span { display: grid; justify-content: normal; gap: 3px; font-size: 11px; color: #616975; }
.payment-document-amounts b { min-width: 0; color: #454e59; font-size: 14px; font-weight: 550; }
.payment-document-amounts strong { min-width: 0; color: #202731; font-size: 19px; letter-spacing: -.02em; overflow-wrap: anywhere; }
.payment-portal-checkout { display: block; position: sticky; top: 24px; bottom: auto; margin: 0; padding: 24px; border: 1px solid #e0e4e9; border-radius: 10px; box-shadow: 0 4px 16px #18223005; }
.payment-portal-checkout > div:first-child { gap: 8px; }
.payment-portal-checkout h2 { margin: 0 0 18px; font-size: 17px; }
.payment-portal-checkout > div:first-child > strong { color: #202731; font-size: clamp(28px, 3vw, 34px); letter-spacing: -.04em; line-height: 1.2; overflow-wrap: anywhere; }
.payment-portal-checkout > div:first-child > span, .payment-portal-checkout > div:first-child > small { color: #616975; font-size: 12px; text-transform: none; letter-spacing: normal; font-weight: 400; }
.payment-portal-pay-action { display: block; margin-top: 22px; padding-top: 20px; border-top: 1px solid #e8ebee; }
.payment-portal-pay-action .button { width: 100%; min-width: 0; }
.payment-unavailable { color: #616975; font-size: 12px; line-height: 1.6; margin: 14px 0 0; }
.public-payment-body .card:hover { box-shadow: 0 3px 12px #18223004; transform: none; }
.payment-portal-empty { max-width: none; border: 1px solid #e0e4e9; box-shadow: none; }
.payment-method-dialog { width: min(540px, calc(100% - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: 28px; border: 1px solid #e0e4e9; border-radius: 12px; background: #fff; color: #202731; box-shadow: 0 24px 80px #10182026; overflow-y: auto; }
.payment-method-dialog::backdrop { background: #141c2a66; }
.payment-method-dialog[open] { animation: none; }
.payment-dialog-heading { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; }
.payment-dialog-heading h2 { margin: 8px 0 0; font-size: 20px; line-height: 1.35; letter-spacing: -.02em; }
.payment-dialog-close { flex-shrink: 0; width: 44px; height: 44px; border: 1px solid #e5e7eb; border-radius: 7px; background: #fff; color: #616975; font-size: 24px; cursor: pointer; }
.payment-method-dialog > p { font-size: 13px; line-height: 1.7; color: #616975; margin: 16px 0 22px; }
.payment-method-options { display: grid; gap: 10px; }
.payment-method { display: grid; gap: 7px; width: 100%; padding: 18px; text-align: left; font: inherit; color: #202731; background: #fff; border: 1px solid #dfe3e8; border-radius: 8px; cursor: pointer; }
.payment-method strong { font-size: 14px; }
.payment-method span { font-size: 12px; line-height: 1.6; color: #616975; }
.payment-method:hover, .payment-method[aria-pressed="true"] { border-color: var(--color-primary); background: color-mix(in srgb, var(--color-primary), white 97%); }
.payment-method:focus-visible, .payment-dialog-close:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; }
.payment-transfer { margin-top: 22px; padding-top: 20px; border-top: 1px solid #e5e7eb; }
.payment-transfer-heading { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.payment-transfer h3 { margin: 0; font-size: 14px; }
.payment-transfer .transfer-details { grid-template-columns: minmax(90px, .7fr) minmax(0, 1fr); gap: 12px 16px; margin: 20px 0; font-size: 13px; }
.payment-transfer .transfer-details dd { overflow-wrap: anywhere; }
.payment-transfer small { display: block; color: #616975; line-height: 1.65; }
.payment-copy-feedback { color: #616975; font-size: 12px; }
.payment-copy-feedback:empty { display: none; }
.payment-webpay-confirm { width: 100%; margin-top: 24px; }
.payment-method-dialog [hidden] { display: none !important; }
@media (max-width: 1000px) {
  .payment-portal-grid { grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; }
  .payment-document { grid-template-columns: 22px minmax(0, 1fr); padding: 18px; }
  .payment-document-amounts { grid-column: 2; grid-template-columns: 1fr 1fr; padding: 12px 0 0; border-left: 0; border-top: 1px solid #e5e7eb; }
}
@media (max-width: 760px) {
  .payment-results-heading { align-items: flex-start; flex-direction: column; gap: 22px; padding: 16px 0 26px; margin-bottom: 26px; }
  .payment-results-trust { align-items: flex-start; justify-content: flex-start; gap: 12px; margin-top: 28px; }
  .payment-portal-intro.is-compact .payment-portal-panel { margin-top: 24px; }
  .payment-portal-intro.is-compact .payment-portal-hero h1 { font-size: 24px; }
  .payment-portal-grid { grid-template-columns: minmax(0, 1fr); }
  .payment-portal-checkout { position: static; }
  .public-payment-body .public-document-shell { width: 100%; padding: 0 0 24px; margin: 0 auto; }
  .payment-portal-intro { grid-template-columns: minmax(0, 1fr); padding: 0; min-height: 0; }
  .payment-portal-panel { grid-row: 1; margin: 24px 16px 0; padding: 28px 22px; }
  .payment-portal-visual { grid-row: 2; min-height: 0; height: auto; aspect-ratio: 990 / 700; background-size: 183.24% 123.86%; mask-image: linear-gradient(to bottom, transparent, #000 15%, #000 85%, transparent); }
  .payment-portal-hero { gap: 14px; margin-bottom: 30px; }
  .payment-portal-title-icon { flex-basis: 48px; height: 48px; border-radius: 9px; }
  .payment-portal-title-icon svg { width: 27px; height: 27px; }
  .payment-portal-hero h1 { font-size: clamp(24px, 5vw, 32px); }
  .payment-portal-hero p { font-size: 13px; }
  .payment-portal-search-row input { font-size: 16px; }
  .payment-portal-payment-brands { flex-wrap: wrap; justify-content: flex-start; gap: 10px; }
  .public-payment-body [data-payment-results]:not(:empty) { width: calc(100% - 32px); }
  .public-payment-body .public-document-header { padding: 12px 16px; gap: 16px; }
  .public-payment-body .public-document-brand { gap: 8px; font-size: 12px; }
  .public-payment-body .public-document-header > span { font-size: 11px; }
  .payment-portal-search .card-body { padding: 0; }
  .payment-portal-search-row { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .payment-portal-search-row .button { width: 100%; min-width: 0; }
  .payment-portal-section-head { align-items: flex-start; gap: 8px; }
  .payment-portal-section-head h2 { font-size: 17px; }
  .payment-portal-section-head > span { font-size: 11px; padding-top: 3px; }
  .payment-portal-checkout h2 { margin-bottom: 10px; }
  .payment-method-dialog { padding: 20px; }
  .payment-dialog-heading h2 { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .payment-method-dialog[open], .public-payment-body .button, .payment-document { animation: none; transition: none; }
}
