/**
 * Needs Assessment Form Styles
 * Designed to inherit and complement theme styling
 */

/* Form Wrapper */
.naf-form-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.naf-form-title {
    margin-bottom: 30px;
    text-align: center;
}

/* Form Base */
.naf-form {
    width: 100%;
}

/* Fieldsets */
.naf-fieldset {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    background: #fafafa;
}

.naf-legend {
    font-size: 1.2em;
    font-weight: 600;
    padding: 0 15px;
    color: inherit;
}

/* Fields */
.naf-field {
    margin-bottom: 20px;
}

.naf-field:last-child {
    margin-bottom: 0;
}

.naf-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.naf-field input[type="text"],
.naf-field input[type="email"],
.naf-field input[type="tel"],
.naf-field input[type="number"],
.naf-field select,
.naf-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.naf-field input:focus,
.naf-field select:focus,
.naf-field textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

/* Field Rows */
.naf-field-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.naf-field-row .naf-field {
    margin-bottom: 0;
}

.naf-field-half {
    flex: 1 1 45%;
    min-width: 200px;
}

.naf-field-third {
    flex: 1 1 30%;
    min-width: 150px;
}

.naf-field-two-thirds {
    flex: 2 1 60%;
    min-width: 250px;
}

.naf-field-quarter {
    flex: 1 1 20%;
    min-width: 120px;
}

.naf-field-small {
    flex: 0 0 80px;
    min-width: 70px;
}

/* Checkbox/Radio Groups */
.naf-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.naf-checkbox-group.naf-inline {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 15px;
}

.naf-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: normal;
}

.naf-checkbox-label input[type="radio"],
.naf-checkbox-label input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.naf-with-input {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.naf-with-input input[type="text"] {
    width: auto;
    min-width: 100px;
}

/* Required Field Indicator */
.required {
    color: #dc3545;
}

/* Conditional Fields */
.naf-conditional-fields {
    display: none;
    margin-top: 15px;
    padding: 15px;
    background: #fff;
    border-left: 3px solid #0073aa;
    border-radius: 0 4px 4px 0;
}

.naf-conditional-fields.naf-visible {
    display: block;
}

/* Submit Section */
.naf-submit-wrapper {
    text-align: center;
    padding-top: 20px;
}

.naf-submit-button {
    padding: 14px 40px;
    font-size: 1.1em;
    font-weight: 600;
    color: #fff;
    background-color: #0073aa;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.naf-submit-button:hover {
    background-color: #005a87;
}

.naf-submit-button:active {
    transform: scale(0.98);
}

.naf-submit-button:disabled {
    background-color: #999;
    cursor: not-allowed;
}

/* Form Messages */
.naf-form-message {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    text-align: center;
}

.naf-form-message.naf-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.naf-form-message.naf-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Loading State */
.naf-form.naf-loading .naf-submit-button {
    position: relative;
    color: transparent;
}

.naf-form.naf-loading .naf-submit-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: naf-spin 0.8s linear infinite;
}

@keyframes naf-spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .naf-form-wrapper {
        padding: 10px;
    }
    
    .naf-fieldset {
        padding: 15px;
    }
    
    .naf-field-row {
        flex-direction: column;
    }
    
    .naf-field-half,
    .naf-field-third,
    .naf-field-two-thirds,
    .naf-field-quarter,
    .naf-field-small {
        flex: 1 1 100%;
        min-width: 100%;
    }
    
    .naf-checkbox-group.naf-inline {
        flex-direction: column;
    }
}

/* Print Styles */
@media print {
    .naf-submit-wrapper {
        display: none;
    }
}
