/* Styles for @core/donation_form.html.twig. Self-contained because the form is shown on pages
   with different base styles (reader page, reader sign-up); pages style only the box around it. */
.donation-form {
    --df-blue: #27AAE1;
    --df-blue-vlt: #E6F6FC;
    --df-black-two: #3a3a3a;
    --df-grey: #919191;
    --df-red: #AD1313;

    display: flex;
    flex-direction: column;
    gap: 24px;
    font-family: Arial, Helvetica, sans-serif;

    .hidden {
        display: none;
    }

    .dot {
        baseline-shift: super;
        line-height: 0;
    }

    h4 {
        color: #737373;
        margin: 0;
        font-size: 14px;
        font-weight: 700;
        letter-spacing: 0.5px;
        text-transform: uppercase;
    }

    .donation-amounts {
        display: flex;
        flex-direction: column;
        gap: 10px;

        .fixed-amounts {
            display: flex;
            justify-content: space-around;
            align-items: center;
            gap: 8px;

            &.hidden {
                display: none;
            }

            .amt {
                padding: 15px 4px;
                min-width: 128px;
                border-radius: 12px;
                border: 1px solid #E5E5E5;
                background-color: #FFFFFF;
                color: var(--df-black-two);
                text-align: center;
                font-family: "Poppins", sans-serif;
                font-size: 24px;
                font-weight: 700;
                line-height: 32px;
                position: relative;
                cursor: pointer;

                &:hover {
                    border-color: var(--df-blue);
                }

                &.active {
                    border-color: var(--df-blue);
                    background-color: var(--df-blue-vlt);
                    outline: 2px solid var(--df-blue-vlt);
                }

                &.popular::after {
                    position: absolute;
                    top: -9px;
                    left: 50%;
                    transform: translateX(-50%);
                    border-radius: 12px;
                    background-color: var(--df-blue);
                    color: #fff;
                    font-size: 8px;
                    font-weight: 700;
                    content: 'POPULAR';
                    padding: 3px 7px;
                    line-height: 12px;
                }
            }
        }

        .custom-amount {
            font-family: "Poppins", sans-serif;
            text-align: center;
            font-size: 16px;
            padding: 14px;
            border-radius: 12px;
            border: 1px dashed #C4C4C4;

            &:hover {
                border-color: var(--df-blue);
            }
        }
    }

    #custom-amt {
        cursor: pointer;
    }

    #custom-field {
        width: 100%;
        font-size: 16px;
        border: none;
        text-align: right;
    }

    .cover-fee-container {
        font-family: "Inter", sans-serif;

        /* Keep the wording's space but hide it until the PostHog flag answers, so nobody sees it change. */
        &.fee-copy-pending #fee-copy-checkbox,
        &.fee-copy-pending .fee-copy-line {
            visibility: hidden;
        }

        label {
            color: #2C2C2C;
            font-size: 16px;
            font-weight: 700;
            line-height: 24px;
        }

        .fee-breakdown {
            margin-top: 12px;
            padding: 16px;
            border-radius: 12px;
            background-color: #F9F9F8;

            &.hidden {
                display: none;
            }

            .fee-breakdown-row {
                display: flex;
                justify-content: space-between;
                align-items: center;
                color: #2C2C2C;
                font-size: 14px;
                font-style: normal;
                font-weight: 700;
                line-height: 20px;

                & + .fee-breakdown-row {
                    margin-top: 8px;
                }
            }

            .fee-breakdown-separator {
                margin: 12px 0;
                border-top: 1px solid #E5E5E5;
            }

            .fee-breakdown-total {
                font-weight: 700;
            }
        }

        .fee-copy-line {
            margin: 4px 0 0 25px;
            padding: 0;
            color: #2C2C2C;
            font-size: 14px;
            font-style: normal;
            font-weight: 700;
            line-height: 20px;

            &.hidden {
                display: none;
            }
        }
    }

    .donation-options {
        display: flex;
        flex-direction: column;
        gap: 10px;

        .btn {
            padding: 5px 15px;
            border-radius: 20px;
            font-weight: 600;
            font-size: clamp(.9rem, 2.5vw, 1.25rem);
            line-height: clamp(1.6rem, 2.5vw, 1.75rem);
            text-align: center;
            cursor: pointer;
        }

        .btn-white {
            color: var(--df-blue);
            background: #fff;
            border: 1px solid var(--df-grey);
            cursor: auto;
            margin: 0;
        }

        .btn-white:hover {
            background-color: #F8F8F8;
        }

        .btn-black {
            color: #FFFFFF;
            background: #000000;
            padding: 12px 15px;
        }

        .btn-blue {
            color: #FFFFFF;
            background: var(--df-blue);
            padding: 12px 15px;
        }
    }

    #apple_pay,
    #google_pay {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    #apple_pay apple-pay-button,
    #google_pay #checkout-google-pay {
        width: 100%;
        height: 100%;
        cursor: pointer;
    }

    .split {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        padding: 0 0 18px;

        .text {
            color: var(--df-black-two);
            font-weight: 700;
        }

        .close {
            color: var(--df-blue);
            cursor: pointer;
        }
    }

    /* Fields line up with the buttons' edges; neither page's own stylesheet can widen them. */
    fieldset {
        border: none;
        margin: 0 0 12px;
        padding: 0;
        min-width: 0;

        &.two {
            display: flex;
            flex-direction: row;
            flex-grow: 1;
            gap: 10px;

            label {
                flex-grow: 1;
            }
        }
    }

    .input {
        box-sizing: border-box;
        width: 100%;
        border: 1px solid #d3d3d3;
        padding: 10px;
        border-radius: 5px;
        margin-top: .5rem;
    }

    #tokenframe {
        display: block;
        width: 100%;
    }

    .error {
        margin: 0;
        color: var(--df-red);
        font-size: .8rem;
    }

    .required {
        color: var(--df-red);
    }

    .disclaimer {
        margin: 0;
        color: #737373;
        text-align: center;
        font-size: 14px;
        font-weight: 400;
        line-height: 16px;
    }

    #donation-success:not(.hidden),
    #error:not(.hidden) {
        display: flex;
    }

    #donation-success,
    #error {
        width: 100%;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    #donation-success h2,
    #error h2 {
        margin-bottom: 0;
    }

    .check-green {
        color: #E5F1D3;
        margin-bottom: 4px;
    }
}

@media screen and (max-width: 920px) {
    .donation-form {
        gap: 17px;

        h4 {
            font-size: 11px;
            font-weight: 600;
            line-height: normal;
            letter-spacing: .6px;
        }

        .donation-amounts {
            gap: 8px;

            .fixed-amounts {
                .amt {
                    padding: 13px 4px;
                    min-width: 70px;
                    font-size: 15px;
                    line-height: normal;
                }
            }

            .custom-amount {
                font-size: 13px;
                font-weight: 500;
                line-height: normal;
            }
        }

        .disclaimer {
            font-size: 10px;
            line-height: 15px;
        }
    }
}
