﻿/* ============================================================
   ASP.NET VALIDATION ERRORS
   ============================================================ */

div.asp-error:not(.validation-summary-valid) {
    display: block;
    width: calc(100% - 200px);
    margin: 25px auto;
    padding: 14px 18px;
    background: #ffebee;
    border: 1px solid #f44336;
    border-radius: 10px;
    color: #c62828;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    box-sizing: border-box;
    animation: messageFadeIn 0.3s ease-in-out;
}

.asp-success {
    width: calc(100% - 400px);
    margin: 25px auto;
    padding: 14px 18px;
    background: #e8f5e9;
    border: 1px solid #4caf50;
    border-radius: 10px;
    color: #2e7d32;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    box-sizing: border-box;
    animation: messageFadeIn 0.3s ease-in-out;
}


    /* ============================================================
   FIELD VALIDATION ERROR TEXT
   ============================================================ */

    .asp-error.field-validation-error {
        display: block;
        width: 100%;
        margin: 5px 0 0;
        padding: 0;
        background: transparent;
        border: 0;
        border-radius: 0;
        color: #ff4d00 !important;
        font-size: 13px;
        line-height: 18px;
        text-align: left;
        animation: none;
    }

.asp-error.field-validation-valid,
.validation-summary-valid {
    display: none;
}


        /* Warning icon */

        .asp-error.field-validation-error::before {
            content: "⚠";
            display: inline-block;
            margin-right: 5px;
            color: #ff8c00 !important;
        }


/* ============================================================
   INVALID INPUT / TEXTAREA
   ============================================================ */

/*
    IMPORTANT:
    The border is intentionally set on the inactive state too.
*/

input.input-validation-error,
textarea.input-validation-error {
    border-style: solid !important;
    border-width: 1px !important;
    border-color: #ff4d00 !important;
    background-color: #fff4eb !important;
    outline: none !important;
    box-shadow: none !important;
}


    /* ============================================================
   INVALID INPUT / TEXTAREA - HOVER
   ============================================================ */

    input.input-validation-error:hover,
    textarea.input-validation-error:hover {
        border-style: solid !important;
        border-width: 1px !important;
        border-color: #ff4d00 !important;
        background-color: #fff4eb !important;
        outline: none !important;
        box-shadow: none !important;
    }


    /* ============================================================
   INVALID INPUT / TEXTAREA - FOCUS
   ============================================================ */

    input.input-validation-error:focus,
    textarea.input-validation-error:focus {
        border-style: solid !important;
        border-width: 1px !important;
        border-color: #ff4d00 !important;
        background-color: #fff4eb !important;
        outline: none !important;
        box-shadow: 0 0 0 2px rgba(255, 77, 0, 0.12) !important;
    }


/* ============================================================
   VALIDATION MESSAGE
   ============================================================ */

.asp-error.field-validation-error {
    position: relative;
    margin-top: 0;
    margin-bottom: 5px;
}

@keyframes messageFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 768px) {
    div.asp-error:not(.validation-summary-valid),
    .asp-success {
        font-size: 17px;
        padding: 16px 22px;
    }

    .asp-error.field-validation-error {
        padding: 0;
        font-size: 13px;
    }
}

@media (max-width: 767px) {
    div.asp-error:not(.validation-summary-valid),
    .asp-success {
        width: calc(100% - 20px);
        padding: 12px 14px;
        font-size: 15px;
    }

    .asp-error.field-validation-error {
        width: 100%;
        padding: 0;
        font-size: 13px;
    }
}


/* ============================================================
   VALIDATION FIELD WRAPPER
   ============================================================ */

.asp-validation-field {
    display: flex;
    flex-direction: column;
}


    /* Error text above field */

    .asp-validation-field > .asp-error {
        order: 0;
    }

    .asp-validation-field > input,
    .asp-validation-field > textarea,
    .asp-validation-field > select {
        order: 1;
    }


/* ============================================================
   VALIDATION SUMMARY
   ============================================================ */

.validation-summary-errors {
    width: 100%;
    margin: 5px 0 0 0;
    padding: 0;
    color: #ff4d00 !important;
    font-size: 13px;
    font-weight: 500;
    line-height: 18px;
    text-align: left;
}


    /* Remove default list styling */

    .validation-summary-errors ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }


    /* Summary error */

    .validation-summary-errors li {
        display: block;
        margin: 0;
        padding: 0;
        color: #ff4d00 !important;
    }


        /* Summary warning icon */

        .validation-summary-errors li::before {
            content: "⚠";
            display: inline-block;
            margin-right: 5px;
            color: #ff8c00 !important;
        }
