/* Scalapay info (js/scalapay_info_dialog.js). The <dialog> is a transparent full-screen layer (a click outside the
   panel lands on it and closes it) holding the panel: a centred dialog on desktop, a full screen bottom sheet on
   phones. Safari < 15.4 has no showModal: the JS sets [open] + .is-fallback and the layer draws its own backdrop. */
.scalapay-info-dialog:not([open]) { display: none; }
.scalapay-info-dialog[open] {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2147483000;
    display: -webkit-box;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 1.5rem;
    border: 0;
    background: transparent;
    color: #222222;
    overflow: hidden;
    box-sizing: border-box;
}
.scalapay-info-dialog::backdrop { background: rgba(0, 0, 0, .45); animation: scalapay-info-fade-in .15s ease-out; }
.scalapay-info-dialog.is-fallback[open] { background: rgba(0, 0, 0, .45); }
.scalapay-info-dialog.is-closing::backdrop { animation: scalapay-info-fade-out .2s ease-in forwards; }

.scalapay-info-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(60rem, 100%);
    height: min(44rem, 100%);
    background: #FFFFFF;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
    animation: scalapay-info-pop-in .16s cubic-bezier(.2, .8, .2, 1);
}
.scalapay-info-dialog.is-closing .scalapay-info-panel { animation: scalapay-info-pop-out .2s ease-in forwards; }
.scalapay-info-panel *,
.scalapay-info-panel *::before,
.scalapay-info-panel *::after { box-sizing: border-box; }

.scalapay-info-head {
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 3.25rem;
    padding: 0 .5rem;
    border-bottom: 1px solid #EBEBEB;
}
.scalapay-info-handle { display: none; }
.scalapay-info-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;    /* 44px target */
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: #666666;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
}
.scalapay-info-close:hover { color: #000000; background: #F3F3F3; }
.scalapay-info-close:focus-visible { outline: 2px solid #222222; outline-offset: 0; }

.scalapay-info-body {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
}
.scalapay-info-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #FFFFFF;
    opacity: 0;
    transition: opacity .15s ease;
}
.scalapay-info-dialog.is-loaded .scalapay-info-frame { opacity: 1; }
.scalapay-info-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2rem;
    height: 2rem;
    margin: -1rem 0 0 -1rem;
    border: 3px solid #E5E5E5;
    border-top-color: #222222;
    border-radius: 50%;
    animation: scalapay-info-spin .8s linear infinite;
}
.scalapay-info-dialog.is-loaded .scalapay-info-loader { display: none; }

/* phones: the page behind does not scroll while the sheet is open (iOS Safari). Not on desktop, where hiding the
   scrollbar would shift the page under the dialog. */
@media screen and (max-width: 768px) {
    html.scalapay-info-is-open,
    html.scalapay-info-is-open body { overflow: hidden !important; }
}

/* phones: full screen bottom sheet */
@media screen and (max-width: 768px) {
    .scalapay-info-dialog[open] { align-items: flex-end; padding: 0; }
    .scalapay-info-panel {
        width: 100%;
        height: 100%;
        padding-top: env(safe-area-inset-top, 0px);
        box-shadow: none;
        animation: scalapay-info-sheet-up .25s cubic-bezier(.2, .8, .2, 1);
        transition: transform .2s ease;
    }
    .scalapay-info-dialog.is-closing .scalapay-info-panel { animation: scalapay-info-sheet-down .2s ease-in forwards; }
    .scalapay-info-head { height: 3.5rem; padding: 0 .4rem; touch-action: none; }
    .scalapay-info-handle {
        display: block;
        position: absolute;
        top: .5rem;
        left: 50%;
        width: 2.5rem;
        height: 4px;
        margin-left: -1.25rem;
        border-radius: 2px;
        background: #D0D0D0;
    }
    .scalapay-info-body { padding-bottom: env(safe-area-inset-bottom, 0px); }
}

@media (prefers-reduced-motion: reduce) {
    .scalapay-info-panel,
    .scalapay-info-dialog::backdrop { animation: none !important; }
}
@keyframes scalapay-info-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes scalapay-info-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes scalapay-info-pop-in { from { opacity: 0; transform: translateY(6px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes scalapay-info-pop-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes scalapay-info-sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes scalapay-info-sheet-down { from { transform: translateY(0); } to { transform: translateY(100%); } }
@keyframes scalapay-info-spin { to { transform: rotate(360deg); } }
