#factarly-contact-form-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(108, 71, 255, 0.12); /* lighter purple overlay */
    z-index: 99999;
    display: flex;
    align-items: center; /* Center vertically */
    justify-content: center; /* Center horizontally */
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    backdrop-filter: blur(5px);
    padding-top: 0; /* Remove vertical padding for true centering */
    padding-bottom: 0;
}

#factarly-contact-form-modal.visible {
    opacity: 1;
}

.nice-select {
    width: 100% !important;
}
#factarly-contact-form {
    background: #f7f4ff; /* very light purple */
    padding: 24px 18px;
    border-radius: 16px;
    min-width: 320px;
    max-width: 522px;
    /* Remove max-height and overflow-y from the form itself */
    max-height: none;
    overflow: visible;
    height: auto;
    /* Reduce shadow for less obtrusive look */
    box-shadow: 0 10px 32px -8px rgba(108, 71, 255, 0.13);
    position: relative;
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
}

#factarly-contact-form-modal.visible #factarly-contact-form {
    transform: translateY(0);
}

/* Make close button style specific to the modal popup */
#factarly-contact-form-modal .fcf-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
    transition: all 0.2s ease;
    z-index: 20;
}

#factarly-contact-form-modal .fcf-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.fcf-header {
    margin: 0 0 24px;
    text-align: left;
    padding: 20px 24px;
    background: #6c47ff;
    border-radius: 12px 12px 0 0;
    position: relative;
    margin: -24px -18px 24px;
}

.fcf-header h2 {
    font-weight: 700;
    color: #ffffff !important;
    margin-bottom: 8px !important;
    font-size: 22px;
    padding-right: 40px;
}

.fcf-header p {
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-size: 14px;
}

.fcf-steps-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    position: relative;
}

.fcf-steps-bar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: #e5dbff;
    transform: translateY(-50%);
    z-index: 0;
}

.fcf-step-indicator {
    width: 25px;
    height: 25px;
    margin-bottom: -10px;
    top: -7px;
    border-radius: 50%;
    background: #ede6ff;
    border: 3px solid #e5dbff;
    color: #b39ddb;
    display: flex
;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    position: relative;
    transition: all 0.3s ease;
    z-index: 1;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
}

.fcf-step-indicator.active {
    background: #6c47ff;
    color: #fff;
    border-color: #6c47ff;
    box-shadow: 0 0 0 5px rgba(108, 71, 255, 0.18);
    transform: scale(1.1);
}

.fcf-step-indicator.completed {
    background: #38b2ac;
    color: #fff;
    border-color: #38b2ac;
}

.fcf-step-indicator.completed::after {
    content: '✓';
    font-size: 22px;
}

.fcf-step-indicator.completed span {
    display: none;
}

.fcf-step-indicator-progress {
    position: absolute;
    top: 50%;
    left: 0;
    height: 4px;
    background: #38b2ac;
    transform: translateY(-50%);
    z-index: 0;
    transition: width 0.5s ease;
}

.fcf-step {
    /* Make only the step content scrollable if needed */
    max-height: 65vh;
    overflow-y: auto;
    margin-bottom: 16px;
    padding-right: 2px; /* for scrollbar space */
    transition: all 0.4s ease;
    opacity: 0;
    transform: translateX(20px);
    display: none;
}

.fcf-step.active {
    opacity: 1;
    transform: translateX(0);
    display: block;
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fcf-step label { 
    display: block; 
    margin-top: 10px;
    font-weight: 600;
    color: #4b2996;
    font-size: 14px;
    margin-bottom: 5px;
}

.fcf-form-control {
    margin-bottom: 12px;
}

.fcf-step input, .fcf-step select { 
    width: 100%; 
    padding: 9px 12px;
    border-radius: 6px;
    border: 2px solid #e5dbff;
    background: #f7f4ff;
    color: #4b2996;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.fcf-step input:focus, .fcf-step select:focus {
    border-color: #6c47ff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(108, 71, 255, 0.13);
    background: #fff;
}

.fcf-step input.valid {
    border-color: #38b2ac;
    background-color: #f0fdf9;
}

.fcf-step input.invalid {
    border-color: #e53e3e;
    background-color: #fff5f5;
}

.fcf-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 18px;
}

.fcf-btn {
    padding: 9px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.fcf-btn-primary {
    background: #6c47ff;
    color: #fff;
    box-shadow: 0 4px 6px rgba(108, 71, 255, 0.13);
}

.fcf-btn-primary:hover {
    background: #4b2996;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(108, 71, 255, 0.2);
}

.fcf-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(108, 71, 255, 0.1);
}

.fcf-btn-primary:disabled {
    background: #d1bfff; /* Light purple for disabled state */
    color: #fff; /* Keep text white */
    cursor: not-allowed;
    opacity: 0.7;
}

.fcf-btn-secondary {
    background: #ede6ff;
    color: #4b2996;
}

.fcf-btn-secondary:hover {
    background: #d1bfff;
    transform: translateY(-2px);
}

.fcf-btn-secondary:active {
    transform: translateY(0);
}

.fcf-btn-check {
    background: #6c47ff;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
    box-shadow: 0 4px 6px rgba(108, 71, 255, 0.15);
}

.fcf-btn-check:hover {
    background: #4b2996;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(108, 71, 255, 0.2);
}

.fcf-btn-check i {
    margin-right: 8px;
}

#fcf-instance-result {
    margin-top: 12px;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    height: 24px;
}

#fcf-instance-result.available {
    color: #38b2ac;
}

#fcf-instance-result.available::before {
    content: "✓";
    font-size: 16px;
    margin-right: 8px;
}

#fcf-instance-result.unavailable {
    color: #e53e3e;
}

#fcf-instance-result.unavailable::before {
    content: "✗";
    font-size: 16px;
    margin-right: 8px;
}

#fcf-success {
    text-align: center;
    padding: 14px;
    border-radius: 8px;
    margin-top: 14px;
    font-size: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#fcf-success i {
    font-size: 32px;
    margin-bottom: 8px;
}

#fcf-loading {
    position: absolute;
    left: 0; top: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.85);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.2s ease;
    visibility: hidden;
    border-radius: 12px;
}

#fcf-loading.active {
    opacity: 1;
    visibility: visible;
}

.fcf-loading-text {
    font-size: 14px;
    margin-top: 8px;
    font-weight: 600;
    color: #4361ee;
}

.fcf-spinner {
    border: 4px solid #e2e8f0;
    border-top: 4px solid #4361ee;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    animation: fcf-spin 1s linear infinite;
    border-width: 3px;
}

@keyframes fcf-spin {
    0% { transform: rotate(0deg);}
    100% { transform: rotate(360deg);}
}

.fcf-step input:disabled, .fcf-step select:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.7;
}

#fcf-summary {
    background: #f7f4ff;
    padding: 14px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 15px;
    border-left: 4px solid #6c47ff;
}

#fcf-summary p {
    margin: 8px 0;
    line-height: 1.6;
}

#fcf-summary strong {
    font-weight: 600;
    color: #4b2996;
}

.fcf-summary-table {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #f7f4ff;
    border-radius: 10px;
    border: 1.5px solid #e5dbff;
    box-shadow: 0 2px 8px rgba(108,71,255,0.06);
    overflow: hidden;
    margin-bottom: 14px;
    font-size: 15px;
    padding: 0;
}

.fcf-summary-row {
    display: flex;
    align-items: center;
    padding: 13px 14px;
    border-bottom: 1px solid #ede6ff;
    background: #fff;
    transition: background 0.2s;
}

.fcf-summary-row:last-child {
    border-bottom: none;
}

.fcf-summary-label {
    flex: 0 0 44%;
    font-weight: 600;
    color: #6c47ff;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 15px;
}

.fcf-summary-value {
    flex: 1 1 56%;
    color: #4b2996;
    font-weight: 500;
    word-break: break-all;
    text-align: right;
    font-size: 15px;
}

.fcf-summary-row:nth-child(even) {
    background: #f7f4ff;
}

.fcf-summary-label i {
    color: #b39ddb;
    font-size: 16px;
    margin-right: 6px;
}

@media (max-width: 640px) {
    #factarly-contact-form {
        padding: 12px 6px;
        min-width: 98vw;
        max-width: 99vw;
    }
    .fcf-step-indicator {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }
    .fcf-header h2 {
        font-size: 17px;
    }
    .fcf-plan-options {
        flex-direction: column;
    }
    .fcf-step {
        max-height: 54vh;
    }
    .fcf-summary-table {
        font-size: 13px;
    }
    .fcf-summary-label, .fcf-summary-value {
        font-size: 13px;
    }
    .fcf-summary-row {
        padding: 9px 7px;
    }
}


.fcf-tooltip {
    position: relative;
    display: inline-block;
    margin-left: 8px;
    cursor: help;
}

.fcf-tooltip-icon {
    background: #ede6ff;
    color: #4b2996;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.fcf-tooltip-text {
    visibility: hidden;
    position: absolute;
    width: 220px;
    background: #4a5568;
    color: #fff;
    text-align: center;
    padding: 10px 12px;
    border-radius: 8px;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s;
    font-weight: normal;
    font-size: 14px;
    bottom: 125%;
    left: 50%;
    margin-left: -110px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.fcf-tooltip:hover .fcf-tooltip-text {
    visibility: visible;
    opacity: 1;
}

.fcf-plan-options {
    display: flex;
    justify-content: center; /* Center the plan cards horizontally */
    gap: 8px;
    margin-top: 6px;
    flex-wrap: wrap; /* Allow wrapping for smaller screens */
}

.fcf-plan-option {
    flex: 0 1 calc(33.333% - 16px); /* Reduce width and add spacing */
    border: 2px solid #e5dbff;
    border-radius: 8px;
    padding: 8px; /* Adjust padding for compact look */
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fcf-plan-option:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -8px rgba(0, 0, 0, 0.1);
}

.fcf-plan-option.selected {
    border-color: #6c47ff;
    background: rgba(108, 71, 255, 0.07);
    transform: scale(1.05);
}

.fcf-plan-price {
    display: none; /* Hide pricing information */
}

.fcf-plan-name {
    font-weight: 700;
    font-size: 15px;
    color: #6c47ff;
}

.fcf-plan-desc {
    color: #718096;
    font-size: 12px;
    margin-top: 4px;
}

@media (max-width: 640px) {
    #factarly-contact-form {
        padding: 12px 6px;
        min-width: 98vw;
        max-width: 99vw;
    }
    .fcf-step-indicator {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }
    .fcf-header h2 {
        font-size: 17px;
    }
    .fcf-plan-options {
        flex-direction: column;
    }
    .fcf-step {
        max-height: 54vh;
    }
    .fcf-summary-table {
        font-size: 13px;
    }
    .fcf-summary-label, .fcf-summary-value {
        font-size: 13px;
    }
    .fcf-summary-row {
        padding: 9px 7px;
    }
}

.fcf-instance-domain-group {
    display: flex;
    align-items: stretch;
    margin-bottom: 2px;
    position: relative;
    /* Remove gap between input and suffix */
}

.fcf-instance-domain-group input[name="instance"] {
    flex: 1 1 auto;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
    margin-bottom: 0;
    /* Ensure height matches suffix */
    height: 38px;
    /* Remove right border for seamless look */
}

.fcf-instance-domain-suffix {
    background: #ede6ff;
    color: #6c47ff;
    font-weight: 600;
    padding: 0 12px;
    border: 2px solid #e5dbff;
    border-left: none;
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    height: 38px;
    display: flex;
    align-items: center;
    font-size: 15px;
    user-select: none;
    pointer-events: none;
    /* Remove box-shadow and extra spacing for unity */
    margin-left: -2px; /* Overlap border for seamlessness */
    /* Make sure suffix is flush with input */
}

.fcf-instance-domain-group input[name="instance"]:focus + .fcf-instance-domain-suffix {
    border-color: #6c47ff;
    background: #fff;
    color: #4b2996;
}

.fcf-instance-domain-group input[name="instance"].valid {
    border-color: #38b2ac;
    background-color: #f0fdf9;
}
.fcf-instance-domain-group input[name="instance"].invalid {
    border-color: #e53e3e;
    background-color: #fff5f5;
}
.fcf-instance-domain-group input[name="instance"].valid + .fcf-instance-domain-suffix {
    border-color: #38b2ac;
}
.fcf-instance-domain-group input[name="instance"].invalid + .fcf-instance-domain-suffix {
    border-color: #e53e3e;
}

/* Remove border between input and suffix for seamless look */
.fcf-instance-domain-group input[name="instance"] {
    /* ...existing code... */
    border-right: none;
}
.fcf-instance-domain-suffix {
    /* ...existing code... */
    border-left: none;
    margin-left: -2px;
}

/* Responsive: stack or shrink suffix on mobile */
@media (max-width: 640px) {
    .fcf-instance-domain-suffix {
        font-size: 13px;
        padding: 0 7px;
        height: 32px;
    }
    .fcf-instance-domain-group input[name="instance"] {
        height: 32px;
    }
}

/* Sidebar/Stepper styles (if present in HTML) */
.fcf-sidebar {
    background: #6c47ff;
    color: #fff;
    border-radius: 16px 0 0 16px;
    padding: 32px 24px;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.fcf-sidebar .fcf-step-title {
    color: #fff;
    font-weight: 600;
    margin-bottom: 8px;
}

.entry-content h3 {
    font-size: 15px !important;
}
.fcf-sidebar .fcf-step-desc {
    color: #d1bfff;
    font-size: 14px;
    margin-bottom: 24px;
}

.fcf-sidebar .fcf-step-active {
    background: #fff;
    color: #6c47ff;
    border-radius: 8px;
    padding: 6px 12px;
    font-weight: 700;
}

/* Add focus-within style for the input group */
.fcf-instance-domain-group:focus-within input[name="instance"],
.fcf-instance-domain-group:focus-within .fcf-instance-domain-suffix {
    border-color: #6c47ff;
    background: #fff;
    color: #4b2996;
}

/* Remove redundant input:focus + .suffix rule (now handled by group) */
