/* Popup Background */
.chapa-popup {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    transition: opacity 0.3s ease;
}

/* --- NEW LOADING MESSAGE STYLES --- */
#chapa-loading-msg {
    text-align: center;
    margin-top: 15px;
    font-size: 15px;
    font-style: italic; /* Normal font style */
    color: #333; /* Black font color */
    font-weight: normal; /* Normal font weight */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px; /* Space between text and dots */
}

/* Three Dots Animation Container */
.loading-dots {
    display: inline-flex;
    align-items: baseline;
    overflow: hidden;
    width: 14px; /* Fixed width to prevent jumpiness */
}

/* Single Dot Styling and Animation */
.dot {
    display: inline-block;
    font-size: 1.2em; /* Makes the dot slightly larger than the text */
    line-height: 1;
    animation: dot-fade 1.5s infinite;
    opacity: 0;
}

/* Delay for each dot to create the sequence effect */
.dot:nth-child(1) {
    animation-delay: 0.0s;
}
.dot:nth-child(2) {
    animation-delay: 0.5s;
}
.dot:nth-child(3) {
    animation-delay: 1.0s;
}

/* Keyframes for the dot fading/blinking animation */
@keyframes dot-fade {
    0%, 20% { opacity: 0; }
    40%, 60% { opacity: 1; }
    80%, 100% { opacity: 0; }
}
/* --- END NEW LOADING MESSAGE STYLES --- */


/* Form Container */
.chapa-popup-content {
    background: #fff;
    margin: 5% auto;
    padding: 30px 30px 40px;
    width: 90%;
    max-width: 420px;
    border-radius: 18px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.18);
    position: relative;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    animation: slideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Slide Up Animation */
@keyframes slideUp {
    from { transform: translateY(60px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Close Button with Circle Background */
.chapa-close {
    position: absolute;
    top: 12px; /* spacing from top */
    right: 12px; /* spacing from right */
    width: 38px; /* circle size */
    height: 38px;
    background-color: #fcd9b6; /* light orange background */
    border: none;
    border-radius: 50%; /* circular shape */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: transform 0.25s ease, background-color 0.3s ease;
    z-index: 10; /* above content */
}

.chapa-close:hover {
    background-color: #f18500; /* darker orange on hover */
}

.chapa-close .close-icon {
    stroke: #f18500; /* icon color */
    width: 20px;
    height: 20px;
    transition: stroke 0.25s ease, transform 0.25s ease;
}

.chapa-close:hover .close-icon,
.chapa-close:focus .close-icon {
    stroke: #fff; /* icon turns white on hover/focus */
    transform-origin: center;
    animation: closeSpin 0.4s ease forwards;
    outline: none;
}

@keyframes closeSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(180deg); }
}

/* Titles */
.popup-title {
    font-weight: 700;
    font-size: 24px;
    color: #222;
    text-align: center;
    margin-bottom: 6px;
    letter-spacing: 0.04em;
}

.popup-subtitle {
    font-size: 14px;
    color: #555;
    text-align: center;
    margin-bottom: 22px;
    font-weight: 500;
    line-height: 1.3;
}

/* Form Elements */
.chapa-popup-content input[type="text"],
.chapa-popup-content input[type="email"],
.chapa-popup-content input[type="number"] {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 18px;
    border: 1.8px solid #ccc;
    border-radius: 14px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.chapa-popup-content input:focus {
    border-color: #f18500;
    box-shadow: 0 0 8px rgba(241, 133, 0, 0.5);
    outline: none;
}

/* Currency Radio Buttons */
.currency-group {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 20px;
    font-size: 15px;
    font-weight: 600;
    border: none;
}

.currency-group legend {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
}

.currency-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    color: #333;
    background-color: #f7f7f7;
}

.currency-group input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-radius: 50%;
    background-color: #fff;
    cursor: pointer;
    position: relative;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.currency-group input[type="radio"]:checked {
    background-color: #f18500;
    border-color: #f18500;
}

.currency-group input[type="radio"]:checked + span {
    color: #f18500;
}

/* Submit Button */
.submit-btn {
    background-color: #f18500;
    color: #fff;
    font-size: 16px;
    padding: 12px 0;
    border: none;
    border-radius: 10px;
    width: 100%;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-btn:hover {
    background-color: #d36e00;
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    .chapa-popup-content {
        padding: 25px 20px 30px;
    }
    .popup-title {
        font-size: 20px;
    }
    .popup-subtitle {
        font-size: 13px;
    }
    .chapa-close {
        width: 32px;
        height: 32px;
        top: 10px;
        right: 10px;
    }
    .chapa-close .close-icon {
        width: 16px;
        height: 16px;
    }
}