.ipaf-form {
    background: #fff;
    max-width: 800px;
    margin: 30px auto;
    padding: 20px;
    border-radius: 8px;
}

.ipaf-field {
    margin-bottom: 16px;
}

.ipaf-label {
    font-size: 14px;
    color: #6b8ba4;
    margin-bottom: 6px;
    display: block;
}

.ipaf-input {
    width: 100%;
    padding: 14px;
    border: 1px solid #b7c7d6;
    border-radius: 6px;
}

.ipaf-submit {
    width: 100%;
    padding: 14px;
    background: #3fa9f5;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
}

/* Selector */

.ipaf-selector {
    position: relative;
}

.ipaf-selector-box {
    border: 1px solid #b7c7d6;
    border-radius: 6px;
    padding: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.ipaf-selector.open .ipaf-selector-box {
    border-color: #3fa9f5;
}

.ipaf-arrow {
    transition: transform 0.2s ease;
}

.ipaf-selector.open .ipaf-arrow {
    transform: rotate(90deg);
}

.ipaf-selector-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #d6e0ea;
    border-radius: 6px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
    max-height: 260px;
    overflow-y: auto;
    display: none;
    z-index: 20;
}

.ipaf-selector.open .ipaf-selector-panel {
    display: block;
}

.ipaf-item {
    padding: 14px 16px;
    cursor: pointer;
}

.ipaf-item:hover {
    background: #f7fafc;
}

.ipaf-back {
    font-weight: 600;
    color: #3fa9f5;
}

.ipaf-error {
    color: #d93025;
    font-size: 13px;
}

.ipaf-step {
    display: none;
}

.ipaf-step.active {
    display: block;
}

.ipaf-loader {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.ipaf-loader.hidden {
    display: none;
}

.ipaf-loader-box {
    background: #fff;
    padding: 30px 40px;
    border-radius: 8px;
    text-align: center;
    width: 320px;
}

.ipaf-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #ddd;
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.ipaf-loader-btn {
    margin-top: 15px;
    padding: 8px 18px;
    cursor: pointer;
}

/* Step 2 container grid */
#ipafForm .ipaf-step[data-step="2"] .ipaf-field-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* 2 equal columns */
    gap: 20px;
    /* spacing between fields */
}

/* Make buttons span full width */
#ipafForm .ipaf-step[data-step="2"] button.ipaf-prev,
#ipafForm .ipaf-step[data-step="2"] button.ipaf-submit {
    grid-column: 1 / -1;
    /* span both columns */
}

/* Ensure individual fields take full width of their grid cell */
#ipafForm .ipaf-step[data-step="2"] .ipaf-field {
    width: 100%;
}

/* Responsive: collapse to 1 column on small screens */
@media (max-width: 768px) {
    #ipafForm .ipaf-step[data-step="2"] .ipaf-field-container {
        grid-template-columns: 1fr;
    }
}
