/* --- UFH SRC Plugin Form Styles v4.7 --- */

/* 1. Main Container & Feedback Messages */
#ufh-form-container {
    max-width: 960px;
    margin: 40px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    box-sizing: border-box;
    overflow: hidden; 
}
#ufh-form-container *, 
#ufh-form-container *::before, 
#ufh-form-container *::after {
    box-sizing: border-box;
}
.ufh-feedback {
    padding: 15px;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 20px;
}
.ufh-success { background-color: #e0f8e0; border: 1px solid #008000; color: #008000; }
.ufh-error { background-color: #f8e0e0; border: 1px solid #c00; color: #c00; }
.ufh-validation-error {
    color: #c00;
    font-size: 0.9em;
    font-weight: bold;
    margin-top: 5px;
    display: block; /* Make it block level */
}

/* 2. Step Progress Bar */
.ufh-step-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    position: relative;
    padding: 0 10px;
}
.ufh-step-progress::before { 
    content: '';
    position: absolute;
    top: 18px;
    left: 10px;
    right: 10px;
    height: 4px;
    background-color: #ddd;
    z-index: -1;
}
.ufh-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #aaa;
    font-weight: bold;
    text-align: center;
}
.ufh-step-item span {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #ddd;
    color: #fff;
    font-size: 1.2em;
    line-height: 36px;
    border: 4px solid #ddd;
    transition: all 0.3s ease;
}
.ufh-step-item p {
    font-size: 0.9em;
    margin: 5px 0 0;
}
.ufh-step-item.active { color: #0073aa; }
.ufh-step-item.active span { background-color: #0073aa; border-color: #0073aa; }
.ufh-step-item.completed span { background-color: #00a0d2; border-color: #00a0d2; }
.ufh-step-item.completed { color: #00a0d2; }

/* 3. Step Container */
.ufh-step { display: none; }
.ufh-step[data-step="1"] { display: block; }

/* 4. General Form & Field Styles (Mobile-First) */
#ufh-form-container fieldset {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5em;
    margin: 0 0 25px 0;
    background: #f9f9f9;
}
#ufh-form-container fieldset legend {
    font-size: 1.4em;
    font-weight: bold;
    color: #333;
    padding: 0 10px;
    margin-left: 10px;
    width: auto;
}
#ufh-form-container label {
    display: block;
    margin-top: 18px;
    font-weight: 600;
    color: #333;
}
#ufh-form-container input[type="text"],
#ufh-form-container input[type="email"],
#ufh-form-container input[type="tel"],
#ufh-form-container select,
#ufh-form-container textarea,
#ufh-form-container input[type="file"] {
    width: 100%;
    margin-top: 5px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
#ufh-form-container input.input-error,
#ufh-form-container select.input-error {
    border-color: #c00;
    background-color: #fff0f0;
}
.ufh-checkbox-label {
    display: flex;
    align-items: flex-start;
    font-size: 0.9em;
    font-weight: normal;
    margin-top: 0;
}
.ufh-checkbox-label.input-error {
    color: #c00;
    font-weight: bold;
}
.ufh-checkbox-label input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
    margin-top: 5px;
    flex-shrink: 0;
}

/* 5. Grid Layout for side-by-side fields */
.ufh-grid-2 {
    display: grid;
    grid-template-columns: 1fr; /* 1 column on mobile */
    gap: 0 20px;
}

/* 6. Candidate Repeater */
.ufh-candidate-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}
.ufh-candidate-row input[type="text"] {
    flex: 1; 
    margin-top: 0;
}
.ufh-candidate-row button.ufh-remove-btn {
    background: #c00;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 1.2em;
    font-weight: bold;
    line-height: 30px;
    padding: 0;
    cursor: pointer;
}
.ufh-add-candidate-btn {
    background-color: #2271b1;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 10px;
}
.ufh-add-candidate-btn:hover {
    background-color: #1e639c;
}

/* 7. Step Navigation */
.ufh-step-nav {
    display: flex;
    flex-wrap: wrap; 
    justify-content: space-between;
    margin-top: 20px;
    border-top: 1px solid #ddd;
    padding-top: 20px;
}
.ufh-step-nav button,
#ufh-form-container input[type="submit"] {
    width: 100%; 
    font-size: 1.1em;
    padding: 12px 20px;
    background-color: #0073aa;
    color: white;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 10px;
}
.ufh-step-nav button.ufh-prev-btn {
    background-color: #666;
    order: 1;
}
.ufh-step-nav button.ufh-next-btn {
    order: 2;
}
#ufh-form-container input[type="submit"] {
    background-color: #00a0d2;
    order: 2;
}
.ufh-step-nav button.ufh-prev-btn:hover { background-color: #444; }
#ufh-form-container input[type="submit"]:hover { background-color: #0073aa; }

/* 8. Conditional Hiding */
.conditional-group { display: none; }

/* 9. === Responsive Desktop Layout === */
@media (min-width: 768px) {
    .ufh-grid-2 {
        grid-template-columns: 1fr 1fr; /* 2 columns on desktop */
    }
    
    .ufh-step-nav button,
    #ufh-form-container input[type="submit"] {
        width: auto; /* Auto width on desktop */
        margin-bottom: 0;
    }
}

/* --- NEW: Thank You Page Styles (v4.4+) --- */
.ufh-thank-you-container {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 2em 2.5em;
    text-align: center;
}
.ufh-thank-you-container .ufh-logo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.5em;
    border-bottom: 2px solid #eee;
}
.ufh-thank-you-container h1 {
    font-size: 2.5em;
    color: #0073aa;
    margin: 0.5em 0;
}
.ufh-thank-you-container .ufh-lead-text {
    font-size: 1.2em;
    color: #333;
}
.ufh-thank-you-container p {
    font-size: 1.1em;
    line-height: 1.6;
}
.ufh-contact-box {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 1.5em;
    margin: 2em 0;
    text-align: left;
    display: inline-block;
    font-size: 1em;
    line-height: 1.7;
}

/* **** THIS IS THE NEW, CORRECTED STYLE FOR THE BUTTON **** */
.ufh-submit-another-btn {
    display: inline-block;
    font-size: 1em;
    padding: 10px 20px;
    background-color: #666;
    color: white;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    margin-top: 1.5em;
    transition: background-color 0.3s ease;
}
.ufh-submit-another-btn:hover {
    background-color: #444;
    color: white;
}

/* Responsive fix for logo header */
@media (max-width: 600px) {
    .ufh-thank-you-container .ufh-logo-header {
        flex-direction: column;
    }
    .ufh-thank-you-container .ufh-logo-header img {
        margin-bottom: 1em;
    }
    .ufh-thank-you-container h1 {
        font-size: 2em;
    }
}