/* ============================================================
   RAZORPAY MODAL – Complete Styles
   Includes: overlay, modal card, order summary, form inputs,
   OTP section (70/30 split), buttons, animations, responsive.
   ============================================================ */


/* ---------- Modal Overlay ---------- */
.rzp-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.25s ease;
}

/* ---------- Modal Content ---------- */
.rzp-modal-content {
    background: #ffffff;
    top: 4%;
    border-radius: 16px;
    max-width: 440px;
    width: 92%;
    margin: 0 auto;
    padding: 35px 30px 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 10000000;
    animation: slideUp 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Close Button ---------- */
.rzp-modal-close {
    position: absolute;
    right: 18px;
    top: 12px;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    color: #aaa;
    transition: color 0.2s;
    line-height: 1;
}
.rzp-modal-close:hover {
    color: #333;
}

/* ---------- Heading ---------- */
.rzp-modal-content h3 {
    margin-top: 0;
    font-weight: 600;
    font-size: 22px;
    color: #1a1a1a;
    letter-spacing: -0.3px;
    border-bottom: 2px solid #f0f2f5;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

/* ---------- Order Summary ---------- */
.rzp-order-summary {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 22px;
    border: 1px solid #e9edf2;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.02);
}

.rzp-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 15px;
    border-bottom: 1px dashed #e2e8f0;
}
.rzp-summary-row:last-of-type {
    border-bottom: none;
}

.rzp-summary-label {
    color: #5a6a7a;
}
.rzp-summary-value {
    color: #1a1a2e;
    text-align: right;
}

.rzp-summary-total {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 2px solid #d0d7de;
    font-size: 17px;
}
.rzp-summary-total .rzp-summary-value {
    color: #0d2b4e;
    font-size: 19px;
}

/* ---------- Form Groups ---------- */
.rzp-form-group {
    margin-bottom: 18px;
}
.rzp-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
    color: #444;
}
.rzp-form-group input,
.rzp-form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 16px;
    background: #fafbfc;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.rzp-form-group input:focus,
.rzp-form-group select:focus {
    border-color: #528FF0;
    outline: none;
    box-shadow: 0 0 0 3px rgba(82, 143, 240, 0.2);
    background: #fff;
}

/* ---------- Phone group ---------- */
.rzp-phone-group {
    gap: 10px;
}
.rzp-phone-group select {
    width: 110px;
    flex-shrink: 0;
}
.rzp-phone-group input {
    flex: 1;
}

/* ---------- OTP Section ---------- */
.rzp-otp-section {
    margin-top: 8px;
}
.rzp-otp-section .rzp-form-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* OTP input – 70% width */
.rzp-otp {
    flex: 0 0 70% !important;
    width: 70% !important;
    box-sizing: border-box;
}

/* Verify OTP button – 30% width */
.rzp-verify-otp-btn {
    flex: 0 0 30% !important;
    width: 30% !important;
    white-space: nowrap;
    text-align: center;
    padding: 12px 10px;
    box-sizing: border-box;
}

.rzp-otp-message {
    font-size: 14px;
    font-weight: 500;
    margin-top: 6px;
}

/* ---------- Buttons ---------- */
.rzp-send-otp-btn,
.rzp-close-success-btn,
.rzp-verify-otp-btn,
.rzp-pay-now-btn {
    background: linear-gradient(135deg, #528FF0, #3a7bd5);
    color: #fff;
    border: none;
    padding: 14px 20px !important;
    border-radius: 12px;
    font-size: 16px !important;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
    width: 100% !important;
    text-align: center;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 10px rgba(82, 143, 240, 0.3);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.rzp-send-otp-btn:hover,
.rzp-verify-otp-btn:hover,
.rzp-pay-now-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(82, 143, 240, 0.4);
}
.rzp-send-otp-btn:active,
.rzp-verify-otp-btn:active,
.rzp-pay-now-btn:active {
    transform: translateY(0);
}
.rzp-send-otp-btn:disabled,
.rzp-verify-otp-btn:disabled,
.rzp-pay-now-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Pay Now button – hidden initially, centered */
.rzp-pay-now-btn {
    display: none;
    margin: 10px auto 0;
    width: auto;
    min-width: 200px;
}

/* ---------- Spinner ---------- */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-left: 8px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Success Message Styles ---------- */
.rzp-success-message {
    background: #f0fdf4;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #bbf7d0;
}
.rzp-success-message .rzp-payment-id {
    font-weight: bold;
    color: #16a34a;
}
.rzp-close-success-btn {
    background: linear-gradient(135deg, #528FF0, #3a7bd5);
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.15s;
    width: auto;
    margin: 0 auto;
    display: inline-block;
}
.rzp-close-success-btn:hover {
    transform: scale(1.02);
}

/* ---------- Responsive Adjustments ---------- */
@media (max-width: 480px) {
    .rzp-modal-content {
        padding: 20px 15px 20px;
        max-height: 95vh;
        overflow-y: auto;
    }

    .rzp-phone-group {
        flex-direction: column;
        gap: 6px;
    }
    .rzp-phone-group select {
        width: 100%;
    }

    /* Stack OTP input and button vertically */
    .rzp-otp-section .rzp-form-group {
        flex-direction: column;
        align-items: stretch;
    }
    .rzp-otp {
        flex: 0 0 100% !important;
        width: 100% !important;
        margin-bottom: 8px;
    }
    .rzp-verify-otp-btn {
        flex: 0 0 100% !important;
        width: 100% !important;
    }

    /* Pay Now – full width on mobile, centered */
    .rzp-pay-now-btn {
        width: 100% !important;
        min-width: unset;
        margin: 10px 0 0 !important;
        display: block;
    }

    /* Ensure all buttons are full width */
    .rzp-send-otp-btn {
        width: 100%;
    }
    .rzp-close-success-btn {
        width: 100%;
        box-sizing: border-box;
    }

    /* Adjust order summary font sizes */
    .rzp-summary-row {
        font-size: 14px;
    }
    .rzp-summary-total .rzp-summary-value {
        font-size: 17px;
    }
}