/* ============================================================================
   PAYMENT WIDGET STYLES
   ============================================================================ */

/* CSS Variables for Payment Widget Theme */
:root {
    /* Layout */
    --payment-widget-bg: #f5f5f5;
    --payment-widget-border-radius: 10px;
    --payment-widget-padding: 20px;
    --payment-widget-gap: 20px;
    --payment-widget-margin-bottom: 24px;
    
    /* Typography */
    --payment-widget-font-family: system-ui, -apple-system, sans-serif;
    --payment-option-font-size: 14px;
    --payment-link-font-size: 13px;
    
    /* Colors */
    --payment-option-border-color: #ccc;
    --payment-link-color: #0073aa;
    
    /* Spacing & Sizing */
    --payment-option-svg-height: 30px;
    --payment-option-margin: 5px 0;
}

/* Payment Widget Container */
.payment-widget {
    display: flex;
    justify-content: space-between;
    background: var(--payment-widget-bg);
    border-radius: var(--payment-widget-border-radius);
    padding: var(--payment-widget-padding);
    gap: var(--payment-widget-gap);
    font-family: var(--payment-widget-font-family);
    width: 100%;
    box-sizing: border-box;
    margin-bottom: var(--payment-widget-margin-bottom);
    margin-top:20px;
}

/* Payment Option Items */
.payment-option {
    flex: 1;
    text-align: center;
    border-right: 1px solid var(--payment-option-border-color);
    padding: 0 10px;
}

.payment-option:last-child {
    border-right: none;
}

.payment-option svg {
    display: block;
    margin: 0 auto 10px auto;
    height: var(--payment-option-svg-height);
}

.payment-option p {
    margin: var(--payment-option-margin);
    font-size: var(--payment-option-font-size);
}

.payment-option a {
    font-size: var(--payment-link-font-size);
    color: var(--payment-link-color);
    text-decoration: underline;
    cursor: pointer;
}


/* ============================================================================
   AFTERPAY MODAL BASE STYLES
   ============================================================================ */

/* HTML & Body Overrides */
body.afterpay-modal-body,
html.afterpay-modal-html {
    height: 100%;
}

body.afterpay-modal-body {
    margin: 0;
    background-color: #b2fce4;
}

body.afterpay-modal-body.theme-white {
    background: #fff;
}

/* Remove Firefox Invalid Input Shadow */
:-moz-ui-invalid:not(output) {
    box-shadow: none;
}


/* ============================================================================
   AFTERPAY MODAL WRAPPER
   ============================================================================ */

.afterpay-modal-wrapper {
    min-height: 100%;
    padding: 0 24px;
    background: #b2fce4;
}

.afterpay-modal-wrapper.theme-white {
    background: #fff;
}

.afterpay-modal-wrapper * {
    box-sizing: border-box;
    text-decoration: none;
    font-family: 'Italian Plate No2 Expanded', sans-serif;
    color: #000;
}


/* ============================================================================
   GRID LAYOUT
   ============================================================================ */

.grid-container {
    display: grid;
    margin: 0 auto;
    max-width: 800px;
    text-align: center;
    font-size: 16px;
    grid-template-rows: auto;
    grid-template-columns: repeat(4, 25%);
    grid-template-areas:
        "logo logo logo logo"
        "headline headline headline headline"
        "body-a body-b body-c body-d"
        "body-e body-f body-g body-h"
        "cbt-block cbt-block cbt-block cbt-block"
        "footer footer footer footer";
}

/* Grid Areas */
.row-0 {
    grid-area: logo;
    padding-top: 45px;
}

.row-1 {
    grid-area: headline;
    padding: 3% 0 8% 0;
}

.process-step-1.process-icon-container {
    grid-area: body-a;
}

.process-step-2.process-icon-container {
    grid-area: body-b;
}

.process-step-3.process-icon-container {
    grid-area: body-c;
}

.process-step-4.process-icon-container {
    grid-area: body-d;
}

.process-step-1.process-subheading {
    grid-area: body-e;
}

.process-step-2.process-subheading {
    grid-area: body-f;
}

.process-step-3.process-subheading {
    grid-area: body-g;
}

.process-step-4.process-subheading {
    grid-area: body-h;
}

.row-3 {
    grid-area: footer;
    padding: 8% 0 40px 0;
}

.grid-container > div {
    align-content: stretch;
}


/* ============================================================================
   AFTERPAY MODAL CONTENT ELEMENTS
   ============================================================================ */

/* Logo */
.afterpay-modal-logo svg {
    width: 100%;
    max-width: 275px;
    height: auto;
}

/* Headline */
h3.afterpay-modal-headline {
    margin: 0;
    font-size: 44px;
    font-weight: 600;
    line-height: 1.1;
}

/* Process Icons */
.process-icon-container {
    align-self: end;
}

.process-icon-container svg {
    width: auto;
    height: auto;
    max-width: 110px;
    max-height: 95px;
}

.process-icon-container svg .c1 {
    fill: none;
    stroke: #000;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2px;
}

/* Process Subheadings */
.process-subheading {
    padding: 10% 3% 0 3%;
    font-weight: 600;
    line-height: 1.25;
}

/* Mobile SVG Hidden by Default */
svg.afterpay-mobile,
svg.sign-up-mobile {
    display: none;
}

/* Disclaimer */
.disclaimer {
    font-size: 14px;
}

.disclaimer-link {
    color: #000;
    text-decoration: underline;
}

.disclaimer-link:active {
    color: #000;
}

/* Footer Example */
.afterpay-footer-example {
    margin-top: 1.875em;
    font-size: x-small;
    font-weight: 600;
}

/* Text Utilities */
.afterpay-underline {
    text-decoration: underline;
}

.afterpay-bold {
    font-weight: 700;
}

.afterpay-euro-symbol:after {
    content: " \20ac";
    font-weight: 400;
}

.afterpay-reference-symbol {
    font-weight: 400;
    font-size: 0.5em;
    vertical-align: text-top;
}


/* ============================================================================
   OVERLAY STYLES
   ============================================================================ */

/* Overlay Animations */
@keyframes overlay-open-animation {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes overlay-close-animation {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Overlay Base */
.overlay {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.8));
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
}

.overlay.is-open {
    animation: overlay-open-animation 0.3s linear forwards;
    pointer-events: auto;
    z-index: 999;
}

.overlay.is-closing {
    animation: overlay-close-animation 0.3s linear forwards;
    pointer-events: none;
}

/* Close Button */
.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    cursor: pointer;
    background: transparent;
    border: 0;
    color: #000;
    font-size: 28px;
}

/* Content Container */
.content {
    width: 100%;
    max-width: 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Iframe Wrapper */
.iframe-wrapper {
    position: relative;
    max-width: 90vw;
}

.iframe-wrapper iframe {
    max-width: 100%;
}

/* Learn More Iframe */
#learn-more-iframe {
    display: block;
    background: #fff;
    border-radius: 16px;
    width: 480px;
    height: 550px;
    max-height: 960px;
    transition: height 0.5s;
    border: 0;
}


/* ============================================================================
   AFTERPAY MODAL COMPONENT
   ============================================================================ */

/* Modal Overlay */
.afterpay-modal-overlay {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: scale(1.1);
    transition: visibility 0s linear 0.25s, opacity 0.25s 0s, transform 0.25s;
    z-index: 999999999;
}

#afterpay-modal-component .visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    transition: visibility 0s linear 0s, opacity 0.25s 0s, transform 0.25s;
}

/* Modal Window */
#afterpay-modal-component #afterpay-modal {
    background-color: #fff;
    color: #000;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 2px;
    width: 774px;
    max-width: 100vw;
    max-height: 100%;
    line-height: 1.1;
    display: block;
    overflow: auto;
}

#afterpay-modal-component #afterpay-modal.cashappafterpay {
    width: 744px;
    border-radius: 24px;
}

/* Modal Close Button */
#afterpay-modal-component #afterpay-modal .afterpay-close-button {
    position: absolute;
    z-index: 3;
    background-color: transparent;
    min-width: 0;
    top: 18px;
    right: 18px;
    border: 0;
    cursor: pointer;
}

/* Generic Button Styles */
#afterpay-modal-component button {
    min-width: 80px;
    background-color: #848e97;
    border-color: #848e97;
    border-style: solid;
    border-radius: 2px;
    padding: 3px;
    color: white;
    cursor: pointer;
    display: none;
}

#afterpay-modal-component button:hover {
    background-color: #6c757d;
    border-color: #6c757d;
}


/* ============================================================================
   LOADING INDICATOR
   ============================================================================ */

.afterpay-loading-indicator {
    display: block;
    background-color: transparent;
    width: 80px;
    position: absolute;
    left: 50%;
    top: 50%;
}

.afterpay-loading-indicator::after {
    content: " ";
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 5px solid #b2fce4;
    border-color: #b2fce4 transparent #b2fce4 transparent;
    animation: afterpay-loading-indicator 1.2s linear infinite;
}

.afterpay-loading-indicator.cashappafterpay::after {
    content: " ";
    display: block;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0deg, transparent 15deg, #00d64f 15deg, #00d64f 345deg, transparent 345deg, transparent 360deg);
    animation: afterpay-loading-indicator 1.2s linear infinite;
    mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #ffffff 0);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #ffffff 0);
    border: none;
}

@keyframes afterpay-loading-indicator {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}


/* ============================================================================
   ERROR CONTAINER
   ============================================================================ */

.modal-content .error-container {
    padding: 25px;
    text-align: center;
    background-color: #b2fce4;
    opacity: 0;
    visibility: hidden;
}

.modal-content .error-container.cashappafterpay {
    background-color: #f0f0f0;
    color: #101010;
}

.modal-content.error .error-container {
    opacity: 1;
    visibility: visible;
    font-family: 'Italian Plate No2 Expanded', sans-serif;
}

.modal-content.error .error-container.cashappafterpay {
    opacity: 1;
    visibility: visible;
    font-family: 'CashSans', sans-serif;
}


/* ============================================================================
   RESPONSIVE DESIGN - TABLET
   ============================================================================ */

@media (max-width: 768px) {
    .grid-container {
        max-width: 500px;
        grid-template-columns: auto;
        grid-template-areas:
            "logo logo"
            "headline headline"
            "body-a body-b"
            "body-e body-f"
            "body-c body-d"
            "body-g body-h"
            "cbt-block cbt-block"
            "footer footer";
    }

    .row-1 {
        padding: 3% 0 20px 0;
    }

    .process-icon-container {
        padding: 24px 0 0 0;
    }
}


/* ============================================================================
   RESPONSIVE DESIGN - MOBILE
   ============================================================================ */

@media (max-width: 600px) {
    .afterpay-modal-wrapper {
        padding: 0;
    }

    .grid-container {
        padding: 30px;
        text-align: left;
        grid-template-columns: auto;
        grid-template-areas:
            "logo logo"
            "headline headline"
            "body-a body-e"
            "body-b body-f"
            "body-c body-g"
            "body-d body-h"
            "cbt-block cbt-block"
            "footer footer";
    }

    .row-0 {
        padding-top: 0;
    }

    .row-1 {
        padding: 20px 0 8% 0;
    }

    h3.afterpay-modal-headline {
        font-size: 40px;
    }

    svg.afterpay-desktop,
    svg.sign-up-desktop {
        display: none;
    }

    svg.afterpay-mobile,
    svg.sign-up-mobile {
        display: block;
    }

    .process-icon-container {
        align-self: start;
        padding: 12px 0;
    }

    .process-icon-container svg {
        min-width: 30px;
        max-height: 65px;
    }

    .process-subheading {
        padding: 6px 0 6px 12px;
        align-self: center;
    }

    .row-3 {
        padding: 8% 0 20px 0;
    }
}

@media (max-width: 420px) {
    .afterpay-modal-logo svg {
        max-width: 200px;
    }

    h3.afterpay-modal-headline {
        font-size: 36px;
    }
}

@media (max-width: 335px) {
    h3.afterpay-modal-headline {
        font-size: 32px;
    }
}

@media (max-width: 260px) {
    .grid-container {
        font-size: 14px;
    }

    h3.afterpay-modal-headline {
        font-size: 28px;
    }
}


/* ============================================================================
   INTERNET EXPLORER COMPATIBILITY
   ============================================================================ */

@media (-ms-high-contrast: none), (-ms-high-contrast: active) {
    .afterpay-modal-wrapper .grid-container {
        display: -ms-grid;
        -ms-grid-rows: auto;
        -ms-grid-columns: (25%)[4];
        font-size: 14px;
    }

    .afterpay-modal-wrapper .grid-container .row-0 {
        -ms-grid-row: 1;
        -ms-grid-column: 1;
        -ms-grid-column-span: 4;
        padding-top: 0;
    }

    .afterpay-modal-wrapper .grid-container .row-0 .afterpay-modal-logo svg {
        height: 15vh;
    }

    .afterpay-modal-wrapper .grid-container .row-1 {
        -ms-grid-row: 2;
        -ms-grid-column: 1;
        -ms-grid-column-span: 4;
        padding: 20px 0 45px 0;
    }

    .afterpay-modal-wrapper .grid-container .process-step-1.process-icon-container {
        -ms-grid-row: 3;
        -ms-grid-column: 1;
    }

    .afterpay-modal-wrapper .grid-container .process-step-2.process-icon-container {
        -ms-grid-row: 3;
        -ms-grid-column: 2;
    }

    .afterpay-modal-wrapper .grid-container .process-step-3.process-icon-container {
        -ms-grid-row: 3;
        -ms-grid-column: 3;
    }

    .afterpay-modal-wrapper .grid-container .process-step-4.process-icon-container {
        -ms-grid-row: 3;
        -ms-grid-column: 4;
    }

    .afterpay-modal-wrapper .grid-container .process-step-1.process-subheading {
        -ms-grid-row: 4;
        -ms-grid-column: 1;
    }

    .afterpay-modal-wrapper .grid-container .process-step-2.process-subheading {
        -ms-grid-row: 4;
        -ms-grid-column: 2;
    }

    .afterpay-modal-wrapper .grid-container .process-step-3.process-subheading {
        -ms-grid-row: 4;
        -ms-grid-column: 3;
    }

    .afterpay-modal-wrapper .grid-container .process-step-4.process-subheading {
        -ms-grid-row: 4;
        -ms-grid-column: 4;
    }

    .afterpay-modal-wrapper .grid-container .row-3 {
        -ms-grid-row: 5;
        -ms-grid-column: 1;
        -ms-grid-column-span: 4;
        padding: 80px 0 40px 0;
    }

    #afterpay-modal-component #afterpay-modal {
        bottom: auto;
    }
}