/* ==============================================
   Manav Rachna — Modern Floating/Sidebar Form
   ============================================== */

/* CTA Tab/Button — shown when form is hidden */
#mr-apply-tab {
    position: fixed !important;
    top: 50% !important;
    right: 0 !important;
    transform: translateY(-50%) rotate(180deg) !important;
    z-index: 999997 !important;
    background: #c0392b;
    color: #fff;
    writing-mode: vertical-rl;
    padding: 18px 12px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    border-radius: 8px 0 0 8px;
    box-shadow: -4px 0 15px rgba(0,0,0,0.15);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    user-select: none;
    opacity: 0;
    visibility: hidden;
}
#mr-apply-tab:hover {
    background: #a82e22;
    padding-right: 16px;
}
#mr-apply-tab.mr-visible {
    opacity: 1;
    visibility: visible;
}

/* Dark overlay (used only when form is opened via CTA on mobile to focus input) */
#mr-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999998;
    backdrop-filter: blur(2px);
    transition: opacity 0.3s ease;
}
#mr-overlay.mr-open {
    display: block;
}

/* Form panel — floating card by default */
.mr-form-wrapper {
    position: fixed !important;
    top: 50% !important;
    right: 24px !important;
    transform: translateY(-50%) !important;
    z-index: 999999 !important;
    width: 350px !important;
    max-height: 85vh !important;
    overflow-y: auto !important;
    background: #ffffff !important;
    border-radius: 16px !important;
    padding: 24px 20px 20px !important;
    box-shadow: 0 15px 35px rgba(0,0,0,0.12), 0 5px 15px rgba(0,0,0,0.06) !important;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif !important;
    box-sizing: border-box !important;
    transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.4s ease, visibility 0.4s ease !important;
    margin: 0 !important;
    float: none !important;
    bottom: auto !important;
    left: auto !important;
    opacity: 1;
    visibility: visible;
    border: 1px solid rgba(0,0,0,0.05) !important;
}

/* Scrollbar styling for form wrapper */
.mr-form-wrapper::-webkit-scrollbar {
    width: 6px;
}
.mr-form-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
.mr-form-wrapper::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}
.mr-form-wrapper::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Hidden state */
.mr-form-wrapper.mr-hidden {
    right: -400px !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Close button */
.mr-close-btn {
    position: absolute !important;
    top: 14px !important;
    right: 14px !important;
    background: #f5f6fa !important;
    border: none !important;
    font-size: 20px !important;
    color: #7f8c8d !important;
    cursor: pointer !important;
    line-height: 1 !important;
    padding: 0 !important;
    width: 28px !important;
    height: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    transition: all 0.2s ease !important;
    z-index: 10 !important;
}
.mr-close-btn:hover {
    background: #ebedf2 !important;
    color: #2c3e50 !important;
    transform: rotate(90deg);
}

/* Header styling */
.mr-form-header {
    text-align: center;
    margin-bottom: 20px;
    padding-top: 4px;
}
.mr-form-title {
    color: #c0392b;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px;
    line-height: 1.2;
    letter-spacing: -0.5px;
}
.mr-form-subtitle {
    color: #7f8c8d;
    font-size: 13px;
    margin: 0;
    font-weight: 500;
}

/* Fields & inputs */
.mr-form-field {
    margin-bottom: 12px;
}
.mr-input {
    width: 100% !important;
    padding: 11px 14px !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    color: #1a202c !important;
    background: #fff !important;
    box-sizing: border-box !important;
    outline: none !important;
    transition: all 0.2s ease !important;
}
.mr-input:focus {
    border-color: #1a3fa8 !important;
    box-shadow: 0 0 0 3px rgba(26,63,168,0.12) !important;
}
.mr-input::placeholder {
    color: #a0aec0 !important;
}

/* Phone prefix row container */
.mr-phone-field {
    display: flex !important;
    align-items: center !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 10px !important;
    background: #fff !important;
    overflow: hidden !important;
    transition: all 0.2s ease !important;
}
.mr-phone-field:focus-within {
    border-color: #1a3fa8 !important;
    box-shadow: 0 0 0 3px rgba(26,63,168,0.12) !important;
}
.mr-phone-prefix {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 0 10px !important;
    border-right: 1.5px solid #e2e8f0 !important;
    white-space: nowrap !important;
    color: #4a5568 !important;
    height: 42px !important;
    background: #f8fafc !important;
    flex-shrink: 0 !important;
    user-select: none;
}
.mr-flag {
    font-size: 15px;
}
.mr-code {
    font-weight: 600;
    font-size: 13px;
}
.mr-input-phone {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    flex: 1 !important;
    padding: 11px 12px !important;
    font-size: 14px !important;
    min-width: 0 !important;
}

/* Submit button */
.mr-submit-btn {
    width: 100% !important;
    background: #1a3fa8 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 13px 20px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    margin-top: 6px !important;
    box-shadow: 0 4px 12px rgba(26,63,168,0.2) !important;
}
.mr-submit-btn:hover {
    background: #10266b !important;
    box-shadow: 0 6px 16px rgba(26,63,168,0.3) !important;
    transform: translateY(-1px);
}
.mr-submit-btn:active {
    transform: translateY(0);
}
.mr-submit-btn:disabled {
    background: #cbd5e1 !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
}

/* Disclaimer text */
.mr-form-disclaimer {
    font-size: 11px !important;
    color: #718096 !important;
    text-align: center !important;
    margin: 12px 0 0 !important;
    line-height: 1.4 !important;
}

/* Success/Error message cards */
.mr-form-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 14px;
    font-size: 13.5px;
    margin-bottom: 12px;
    text-align: center;
    line-height: 1.5;
}
.mr-form-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    border-radius: 10px;
    padding: 12px;
    font-size: 13px;
    margin-bottom: 12px;
    text-align: center;
}
.mr-input.mr-field-error {
    border-color: #ef4444 !important;
    background-color: #fff5f5 !important;
}

/* Mobile responsive styling */
@media (max-width: 768px) {
    .mr-form-wrapper {
        top: auto !important;
        bottom: 20px !important;
        right: 16px !important;
        left: 16px !important;
        width: auto !important;
        max-width: calc(100% - 32px) !important;
        max-height: 80vh !important;
        border-radius: 16px !important;
        transform: none !important;
        transition: bottom 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.4s ease, visibility 0.4s ease !important;
        border: 1px solid rgba(0,0,0,0.1) !important;
    }
    .mr-form-wrapper.mr-hidden {
        bottom: -100% !important;
        right: 16px !important;
        left: 16px !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }
    #mr-apply-tab {
        top: auto !important;
        bottom: 24px !important;
        right: 24px !important;
        left: auto !important;
        transform: none !important;
        writing-mode: horizontal-tb !important;
        border-radius: 50px !important;
        padding: 12px 24px !important;
        letter-spacing: 1px !important;
        font-size: 14px;
        box-shadow: 0 4px 15px rgba(192,57,43,0.4);
    }
    #mr-apply-tab:hover {
        padding-right: 24px;
    }
}
