/* ============================================================
   RK POPUP FORM — COMPLETE STYLESHEET (FIXED)
   Design: Gold + Navy + Cream theme (Africa Health Movement style)
   ============================================================ */

/* ============================================================
   1. POPUP OVERLAY
   ============================================================ */
.rk-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 20, 30, 0.75);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 999999;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
    overflow-y: auto;
    box-sizing: border-box;
}

.rk-popup-overlay.rk-active {
    display: flex;
    animation: rkFadeIn 0.3s ease;
}

@keyframes rkFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes rkSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   2. FORM CONTAINER
   ============================================================ */
.rk-form-container {
    background: #fdfbf7;
    background-image:
        radial-gradient(circle at top right, rgba(201, 168, 76, 0.08) 0%, transparent 45%),
        radial-gradient(circle at bottom left, rgba(15, 42, 67, 0.04) 0%, transparent 40%);
    width: 100%;
    max-width: 1000px;
    border-radius: 18px;
    padding: 45px 50px 32px;
    position: relative;
    margin: auto;
    box-shadow:
        0 30px 70px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(201, 168, 76, 0.25);
    font-family: 'Georgia', 'Times New Roman', serif;
    border: 1px solid #e8e0d0;
    animation: rkSlideUp 0.4s ease;
    box-sizing: border-box;
    /* ✅ FIXED: overflow visible so dropdowns show properly */
    overflow: visible;
}

/* Custom scrollbar inside popup */
.rk-form-container::-webkit-scrollbar {
    width: 9px;
}
.rk-form-container::-webkit-scrollbar-track {
    background: #f1ede4;
    border-radius: 10px;
}
.rk-form-container::-webkit-scrollbar-thumb {
    background: #c9a84c;
    border-radius: 10px;
    border: 2px solid #f1ede4;
}
.rk-form-container::-webkit-scrollbar-thumb:hover {
    background: #b3923e;
}

/* ============================================================
   3. CLOSE ICON
   ============================================================ */
.rk-close-icon {
    position: absolute;
    top: 18px;
    right: 22px;
    font-size: 24px;
    color: #1a2b3c;
    cursor: pointer;
    background: #ffffff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
    transition: all 0.3s ease;
    line-height: 1;
    z-index: 50;
    font-weight: 400;
    user-select: none;
    border: 1px solid #eee5d3;
}

.rk-close-icon:hover {
    background: #c9a84c;
    color: #ffffff;
    transform: rotate(90deg) scale(1.05);
    box-shadow: 0 5px 18px rgba(201, 168, 76, 0.5);
}

/* ============================================================
   4. HEADER
   ============================================================ */
.rk-form-header {
    text-align: center;
    margin-bottom: 32px;
    position: relative;
    padding: 0 20px;
    z-index: 5;
}

.rk-sub-heading {
    color: #c9a84c;
    font-size: 13.5px;
    letter-spacing: 3.5px;
    font-weight: 700;
    margin: 0 0 4px;
    font-family: 'Arial', 'Helvetica', sans-serif;
    text-transform: uppercase;
}

.rk-sub-heading::after {
    content: '';
    display: block;
    width: 55px;
    height: 3px;
    background: #c9a84c;
    margin: 10px auto 0;
    border-radius: 2px;
}

.rk-main-heading {
    font-size: 44px;
    color: #1a2b3c;
    margin: 14px 0 12px;
    font-weight: 700;
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.12;
    letter-spacing: -0.5px;
}

.rk-desc-text {
    color: #5a6a7a;
    font-size: 16px;
    margin: 0 auto;
    line-height: 1.6;
    font-family: 'Arial', 'Helvetica', sans-serif;
    max-width: 620px;
}

/* ============================================================
   5. FORM ROWS & LAYOUT
   ============================================================ */
.rk-custom-form {
    margin-top: 22px;
    position: relative;
    z-index: 5;
    overflow: visible;
}

.rk-form-row {
    display: flex;
    gap: 22px;
    margin-bottom: 18px;
    align-items: flex-start;
    position: relative;
    overflow: visible;
}

.rk-form-row.rk-full-row {
    display: block;
}

.rk-input-box {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
    overflow: visible;
}

.rk-input-box.rk-full-width {
    width: 100%;
    flex: none;
}

.rk-label-text {
    font-size: 14.5px;
    color: #1a2b3c;
    font-weight: 700;
    margin-bottom: 7px;
    font-family: 'Arial', 'Helvetica', sans-serif;
    letter-spacing: 0.2px;
}

.rk-required {
    color: #d9534f;
    font-weight: 700;
    margin-left: 2px;
}

/* ============================================================
   6. INPUT WRAPPER + FIELDS (FIXED FOR DROPDOWN)
   ============================================================ */
.rk-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1.5px solid #d9d0c0;
    border-radius: 9px;
    transition: all 0.25s ease;
    /* ✅ FIXED: changed from hidden to visible so dropdown list is not clipped */
    overflow: visible;
    z-index: 1;
}

.rk-input-wrapper:hover {
    border-color: #c9b88c;
}

.rk-input-wrapper:focus-within {
    border-color: #c9a84c;
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.18);
    background: #fffefb;
    z-index: 20;
}

/* ✅ Icons should NOT block clicks on select/input */
.rk-input-icon,
.rk-phone-icon,
.rk-country-flag,
.rk-country-code {
    pointer-events: none;
    user-select: none;
}

.rk-input-icon {
    padding: 0 8px 0 15px;
    font-size: 16px;
    opacity: 0.6;
    display: flex;
    align-items: center;
    line-height: 1;
    flex-shrink: 0;
    color: #c9a84c;
}

.rk-input-field {
    flex: 1 1 auto;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    padding: 13px 14px 13px 0;
    font-size: 15px;
    color: #1a2b3c;
    font-family: 'Arial', 'Helvetica', sans-serif;
    width: 100%;
    box-shadow: none !important;
    border-radius: 9px;
    min-width: 0;
    line-height: 1.4;
    position: relative;
    z-index: 5;
    pointer-events: auto;
}

.rk-input-field::placeholder {
    color: #a0a8b0;
    opacity: 1;
}

.rk-input-field:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* ✅ Select styling — FIXED for clickable dropdown */
select.rk-input-field {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: transparent !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a2b3c' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 16px center !important;
    background-size: 16px !important;
    padding-right: 44px !important;
    position: relative;
    z-index: 5;
    pointer-events: auto;
    text-overflow: ellipsis;
}

/* ✅ Style the options list (works on most browsers) */
select.rk-input-field option {
    color: #1a2b3c;
    background: #ffffff;
    padding: 10px;
    font-size: 15px;
}

/* ============================================================
   7. TEXTAREA
   ============================================================ */
.rk-textarea-wrapper {
    align-items: flex-start;
    padding-top: 0;
}

.rk-textarea-wrapper .rk-input-icon {
    padding-top: 15px;
    align-self: flex-start;
}

textarea.rk-input-field,
.rk-textarea-wrapper textarea {
    resize: vertical;
    min-height: 78px;
    padding-top: 13px;
    padding-bottom: 13px;
    font-family: 'Arial', 'Helvetica', sans-serif;
    line-height: 1.5;
}

/* ============================================================
   8. PHONE FIELD (Country Flag + Code) — FIXED
   ============================================================ */
.rk-phone-wrapper {
    display: flex;
    align-items: center;
    padding-left: 0;
    overflow: visible;
}

.rk-country-flag {
    padding: 0 4px 0 13px;
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
    user-select: none;
    pointer-events: none;
}

.rk-country-code {
    font-size: 14px;
    color: #1a2b3c;
    font-weight: 600;
    font-family: 'Arial', 'Helvetica', sans-serif;
    padding-right: 8px;
    border-right: 1px solid #d9d0c0;
    margin-right: 8px;
    flex-shrink: 0;
    user-select: none;
    pointer-events: none;
}

.rk-phone-icon {
    font-size: 15px;
    opacity: 0.55;
    padding: 0 4px 0 2px;
    flex-shrink: 0;
    color: #c9a84c;
    pointer-events: none;
}

/* ============================================================
   9. DIVIDER
   ============================================================ */
.rk-divider {
    border-top: 1.5px solid #e8e0d0;
    margin: 28px 0 24px;
    position: relative;
}

.rk-divider::after {
    content: '';
    position: absolute;
    top: -1.5px;
    left: 0;
    width: 80px;
    height: 1.5px;
    background: #c9a84c;
}

/* ============================================================
   10. FORM FOOTER (Ready to contribute? + Submit)
   ============================================================ */
.rk-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    padding-bottom: 4px;
    position: relative;
    z-index: 2;
}

.rk-footer-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1 1 auto;
    min-width: 260px;
}

.rk-footer-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #f0e6d2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    border: 1.5px solid #e0d5bd;
    box-shadow: 0 3px 10px rgba(201, 168, 76, 0.18);
}

.rk-footer-text {
    display: flex;
    flex-direction: column;
}

.rk-footer-text h3 {
    margin: 0 0 4px;
    font-size: 20px;
    color: #1a2b3c;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-weight: 700;
    line-height: 1.2;
}

.rk-footer-text p {
    margin: 0;
    font-size: 14px;
    color: #5a6a7a;
    font-family: 'Arial', 'Helvetica', sans-serif;
    line-height: 1.4;
}

.rk-footer-right {
    flex-shrink: 0;
}

/* ============================================================
   11. SUBMIT BUTTON
   ============================================================ */
.rk-submit-btn {
    background: #c9a84c;
    color: #ffffff;
    border: none;
    padding: 15px 46px;
    font-size: 17px;
    font-weight: 700;
    border-radius: 9px;
    cursor: pointer;
    font-family: 'Arial', 'Helvetica', sans-serif;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    letter-spacing: 0.5px;
    box-shadow: 0 6px 18px rgba(201, 168, 76, 0.4);
    text-transform: none;
    line-height: 1;
    white-space: nowrap;
}

.rk-submit-btn:hover {
    background: #b3923e;
    transform: translateY(-2px);
    box-shadow: 0 9px 24px rgba(201, 168, 76, 0.55);
}

.rk-submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(201, 168, 76, 0.4);
}

.rk-submit-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
}

.rk-arrow {
    font-size: 20px;
    transition: transform 0.3s ease;
    line-height: 1;
    display: inline-block;
}

.rk-submit-btn:hover .rk-arrow {
    transform: translateX(5px);
}

/* ============================================================
   12. ERROR MESSAGE
   ============================================================ */
#rkErrorMsg {
    margin-top: 16px;
    padding: 13px 18px;
    background: #fdecea;
    color: #b32d2e;
    border: 1px solid #f5c6cb;
    border-left: 4px solid #b32d2e;
    border-radius: 8px;
    font-family: 'Arial', 'Helvetica', sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* ============================================================
   13. SUCCESS VIEW
   ============================================================ */
#rkSuccessMessage {
    text-align: center;
    padding: 55px 25px;
    animation: rkFadeIn 0.5s ease;
}

.rk-success-icon {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c9a84c, #b3923e);
    color: #ffffff;
    font-size: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 26px;
    box-shadow: 0 10px 30px rgba(201, 168, 76, 0.45);
    animation: rkPopIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    line-height: 1;
    padding-left: 4px;
    font-weight: 700;
}

@keyframes rkPopIn {
    0%   { transform: scale(0); opacity: 0; }
    70%  { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

.rk-success-heading {
    font-size: 36px;
    color: #1a2b3c;
    margin: 0 0 14px;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-weight: 700;
    line-height: 1.2;
}

.rk-success-text {
    font-size: 17px;
    color: #5a6a7a;
    line-height: 1.7;
    font-family: 'Arial', 'Helvetica', sans-serif;
    margin: 0 auto;
    max-width: 480px;
}

/* ============================================================
   14. RESPONSIVE — TABLET (max-width: 768px)
   ============================================================ */
@media (max-width: 768px) {

    .rk-popup-overlay {
        padding: 20px 12px;
        align-items: flex-start;
    }

    .rk-form-container {
        padding: 32px 24px 24px;
        border-radius: 14px;
        max-width: 100%;
    }

    .rk-form-row {
        flex-direction: column;
        gap: 16px;
        margin-bottom: 16px;
    }

    .rk-main-heading {
        font-size: 32px;
    }

    .rk-sub-heading {
        font-size: 12px;
        letter-spacing: 2.5px;
    }

    .rk-desc-text {
        font-size: 15px;
    }

    .rk-form-footer {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 18px;
    }

    .rk-footer-left {
        justify-content: center;
        text-align: left;
        min-width: 0;
    }

    .rk-footer-right {
        width: 100%;
    }

    .rk-submit-btn {
        width: 100%;
        justify-content: center;
        padding: 15px 30px;
    }

    .rk-close-icon {
        top: 12px;
        right: 14px;
        width: 36px;
        height: 36px;
        font-size: 22px;
    }

    .rk-form-header {
        padding: 0 10px;
        margin-bottom: 24px;
    }

    .rk-divider {
        margin: 22px 0 20px;
    }
}

/* ============================================================
   15. RESPONSIVE — MOBILE (max-width: 480px)
   ============================================================ */
@media (max-width: 480px) {

    .rk-popup-overlay {
        padding: 12px 8px;
    }

    .rk-form-container {
        padding: 26px 18px 20px;
        border-radius: 12px;
    }

    .rk-main-heading {
        font-size: 26px;
        margin: 10px 0 10px;
    }

    .rk-sub-heading {
        font-size: 11px;
        letter-spacing: 2px;
    }

    .rk-sub-heading::after {
        width: 45px;
        margin-top: 8px;
    }

    .rk-desc-text {
        font-size: 14px;
        line-height: 1.55;
    }

    .rk-label-text {
        font-size: 13.5px;
    }

    .rk-input-field {
        font-size: 14.5px;
        padding: 12px 12px 12px 0;
    }

    .rk-input-icon {
        padding: 0 6px 0 12px;
        font-size: 15px;
    }

    .rk-country-flag {
        font-size: 16px;
        padding-left: 10px;
    }

    .rk-country-code {
        font-size: 13px;
    }

    .rk-footer-icon {
        width: 46px;
        height: 46px;
        font-size: 20px;
    }

    .rk-footer-text h3 {
        font-size: 17px;
    }

    .rk-footer-text p {
        font-size: 13px;
    }

    .rk-submit-btn {
        padding: 14px 24px;
        font-size: 16px;
    }

    .rk-success-heading {
        font-size: 28px;
    }

    .rk-success-text {
        font-size: 15px;
    }

    .rk-success-icon {
        width: 72px;
        height: 72px;
        font-size: 38px;
    }

    #rkSuccessMessage {
        padding: 35px 12px;
    }
}

/* ============================================================
   16. ACCESSIBILITY & PRINT
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .rk-popup-overlay,
    .rk-form-container,
    .rk-success-icon,
    #rkSuccessMessage {
        animation: none !important;
        transition: none !important;
    }
}

@media print {
    .rk-popup-overlay {
        display: none !important;
    }
}

/* Remove default browser autofill yellow background */
.rk-input-field:-webkit-autofill,
.rk-input-field:-webkit-autofill:hover,
.rk-input-field:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
    -webkit-text-fill-color: #1a2b3c !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* ============================================================
   17. DECORATIVE ELEMENTS (Africa Map + Gold Circles)
   ✅ FIXED: overflow:hidden ONLY on decoration wrapper, NOT container
   ============================================================ */
.rk-decor-top-right {
    position: absolute;
    top: 0;
    right: 0;
    width: 280px;
    height: 260px;
    overflow: hidden;
    border-top-right-radius: 18px;
    pointer-events: none;
    z-index: 1;
}

.rk-africa-map {
    position: absolute;
    top: 10px;
    right: 40px;
    width: 180px;
    height: 200px;
    opacity: 0.55;
}

.rk-circle-decoration {
    position: absolute;
    top: -80px;
    right: -80px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c9a84c 0%, #b3923e 100%);
    opacity: 0.9;
}

.rk-circle-decoration::before {
    content: '';
    position: absolute;
    top: 30px;
    left: 30px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: transparent;
    border: 1px dashed rgba(255,255,255,0.3);
}

/* ============================================================
   18. SVG ICONS INSIDE INPUTS
   ============================================================ */
.rk-input-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.rk-footer-icon svg {
    width: 28px;
    height: 28px;
    display: block;
}

/* ============================================================
   19. PHONE CODE SELECT (Flag + Dial Code Dropdown) — FIXED
   ============================================================ */
.rk-phone-code-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: transparent;
    border: none;
    outline: none;
    font-size: 14px;
    color: #1a2b3c;
    font-weight: 600;
    font-family: 'Arial', 'Helvetica', sans-serif;
    padding: 13px 22px 13px 14px;
    cursor: pointer;
    border-right: 1px solid #d9d0c0;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a2b3c' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 12px;
    max-width: 130px;
    flex-shrink: 0;
    position: relative;
    z-index: 6;
    pointer-events: auto;
}

.rk-phone-code-select:focus {
    outline: none;
    background-color: #fffefb;
}

.rk-phone-code-select option {
    color: #1a2b3c;
    background: #ffffff;
    padding: 8px;
    font-size: 14px;
}

.rk-phone-wrapper .rk-phone-icon {
    padding: 0 4px 0 10px;
    pointer-events: none;
    position: relative;
    z-index: 1;
}

.rk-phone-wrapper .rk-phone-icon svg {
    width: 16px;
    height: 16px;
}

/* ============================================================
   20. RESPONSIVE ADJUSTMENTS FOR DECORATIONS
   ============================================================ */
@media (max-width: 768px) {
    .rk-decor-top-right {
        width: 160px;
        height: 160px;
        border-top-right-radius: 14px;
    }
    .rk-africa-map {
        width: 100px;
        height: 120px;
        right: 20px;
        opacity: 0.35;
    }
    .rk-circle-decoration {
        width: 130px;
        height: 130px;
        top: -50px;
        right: -50px;
    }
    .rk-circle-decoration::before {
        width: 90px;
        height: 90px;
        top: 20px;
        left: 20px;
    }
    .rk-phone-code-select {
        max-width: 100px;
        font-size: 13px;
        padding: 12px 20px 12px 10px;
    }
}

@media (max-width: 480px) {
    .rk-decor-top-right {
        width: 110px;
        height: 110px;
        border-top-right-radius: 12px;
    }
    .rk-africa-map {
        width: 70px;
        height: 85px;
        right: 10px;
    }
    .rk-circle-decoration {
        width: 90px;
        height: 90px;
        top: -35px;
        right: -35px;
    }
    .rk-circle-decoration::before {
        width: 60px;
        height: 60px;
        top: 15px;
        left: 15px;
    }
    .rk-phone-code-select {
        max-width: 90px;
        font-size: 12px;
        padding: 12px 18px 12px 8px;
    }
}