#ipospays-modal {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    /* background: rgba(15, 2, 28, 0.7); */
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px; /* Ensures safe spacing on tiny mobile viewports */
    box-sizing: border-box;
}

.ipospays-box {
    position: relative;
    width: 100%;
    max-width: 440px; /* Slimmed down width */
    background: #ffffff;
    padding: 24px; /* Tighter internal padding reduces overall height */
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(154, 23, 255, 0.15);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    box-sizing: border-box;
    min-height: auto; /* Removed explicit minimum height completely */
    max-height: 90vh; /* Prevents taller flows from clipping screen frames */
    overflow-y: auto; /* Safe fallback container scrolling for small screens */
}

.ipospays-brand-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0ecf7;
}

.ipospays-logo {
    max-height: 26px; /* Slightly more compact */
    width: auto;
    object-fit: contain;
}

/* Centered Form Loading Presentation Layout styles */
.ipospays-processing-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 10px;
    text-align: center;
    animation: fadeInShort 0.25s ease-out;
}

.ipospays-center-gif {
    max-height: 50px;
    width: auto;
    margin-bottom: 12px;
}

.ipospays-loader-text {
    font-size: 14px;
    color: #9a17ff;
    font-weight: 500;
    margin: 0;
}

.ipospays-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #a7aaad;
    cursor: pointer;
    padding: 5px;
    z-index: 10;
    transition: color 0.15s ease;
}

.ipospays-close-btn:hover {
    color: #9a17ff;
}

.ipospays-box h2 {
    margin: 0 0 6px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
}

.ipospays-subtitle {
    margin: 0 0 16px 0;
    color: #646970;
    font-size: 13px;
    line-height: 1.4;
}

.ipospays-reasons-list {
    display: flex;
    flex-direction: column;
    gap: 8px; /* Tighter gap rows */
    margin-bottom: 16px;
}

.ipospays-radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    color: #1d2327;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #e2e4e6;
    transition: all 0.2s ease;
}

.ipospays-radio-label:hover {
    background: #f9f6ff;
    border-color: #dcbfff;
}

.ipospays-radio-label input[type="radio"] {
    margin: 0;
    border-color: #8c8f94;
    flex-shrink: 0;
}

.ipospays-radio-label input[type="radio"]:checked {
    border-color: #9a17ff !important;
    background: #9a17ff !important;
}

.ipospays-radio-label input[type="radio"]:checked::before {
    background-color: #fff !important;
}

.ipospays-comments-wrapper {
    margin-bottom: 16px;
    animation: fadeInShort 0.2s ease-out;
}

#ipospays-comments {
    width: 100%;
    padding: 10px;
    border: 1px solid #8c8f94;
    border-radius: 6px;
    font-size: 13.5px;
    color: #2c3338;
    resize: vertical;
}

#ipospays-comments:focus {
    border-color: #9a17ff;
    box-shadow: 0 0 0 1px #9a17ff;
    outline: 2px solid transparent;
}

.ipospays-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    border-top: 1px solid #f0ecf7;
    padding-top: 14px;
}

.ipospays-actions .button {
    height: 32px;
    padding: 0 14px !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    font-size: 13px !important;
    box-shadow: none !important;
}

#ipospays-submit {
    background: #9a17ff !important;
    border-color: #9a17ff !important;
    color: #fff !important;
    text-shadow: none !important;
}

#ipospays-submit:hover:not(:disabled) {
    background: #7f00e0 !important;
    border-color: #7f00e0 !important;
}

#ipospays-error {
    background: #fff5f5;
    border-left: 4px solid #d63638;
    color: #d63638;
    padding: 8px 10px;
    font-size: 12.5px;
    line-height: 1.4;
    border-radius: 0 6px 6px 0;
    margin-bottom: 12px;
}

@keyframes fadeInShort {
    from { opacity: 0; transform: translate3d(0, -5px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* Extra Responsive Adjustments for Mobile Viewports */
@media screen and (max-width: 400px) {
    .ipospays-box {
        padding: 20px 16px;
    }
    .ipospays-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }
    .ipospays-actions .button {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}

/* Email UI Elements */
.ipospays-email-wrapper {
    margin-bottom: 16px;
    text-align: left;
}

.ipospays-email-label {
    display: block;
    margin: 0 0 4px 0;
    font-size: 13.5px;
    font-weight: 600;
    color: #1d2327;
}

.ipospays-email-desc {
    display: block;
    margin: 0 0 8px 0;
    color: #646970;
    font-size: 12.5px;
    line-height: 1.4;
}

#ipospays-email {
    width: 100%;
    padding: 10px;
    border: 1px solid #8c8f94; /* Matches your textarea border */
    border-radius: 6px;        /* Matches your textarea radius */
    font-size: 13.5px;
    color: #2c3338;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

#ipospays-email:focus {
    border-color: #9a17ff; /* Matches your custom purple focus */
    box-shadow: 0 0 0 1px #9a17ff;
    outline: 2px solid transparent;
}