/* Retention Pro Styles - Fully Scoped & Isolated */

/* All styles scoped to .rp-modal or .rp-modal-overlay to prevent global conflicts */

.rp-modal-overlay,
#rp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(30, 20, 60, 0.9) 100%);
    z-index: 99998;
    backdrop-filter: blur(5px);
}

.rp-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 99999;
    width: 92%;
    max-width: var(--rp-width, 750px);
    font-family: var(--rp-font, 'Inter', 'Poppins', 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
}

.rp-modal-content {
    background: linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%);
    padding: var(--rp-padding, 50px);
    border-radius: var(--rp-radius, 20px);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
    text-align: center;
    color: var(--rp-text, #1a1a1a);
    position: relative;
    border: var(--rp-border, 2px solid rgba(102, 126, 234, 0.3));
}

.rp-modal h2,
.rp-modal h3 {
    margin-top: 0;
    color: var(--rp-text, #1a1a1a);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
}

.rp-modal h2 {
    font-size: var(--rp-head-size, 28px);
}

.rp-modal h3 {
    font-size: var(--rp-head-size, 24px);
    margin-bottom: 18px;
    font-weight: 600;
}

.rp-modal p,
.rp-modal label,
.rp-modal li {
    font-size: var(--rp-body-size, 16px);
    color: var(--rp-text, #444);
    line-height: 1.7;
    font-weight: 400;
}

.rp-modal p {
    margin-bottom: 30px;
    line-height: 1.7;
}

/* Step 1: Reasons - CRITICAL: Must display vertically with visible text */
.rp-modal .rp-reasons-list {
    text-align: left;
    margin: 30px 0;
    display: block;
    /* Changed from flex to ensure compatibility */
    width: 100%;
}

.rp-modal .rp-reason-option,
.rp-modal .rp-reason-label {
    display: block;
    /* CRITICAL: Force block display */
    width: 100%;
    padding: 18px 22px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    margin: 0 0 14px 0;
    /* Bottom margin for spacing between items */
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--rp-text, #1a1a1a);
    background: #ffffff;
    position: relative;
    font-size: 16px;
    line-height: 1.5;
}

.rp-modal .rp-reason-option:hover,
.rp-modal .rp-reason-label:hover {
    background: rgba(102, 126, 234, 0.08);
    border-color: #667eea;
    transform: translateX(6px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.rp-modal .rp-reason-option input[type="radio"],
.rp-modal .rp-reason-label input[type="radio"] {
    margin-right: 14px;
    vertical-align: middle;
    width: 18px;
    height: 18px;
}

.rp-modal .rp-reason-option span {
    vertical-align: middle;
    font-weight: 500;
    font-size: 16px;
    display: inline;
    /* Ensure span displays */
    color: inherit;
}

/* Step 2: Benefits & Offer */
.rp-modal .rp-benefits-list {
    text-align: left;
    margin: 25px 0 35px 0;
    padding-left: 25px;
    color: #d63638;
    list-style-type: disc;
    display: block;
}

.rp-modal .rp-benefits-list li {
    display: list-item;
    /* CRITICAL: Force list-item display */
    margin-bottom: 12px;
    font-weight: 500;
    line-height: 1.6;
    font-size: 16px;
    padding-left: 5px;
}

.rp-modal .rp-offer-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: none;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.rp-modal .rp-offer-box h3 {
    margin: 0 0 20px 0;
    color: #ffffff;
    font-size: 22px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Other Reason Textarea */
.rp-other-reason-container {
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
}

.rp-other-reason-text {
    width: 100%;
    padding: 12px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.2s;
}

.rp-other-reason-text:focus {
    outline: none;
    border-color: var(--rp-primary, #007cba);
}

/* Actions */
.rp-modal .rp-actions {
    margin-top: 25px;
    margin-bottom: 15px;
}

.rp-modal .rp-btn-next,
.rp-modal .rp-btn-accept {
    width: 100%;
    padding: 16px 24px !important;
    font-size: 17px !important;
    height: auto !important;
    background-color: #ffffff !important;
    border-color: #ffffff !important;
    color: #667eea !important;
    border-radius: 10px;
    font-family: var(--rp-font, 'Inter', sans-serif);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.rp-modal .rp-btn-next:hover,
.rp-modal .rp-btn-accept:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
    background-color: #f8f9ff !important;
}

.rp-modal .rp-btn-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.rp-modal .rp-footer {
    font-size: 14px;
    margin-top: 20px;
}

.rp-modal .rp-close-modal,
.rp-modal .rp-link-cancel {
    color: #666;
    text-decoration: underline;
    cursor: pointer;
    font-size: 14px;
    display: inline-block;
    margin-top: 15px;
    transition: color 0.2s;
}

.rp-modal .rp-close-modal:hover,
.rp-modal .rp-link-cancel:hover {
    color: #333;
}