/* Multi-Step Form Frontend Styles */

.msf-form-container {
    max-width: 600px;
    margin: 30px auto;
    background: white;
    padding: 30px;
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.msf-form-question-block h3>span.msf-question-number {
    display: none;
}

/* Form Steps */
.msf-form-steps {
    min-height: 300px;
}

.msf-form-step {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.msf-form-step h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #333;
    line-height: 1.4;
}

/* Form Fields */
.msf-form-field {
    width: 100%;
    padding: 8px 12px;
    margin: 8px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.msf-form-steps .msf-form-question-block>h3 {
    font-size: 15px;
    font-family: inherit;
    line-height: 18px;
    margin-bottom: 0;
}

.msf-form-step>h3 {
    font-size: 18px !important;
    font-family: inherit !important;
    text-align: center !important;
    margin-bottom: 20px !important;
}

.msf-form-field:focus {
    outline: none;
    border-color: #6c0a00;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    background-color: #f8fbfe;
}

textarea.msf-form-field {
    resize: vertical;
    min-height: 100px;
}

/* Yes/No Options */
.msf-yes-no-options {
    display: flex;
    gap: 20px;
    margin: 0;
}

.msf-form-step .msf-form-question-block>h3 {
    font-size: 15px !important;
    line-height: 16px !important;
    font-family: inherit !important;
}

.msf-yes-no-options label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    padding: 0 10px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.msf-yes-no-options label:hover {
    background-color: #f0f0f0;
}

.msf-yes-no-options input[type="radio"] {
    margin-right: 10px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

/* Dropdown */
.msf-dropdown-field {
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="black" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
    cursor: pointer;
    line-height: 16px;
}

.msf-dropdown-field:hover {
    border-color: #2980b9;
}

/* Multiple Choice Options */
.msf-multiple-choice-options,
.msf-checkbox-options {
    margin: 20px 0;
}

.msf-multiple-choice-options label,
.msf-checkbox-options label {
    display: flex;
    align-items: center;
    margin: 15px 0;
    cursor: pointer;
    padding: 10px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.msf-multiple-choice-options label:hover,
.msf-checkbox-options label:hover {
    background-color: #f0f0f0;
}

.msf-multiple-choice-options input[type="radio"],
.msf-checkbox-options input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

/* Question Number prefix */
.msf-question-number {
    display: inline-block;
    font-weight: 700;
    color: #6c0a00;
    margin-right: 6px;
}

/* Contact Step */
.msf-contact-step h3 {
    margin-bottom: 20px;
}

.msf-name-row,
.msf-email-phone-row {
    display: flex;
    gap: 12px;
    margin-bottom: 0;
}

.msf-name-row .msf-form-field,
.msf-email-phone-row .msf-form-field {
    flex: 1;
    min-width: 0;
}

.msf-contact-step .msf-form-field {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 480px) {

    .msf-name-row,
    .msf-email-phone-row {
        flex-direction: column;
        gap: 0;
    }
}

/* Navigation Buttons */
.msf-form-navigation {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    justify-content: space-between;
}

.msf-btn-prev,
.msf-btn-next,
.msf-btn-submit {
    padding: 12px 24px;
    font-size: 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.msf-btn-prev {
    background-color: #e0e0e0;
    color: #333;
}

.msf-btn-prev:hover {
    background-color: #ccc;
}

.msf-btn-next,
.msf-btn-submit {
    background-color: #6c0a00;
    color: white;
    min-width: 120px;
}

.msf-btn-next:hover,
.msf-btn-submit:hover {
    background-color: #300601;
}

.msf-btn-next:disabled,
.msf-btn-submit:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

/* Progress Bar */
.msf-progress {
    margin-top: 20px;
    height: 6px;
    background-color: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.msf-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #6c0a00, #6c0a00);
    transition: width 0.5s ease;
    border-radius: 3px;
}

/* Conditional logic: question blocks hidden by show/hide rules */
.msf-form-question-block {
    overflow: hidden;
    /* keeps slideDown smooth */
}

.msf-form-question-block.msf-hidden-by-logic {
    display: none;
}

/* Field-level validation error */
.msf-form-field.msf-field-error,
.msf-form-field.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
}

/* Form Notice */
.msf-form-notice {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 15px;
    text-align: center;
    color: #856404;
}

/* Success Message */
.msf-form-success {
    background-color: #6c0a00;
    border: 1px solid #6c0a00;
    border-radius: 4px;
    padding: 10px 20px;
    color: #ffffff;
    margin-bottom: 20px;
    text-align: center;
    margin: 0 auto;
    display: inline;
}

.msf-form-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 15px;
    color: #721c24;
    margin-bottom: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .msf-form-container {
        padding: 20px;
        margin: 20px 10px;
    }

    .msf-form-step h3 {
        font-size: 18px;
    }

    .msf-form-navigation {
        flex-direction: column;
    }

    .msf-btn-prev,
    .msf-btn-next,
    .msf-btn-submit {
        width: 100%;
    }

    .msf-yes-no-options {
        flex-direction: column;
        gap: 10px;
    }

    .msf-yes-no-options label {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Animation for transitions */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

/* ── Accordion Layout ─────────────────────────────────────────────── */

.msf-accordion-item {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 10px;
    overflow: hidden;
}

.msf-accordion-item.msf-hidden-by-logic {
    display: none !important;
}

.msf-accordion-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    background: #f8f8f8;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid transparent;
    transition: background 0.2s ease;
}

.msf-accordion-header:hover {
    background: #f0f0f0;
}

.msf-accordion-open>.msf-accordion-header {
    background: #efefef;
    border-bottom-color: #e0e0e0;
}

.msf-accordion-title {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
    font-family: inherit;
}

.msf-accordion-chevron {
    font-size: 22px;
    color: #888;
    line-height: 1;
    transition: transform 0.25s ease;
    display: inline-block;
    transform: rotate(0deg);
}

.msf-accordion-open>.msf-accordion-header .msf-accordion-chevron {
    transform: rotate(180deg);
}

.msf-accordion-body {
    display: none;
    padding: 18px 18px 20px;
    background: #fff;
    animation: msf-accordion-in 0.2s ease;
}

.msf-accordion-open>.msf-accordion-body {
    display: block;
}

@keyframes msf-accordion-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Contact accordion — distinct header colour */
.msf-contact-accordion>.msf-accordion-header {
    background: #6c0a00;
    border-bottom-color: #5a0800;
}

.msf-contact-accordion.msf-accordion-open>.msf-accordion-header {
    background: #5a0800;
}

.msf-contact-accordion>.msf-accordion-header:hover {
    background: #5a0800;
}

.msf-contact-accordion>.msf-accordion-header .msf-accordion-title,
.msf-contact-accordion>.msf-accordion-header .msf-accordion-chevron {
    color: #fff;
}

/* Question-number badge inside accordion header */
.msf-accordion-header .msf-question-number {
    color: #6c0a00;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

/* Submit button row */
.msf-form-navigation {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
}

/* Per-option detail textarea */
.msf-opt-wrap {
    margin-top: 8px;
}

.msf-opttext-field {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.msf-opttext-field:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.msf-opttext-field.msf-field-error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.2);
}

/* "Other" explanation textarea */
.msf-other-wrap {
    margin-top: 10px;
}

.msf-other-field {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.msf-other-field:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.msf-other-field.msf-field-error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.2);
}