/**
 * CSP-Compliant Validation Styles
 * Replaces inline styles that jQuery validation would normally add
 */

/* Error message visibility classes */
.validation-error-visible {
    display: block !important;
    color: #a94442;
    font-weight: bold;
    margin-top: 5px;
}

.validation-error-hidden {
    display: none !important;
}

/* Field validation error styling */
.field-validation-error {
    display: block;
    color: #a94442;
    font-weight: bold;
    white-space: normal;
    word-wrap: break-word;
}

/* Input field error state */
.input-validation-error {
    border-color: #a94442;
    background-color: #f2dede;
}

/* Error wrapper for table cells (e.g., payment grids) */
.error-wrapper {
    position: relative;
    display: block;
    margin-top: 5px;
}

.error-wrapper .error-overlay {
    display: block;
    white-space: normal;
    word-wrap: break-word;
    max-width: 100%;
}

.error-wrapper .error-overlay .field-validation-error {
    display: block !important;
    color: #a94442;
    font-weight: bold;
    white-space: normal;
    word-wrap: break-word;
    min-height: 18px;
    visibility: visible !important;
    opacity: 1 !important;
}

.error-wrapper .error-overlay .validation-error-visible {
    display: block !important;
    color: #a94442;
    font-weight: bold;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure error span shows content regardless of state */
.error-wrapper .error-overlay span:not(.validation-error-hidden):not(:empty) {
    display: block !important;
    color: #a94442;
    font-weight: bold;
}

/* Hide the empty placeholder <li> that MVC's ValidationSummary renders.
   MVC hides it via inline style="display:none", but the CSP style-stripping
   removes that attribute, leaving a stray empty bullet. This restores the
   hidden behavior without an inline style. */
.validation-summary-errors ul li:empty {
    display: none;
}

/* Error message wrapper for forms */
.error-message-wrapper {
    display: block;
    min-height: 20px;
    margin-top: 5px;
}

.error-message-wrapper .field-validation-error,
.error-message-wrapper .validation-error-visible {
    display: block !important;
    color: #a94442;
    font-weight: bold;
}
