.mp-checkout {
    --mp-primary: #1683ff;
    --mp-primary-dark: #0867d7;
    --mp-border: #dce3ea;
    --mp-border-strong: #bcc9d5;
    --mp-text: #172033;
    --mp-muted: #687485;
    --mp-success: #16855b;
    --mp-danger: #c43636;
    --mp-field-height: 50px;
    min-width: 0;
    margin-bottom: 24px;
    color: var(--mp-text);
}

.mp-checkout > legend {
    margin-bottom: 18px;
    color: var(--mp-text);
    font-size: 20px;
    font-weight: 700;
}

.mp-layout {
    display: grid;
    /* Three-step checkout: preview first, form immediately below it. */
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

/* The one-page payment panel has enough horizontal room on tablet/desktop. */
@media (min-width: 768px) {
    #content[data-checkout-mode="onepage"] .mp-layout {
        grid-template-columns: minmax(260px, .85fr) minmax(0, 1.15fr);
    }

    #content[data-checkout-mode="onepage"] .mp-card-column {
        width: 100%;
    }
}

.mp-card-column {
    width: min(100%, 380px);
    min-width: 0;
    position: static;
}

#mp-subscription-checkout .mp-card-column,
#mp-subscription-checkout .mp-card-stage,
#mp-subscription-checkout .mp-card-preview {
    width: 100%;
    max-width: 100%;
}

/* Three-step checkout: center the preview above its form. */
#content:not([data-checkout-mode="onepage"]) .mp-card-column {
    margin: 0 auto;
}

.mp-card-stage {
    width: 100%;
    perspective: 1100px;
}

.mp-card-preview {
    --mp-card-start: #26334c;
    --mp-card-end: #101827;
    --mp-card-text: #fff;
    width: 100%;
    aspect-ratio: 1.586 / 1;
    min-height: 190px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 20px;
    color: var(--mp-card-text);
    background:
        radial-gradient(circle at 92% 8%, rgba(255, 255, 255, .18), transparent 30%),
        linear-gradient(135deg, var(--mp-card-start), var(--mp-card-end));
    box-shadow:
        0 20px 42px rgba(18, 30, 52, .24),
        inset 0 1px 0 rgba(255, 255, 255, .14);
    position: relative;
    transform-style: preserve-3d;
    transition: transform .52s cubic-bezier(.2, .75, .2, 1), box-shadow .25s ease;
}

.mp-card-preview::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    border-radius: inherit;
    background: linear-gradient(112deg, transparent 18%, rgba(255, 255, 255, .1) 45%, transparent 67%);
    transform: translateZ(1px);
}

.mp-card-preview.is-cvv-focus {
    transform: rotateY(180deg);
    box-shadow: 0 24px 50px rgba(18, 30, 52, .3);
}

.mp-card-preview__front,
.mp-card-preview__back {
    position: absolute;
    inset: 0;
    padding: clamp(18px, 5.5%, 25px);
    display: flex;
    flex-direction: column;
    border-radius: inherit;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.mp-card-preview__front {
    justify-content: space-between;
    opacity: 1;
    visibility: visible;
}

.mp-card-preview__back {
    padding: 0;
    transform: rotateY(180deg);
    opacity: 0;
    visibility: hidden;
    background:
        radial-gradient(circle at 8% 90%, rgba(255, 255, 255, .12), transparent 28%),
        linear-gradient(135deg, var(--mp-card-end), var(--mp-card-start));
}

.mp-card-preview.is-cvv-focus .mp-card-preview__front {
    opacity: 0;
    visibility: hidden;
}

.mp-card-preview.is-cvv-focus .mp-card-preview__back {
    opacity: 1;
    visibility: visible;
}

.mp-card-preview__texture {
    position: absolute;
    inset: 0;
    opacity: .12;
    background-image:
        linear-gradient(30deg, rgba(255, 255, 255, .2) 12%, transparent 12.5%, transparent 87%, rgba(255, 255, 255, .2) 87.5%),
        linear-gradient(150deg, rgba(255, 255, 255, .2) 12%, transparent 12.5%, transparent 87%, rgba(255, 255, 255, .2) 87.5%);
    background-size: 38px 66px;
}

.mp-card-preview__top,
.mp-card-preview__details {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.mp-card-preview__type {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.mp-card-preview__type strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: clamp(13px, 2vw, 16px);
    letter-spacing: .02em;
}

.mp-card-preview__top img {
    width: auto;
    max-width: 92px;
    height: 36px;
    max-height: 36px;
    object-fit: contain;
    border-radius: 7px;
    background: rgba(255, 255, 255, .94);
    padding: 4px 6px;
}

.mp-card-preview__contactless {
    width: 25px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(90deg);
}

.mp-card-preview__contactless i {
    width: 5px;
    height: 11px;
    margin: 0 -1px;
    border: 1.5px solid currentColor;
    border-top-color: transparent;
    border-bottom-color: transparent;
    border-left-color: transparent;
    border-radius: 50%;
    opacity: .76;
}

.mp-card-preview__chip {
    position: relative;
    z-index: 1;
    width: clamp(38px, 13%, 50px);
    aspect-ratio: 1.28;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid rgba(75, 58, 16, .38);
    border-radius: 7px;
    overflow: hidden;
    background: linear-gradient(135deg, #f8db86, #c79a34 52%, #ffe9a7);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28);
}

.mp-card-preview__chip span {
    border-right: 1px solid rgba(75, 58, 16, .32);
    border-bottom: 1px solid rgba(75, 58, 16, .32);
}

.mp-card-preview__number {
    position: relative;
    z-index: 1;
    min-height: 27px;
    overflow: hidden;
    color: inherit;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .22);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: clamp(17px, 5.2vw, 23px);
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: clamp(.7px, .5vw, 2px);
    white-space: nowrap;
}

.mp-card-preview__details {
    align-items: end;
    text-transform: uppercase;
}

.mp-card-preview__holder {
    min-width: 0;
    flex: 1;
}

.mp-card-preview__holder small,
.mp-card-preview__expiry small {
    display: block;
    margin-bottom: 2px;
    opacity: .67;
    font-size: 8px;
    font-weight: 600;
    letter-spacing: .12em;
}

.mp-card-preview__holder strong,
.mp-card-preview__expiry strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: clamp(10px, 2vw, 13px);
    letter-spacing: .055em;
}

.mp-card-preview__expiry strong.is-complete::after {
    content: " ✓";
    font-size: 9px;
}

.mp-card-preview__issuer {
    position: absolute;
    right: clamp(18px, 5.5%, 25px);
    bottom: 7px;
    left: clamp(18px, 5.5%, 25px);
    z-index: 1;
    overflow: hidden;
    opacity: .72;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .05em;
}

.mp-card-preview__stripe {
    height: 22%;
    min-height: 43px;
    margin-top: 11%;
    background: #111827;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
}

.mp-card-preview__signature {
    min-height: 44px;
    margin: 9% 7% 0;
    padding-left: 12px;
    color: #3d4652;
    background:
        repeating-linear-gradient(0deg, #fff, #fff 4px, #e9edf1 5px, #f7f8f9 7px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .18);
}

.mp-card-preview__signature span {
    opacity: .64;
    font: italic 11px/1.2 Georgia, serif;
}

.mp-card-preview__signature strong {
    align-self: stretch;
    min-width: 58px;
    padding: 0 9px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #172033;
    font: 700 13px/1 monospace;
    letter-spacing: 2px;
}

.mp-card-preview__back-copy {
    margin: auto 7% 8%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mp-card-preview__back-copy strong {
    font-size: 12px;
}

.mp-card-preview__back-copy small {
    max-width: 85%;
    opacity: .72;
    font-size: 9px;
    line-height: 1.4;
}

.mp-card-preview[data-mp-brand-id="visa"],
.mp-card-preview[data-mp-brand-id="debvisa"] {
    --mp-card-start: #223e91;
    --mp-card-end: #101b4c;
}

.mp-card-preview[data-mp-brand-id="master"],
.mp-card-preview[data-mp-brand-id="debmaster"],
.mp-card-preview[data-mp-brand-id="maestro"] {
    --mp-card-start: #252733;
    --mp-card-end: #7d281f;
}

.mp-card-preview[data-mp-brand-id="amex"] {
    --mp-card-start: #1388a9;
    --mp-card-end: #07566e;
}

.mp-card-preview[data-mp-brand-id="oca"] {
    --mp-card-start: #6346ba;
    --mp-card-end: #2d1e74;
}

.mp-card-preview[data-mp-brand-id="cabal"] {
    --mp-card-start: #28875a;
    --mp-card-end: #114c35;
}

.mp-card-preview[data-mp-brand-id="diners"] {
    --mp-card-start: #50657a;
    --mp-card-end: #17202b;
}

.mp-card-preview[data-mp-brand-id="elo"] {
    --mp-card-start: #5d5223;
    --mp-card-end: #15171b;
}

.mp-card-preview[data-mp-brand-id="naranja"] {
    --mp-card-start: #ed711f;
    --mp-card-end: #9b3617;
}

.mp-card-preview[data-mp-brand-id="creditel"] {
    --mp-card-start: #d73543;
    --mp-card-end: #7e1622;
}

.mp-card-preview[data-mp-brand-id="lider"] {
    --mp-card-start: #e3313f;
    --mp-card-end: #81141d;
}

.mp-card-hint {
    margin: 15px 8px 0;
    color: var(--mp-muted);
    text-align: center;
    font-size: 12px;
    line-height: 1.45;
}

.mp-form {
    min-width: 0;
    padding: clamp(18px, 3vw, 28px);
    border: 1px solid #e3e9ef;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(23, 32, 51, .07);
}

.mp-form__heading {
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid #edf1f4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.mp-form__heading > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mp-form__heading strong {
    color: var(--mp-text);
    font-size: 17px;
}

.mp-form__heading small {
    color: var(--mp-muted);
}

.mp-secure-badge {
    flex: none;
    padding: 6px 9px;
    border-radius: 999px;
    color: #167251;
    background: #eaf8f2;
    font-size: 11px;
    font-weight: 700;
}

.mp-form-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 15px;
}

.mp-field-group {
    margin-bottom: 17px;
}

.mp-field-group > label {
    margin-bottom: 7px;
    color: #354258;
    font-size: 13px;
    font-weight: 650;
}

.mp-field-shell {
    position: relative;
}

.mp-secure-field,
.mp-form .form-control {
    width: 100%;
    height: var(--mp-field-height) !important;
    min-height: var(--mp-field-height) !important;
    border: 1px solid var(--mp-border) !important;
    border-radius: 9px !important;
    color: var(--mp-text);
    background: #fff;
    box-shadow: none !important;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.mp-secure-field {
    padding: 0 !important;
    overflow: hidden !important;
}

.mp-secure-field iframe {
    display: block !important;
    width: 100% !important;
    height: calc(var(--mp-field-height) - 2px) !important;
    min-height: calc(var(--mp-field-height) - 2px) !important;
    max-height: calc(var(--mp-field-height) - 2px) !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}

.mp-form .form-control {
    padding: 10px 13px;
    font-size: 15px;
}

.mp-secure-field:focus-within,
.mp-field-group.is-focused .mp-secure-field,
.mp-form .form-control:focus {
    border-color: var(--mp-primary) !important;
    box-shadow: 0 0 0 3px rgba(22, 131, 255, .13) !important;
}

.mp-field-group.is-valid .mp-secure-field,
.mp-field-group.is-valid .form-control {
    border-color: #6ab99d !important;
    background: #fbfffd;
}

.mp-field-group.is-invalid .mp-secure-field,
.mp-field-group.is-invalid .form-control {
    border-color: #e18a8a !important;
    background: #fffafa;
}

.mp-field-check {
    position: absolute;
    top: 50%;
    right: 13px;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    color: #fff;
    background: var(--mp-success);
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    transform: translateY(-50%);
    pointer-events: none;
}

.mp-field-group.is-valid .mp-field-check {
    display: flex;
}

.mp-field-error {
    min-height: 15px;
    margin-top: 4px;
    color: var(--mp-danger);
    display: block;
    font-size: 11px;
    line-height: 1.3;
}

.mp-form .help-block {
    margin: 6px 2px 0;
    color: var(--mp-muted);
    font-size: 11px;
    line-height: 1.45;
}

.mp-total {
    margin: 8px 0 18px;
    padding: 15px 0;
    border-top: 1px solid #edf1f4;
    border-bottom: 1px solid #edf1f4;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 15px;
}

.mp-total > span {
    color: var(--mp-muted);
    font-size: 13px;
}

.mp-total strong {
    color: var(--mp-text);
    font-size: 19px;
}

.mp-actions {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.mp-actions #button-confirm {
    width: 100%;
    min-height: 48px;
    margin: 0;
    border: 0;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--mp-primary), var(--mp-primary-dark));
    box-shadow: 0 8px 18px rgba(22, 131, 255, .2);
    font-size: 15px;
    font-weight: 700;
}

.mp-actions #button-confirm:hover:not(:disabled) {
    filter: brightness(.97);
    transform: translateY(-1px);
}

.mp-actions #button-confirm:disabled {
    color: #7c8794;
    background: #e8edf2;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 1;
}

.mp-actions > small {
    color: var(--mp-muted);
    text-align: center;
    font-size: 10px;
    line-height: 1.4;
}

.mp-saved-cards {
    margin-bottom: 20px;
    padding: 16px;
    border: 1px solid var(--mp-border);
    border-radius: 12px;
    background: #f9fbfe;
}

.mp-saved-cards__heading {
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.mp-saved-cards__heading h4 {
    margin: 0 0 3px;
    color: var(--mp-text);
    font-size: 15px;
    font-weight: 750;
}

.mp-saved-cards__heading p {
    margin: 0;
    color: var(--mp-muted);
    font-size: 12px;
}

.mp-saved-cards__heading > a {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 700;
}

.mp-saved-card {
    margin-bottom: 8px;
    padding: 11px 13px;
    border: 1px solid var(--mp-border);
    border-radius: 9px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.mp-saved-card:hover {
    border-color: var(--mp-border-strong);
}

.mp-saved-card:has(input:checked) {
    border-color: var(--mp-primary);
    background: #f2f8ff;
}

.mp-saved-card img {
    width: 38px;
    max-height: 24px;
    object-fit: contain;
}

.mp-card-preference {
    color: var(--mp-muted);
    font-size: 12px;
}

.mp-alert {
    margin-bottom: 14px;
    padding: 11px 14px;
    border-radius: 8px;
}

.mp-alert-error {
    color: #8a1c1c;
    background: #fff0f0;
    border: 1px solid #f2b8b8;
}

.mp-alert-success {
    color: #17633a;
    background: #effaf3;
    border: 1px solid #acd9bd;
}

#mp-subscription-checkout .mp-subscription-summary {
    margin-bottom: 24px;
    padding: 16px;
    border: 1px solid var(--mp-border);
    border-radius: 12px;
    background: #f9fbfe;
    text-align: left;
}

#mp-subscription-checkout .mp-subscription-summary--single {
    margin-right: auto;
    margin-left: auto;
    width: 100%;
    max-width: 392px;
}

#mp-subscription-checkout .mp-subscription-summary__header {
    margin-bottom: 12px;
}

#mp-subscription-checkout .mp-subscription-summary__header h4,
#mp-subscription-checkout .mp-subscription-plan__name {
    margin: 0;
    color: var(--mp-text);
    font-weight: 700;
}

#mp-subscription-checkout .mp-subscription-summary__header p,
#mp-subscription-checkout .mp-subscription-plan__description {
    margin: 3px 0 0;
    color: var(--mp-muted);
    font-size: 12px;
}

#mp-subscription-checkout .mp-subscription-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

#mp-subscription-checkout .mp-subscription-plan {
    width: 100%;
    padding: 20px;
    border: 1px solid #e1e7ef;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(23, 32, 51, .06);
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

#mp-subscription-checkout .mp-subscription-plan:only-child {
    max-width: 360px;
}

#mp-subscription-checkout .mp-subscription-plan__price {
    color: var(--mp-primary-dark);
    font-size: 22px;
    font-weight: 700;
}

#mp-subscription-checkout .mp-subscription-plan__price small {
    color: var(--mp-muted);
    font-size: 13px;
    font-weight: 400;
}

.mp-error-dialog[hidden] {
    display: none !important;
}

.mp-error-dialog {
    position: fixed;
    z-index: 10650;
    inset: 0;
    padding: 20px;
    background: rgba(8, 15, 28, .68);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mp-error-dialog__panel {
    width: min(430px, 100%);
    padding: 28px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .32);
    text-align: center;
}

.mp-error-dialog__icon {
    width: 54px;
    height: 54px;
    margin: 0 auto 16px;
    border-radius: 50%;
    color: #fff;
    background: var(--mp-danger);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: 800;
}

.mp-error-dialog__panel h4 {
    margin: 0 0 10px;
    color: var(--mp-text);
    font-size: 20px;
    font-weight: 750;
}

.mp-error-dialog__panel p {
    margin: 0 0 20px;
    color: var(--mp-muted);
    font-size: 14px;
    line-height: 1.55;
}

.mp-error-dialog__panel .btn {
    min-width: 180px;
    min-height: 44px;
    border: 0;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--mp-primary), var(--mp-primary-dark));
    font-weight: 700;
}

html.mp-dialog-open {
    overflow: hidden;
}

.mp-challenge[hidden] {
    display: none !important;
}

.mp-challenge {
    position: fixed;
    z-index: 10550;
    inset: 0;
    padding: 20px;
    background: rgba(8, 15, 28, .68);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mp-challenge__dialog {
    position: relative;
    width: min(680px, 100%);
    max-height: calc(100vh - 40px);
    padding: 18px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
}

.mp-challenge__close {
    position: absolute;
    right: 12px;
    top: 8px;
    border: 0;
    background: transparent;
    color: #555;
    font-size: 28px;
    line-height: 1;
}

.mp-challenge__dialog iframe {
    width: 100%;
    height: min(600px, 70vh);
    border: 0;
    background: #fff;
}

@media (max-width: 767px) {
    .mp-card-column {
        width: min(100%, 410px);
        margin: 0 auto;
    }

    .mp-card-preview {
        min-height: 175px;
    }

    .mp-form {
        padding: 18px 15px;
    }
}

@media (max-width: 420px) {
    .mp-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .mp-card-preview__front {
        padding: 17px;
    }

    .mp-card-preview__issuer {
        right: 17px;
        left: 17px;
    }

    .mp-card-preview__number {
        font-size: 17px;
        letter-spacing: .5px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mp-card-preview,
    .mp-secure-field,
    .mp-form .form-control {
        transition: none;
    }
}
