.rap-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
}

.rap-overlay.rap-visible {
    display: flex;
}

.rap-popup {
    background: #ffffff;
    border-radius: 10px;
    padding: 36px 40px;
    max-width: 520px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: rap-slide-in 0.3s ease;
    margin: auto;
}

@keyframes rap-slide-in {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.rap-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    font-size: 24px;
    color: #888;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.2s;
}

.rap-close:hover {
    color: #333;
}

.rap-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.4;
    margin: 0 0 24px;
    padding-right: 20px;
}

.rap-field {
    margin-bottom: 18px;
}

.rap-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #444;
    margin-bottom: 6px;
}

.rap-req {
    color: #e53935;
}

.rap-field input {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    color: #222;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.rap-field input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.rap-field input.rap-input-error {
    border-color: #e53935;
}

.rap-error {
    display: block;
    font-size: 12px;
    color: #e53935;
    margin-top: 4px;
    min-height: 0;
}

.rap-submit {
    width: 100%;
    margin-top: 8px;
    padding: 13px;
    background: #4f46e5;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s, opacity 0.2s;
    letter-spacing: 0.01em;
}

.rap-submit:hover {
    background: #3730a3;
}

.rap-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.rap-submit.rap-loading {
    position: relative;
    color: transparent;
}

.rap-submit.rap-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: rap-spin 0.6s linear infinite;
}

@keyframes rap-spin {
    to { transform: rotate(360deg); }
}

.rap-success-msg {
    text-align: center;
    padding: 10px 0 4px;
}

.rap-success-msg .rap-checkmark {
    font-size: 40px;
    margin-bottom: 12px;
    display: block;
}

.rap-success-msg p {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
    line-height: 1.5;
}

.rap-error-banner {
    background: #fce4ec;
    border: 1px solid #ef9a9a;
    color: #c62828;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 14px;
}

@media (max-width: 540px) {
    .rap-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .rap-popup {
        padding: 24px 20px 32px;
        border-radius: 16px 16px 0 0;
        max-width: 100%;
        width: 100%;
        margin: 0;
        animation: rap-slide-up 0.3s ease;
    }

    @keyframes rap-slide-up {
        from { opacity: 0; transform: translateY(40px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    .rap-title {
        font-size: 16px;
        margin-bottom: 18px;
    }

    .rap-field {
        margin-bottom: 14px;
    }

    .rap-submit {
        padding: 14px;
        font-size: 16px;
    }
}
