/* Donor info popup */

@keyframes rotation {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Shared popup styles */

.popup-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
}

.popup-card {
    position: relative;
    background: #fff;
    width: 100%;
    max-width: 100vw;
    min-height: auto;
    padding: 0;
    box-sizing: border-box;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    align-self: flex-start;
}

.popup-header {
    position: relative;
    display: flex;
    flex-direction: row-reverse;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0;
    padding: 28px 10px 20px;
    height: 202px;
}

.popup-heading {
    position: absolute;
    top: 112px;
    left: 0;
    right: 0;
    width: auto;
    text-align: center;
    font-size: 27px;
    font-weight: 400;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: rgb(34, 34, 34);
    margin: 0;
    padding: 0;
}

.popup-content {
    border-top: 1px solid rgb(214, 214, 214);
    border-bottom: 1px solid rgb(214, 214, 214);
    background-color: rgb(251, 251, 251);
    padding: 19px 10px 25px;
    margin: 0;
    height: auto;
}

.popup-footer {
    padding: 20px 10px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    margin: 0;
}

.popup-card > form {
    display: flex;
    flex-direction: column;
}

.popup-close {
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    color: rgb(107, 111, 116);
    width: 32px;
    height: 32px;
    padding: 4px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-errors {
    color: #cc0000;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.popup-card .form-field input.is-invalid,
.popup-card .form-field select.is-invalid {
    border: 2px solid #cc0000;
}

.form-field {
    position: relative;
    margin-bottom: 1rem;
}

.form-field label {
    position: absolute;
    top: 18px;
    left: 12px;
    font-size: 16px;
    color: rgb(109, 110, 120);
    font-weight: 400;
    pointer-events: none;
    z-index: 1;
    transition: top 0.15s ease, font-size 0.15s ease;
}

.form-field.is-focused label,
.form-field.has-value label {
    top: 8px;
    font-size: 12px;
}

.form-field input,
.form-field select {
    width: 100%;
    background-color: #fff;
    border: 2px solid #d0d0d0;
    border-radius: 6px;
    padding: 22px 12px 6px;
    box-sizing: border-box;
    font-size: 1rem;
    height: 56px;
}

.form-field input::placeholder {
    color: transparent;
}

.form-field.is-focused input::placeholder {
    color: rgb(164, 165, 175);
}

.form-field input:focus,
.form-field select:focus {
    border: 2px solid rgb(5, 112, 222);
    outline: none;
}

.popup-submit {
    background: #000;
    color: #fff;
    border: 1px solid rgb(214, 214, 214);
    border-radius: 4px;
    padding: 16px 34px;
    font-size: 1rem;
    line-height: 1;
    width: 85%;
    margin: 0 auto;
    cursor: pointer;
}

.popup-submit:hover:not(:disabled) {
    background: #333;
}

.popup-submit:disabled {
    background: rgb(238, 238, 239);
    color: rgb(107, 111, 116);
    cursor: not-allowed;
}

/* Desktop: fixed height with scroll */
@media (min-width: 768px) {
    .popup-backdrop {
        display: flex;
        justify-content: center;
        align-items: flex-start;
        padding-top: 30px;
        overflow-y: hidden;
    }

    .popup-card {
        max-width: 399px;
        height: auto;
        min-height: auto;
        max-height: calc(100vh - 60px);
        border-radius: 15px;
        width: 100%;
        display: flex;
        flex-direction: column;
    }

    .popup-card > form {
        flex: 1 1 auto;
        min-height: 0;
    }

    .popup-header {
        flex-shrink: 0;
    }

    .popup-card .popup-content {
        overflow-y: auto;
    }

    .popup-card .popup-footer {
        flex: 0 0 auto;
    }

    .popup-header,
    .popup-content,
    .popup-footer {
        padding-left: 35px;
        padding-right: 35px;
    }
}

/* Donor info popup specifics */

#donor-info-total {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 8px;
    font-size: 18px;
    line-height: 1.1;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: rgb(107, 111, 116);
    margin: 0 auto;
    width: fit-content;
}

#donor-info-total-amount {
    font-weight: 600;
    color: rgb(34, 34, 34);
}

/* Donor info popup specifics — desktop */
@media (min-width: 768px) {
    #donor-info-content {
        overflow-y: auto;
        height: 300px;
        transition: height 0.4s ease;
    }

    #donor-info-modal.is-expanded #donor-info-content {
        height: 404px;
    }
}

/* Processing overlay specifics */

#payment-processing-inner {
    height: auto;
    min-height: 150px;
    min-width: 235px;
    margin: 0 auto;
}

#payment-processing-please {
    font-size: 16px;
    color: rgb(34, 34, 34);
    margin: 0 0 1.45rem;
    line-height: 25px;
    min-height: 25px;
    text-align: left;
}


#payment-processing-status-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.payment-processing-status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 20px;
}

.payment-processing-status-row span {
    font-size: 18px;
    font-weight: 600;
    color: rgb(34, 34, 34);
    line-height: 1;
}

.payment-processing-checkmark {
    color: #28a745;
    font-size: 24px;
    line-height: 1;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.payment-processing-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #669bc3;
    border-radius: 50%;
    border-top-color: transparent;
    animation: rotation .8s linear infinite;
    flex-shrink: 0;
}

#payment-processing-note {
    font-size: 16px;
    color: rgb(34, 34, 34);
    margin: 1.45rem 0 0;
    min-height: 25px;
    line-height: 25px;
}

#payment-processing-total {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 8px;
    font-size: 18px;
    line-height: 1.1;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: rgb(107, 111, 116);
}

#payment-processing-total-amount {
    font-weight: 600;
    color: rgb(34, 34, 34);
}
