/**
 * Portal notices: Success = Orders | Validation/Error/Warning = Compound (Bootstrap danger).
 * Batch iframes load this sheet directly (no Bootstrap/main).
 */

/* --- Design tokens --- */
.prescribe-batch-fragment,
.prescribe-batch-embed-document,
.screen-batch-fragment,
.screen-batch-embed-document,
.custom-template-wrapper,
.bg-general {
    --portal-notice-success-bg: #edf6e5;
    --portal-notice-success-border: #c3e6cb;
    --portal-notice-success-text: #155724;
    --portal-validation-bg: #f8d7da;
    --portal-validation-border: #f5c6cb;
    --portal-validation-text: #721c24;
    --portal-info-bg: #ffffff;
    --portal-info-border: #e1e1e1;
    --portal-info-text: #212529;
    --portal-info-shadow: 0px 4px 20px 0px rgb(210 210 210 / 5%);
    --portal-notice-radius: 6px;
    --portal-success-padding: 0.75rem 1.25rem;
    --portal-validation-padding: 12px 16px;
}

/* --- Shared alert shell (success = Orders sizing; validation = Compound sizing applied below) --- */
.custom-template-wrapper .alert.alert-success,
.bg-general .alert.alert-success,
.prescribe-batch-fragment .alert.alert-success,
.prescribe-batch-embed-document .alert.alert-success,
.screen-batch-fragment .alert.alert-success,
.patient-success-msg .alert,
#success-msg .alert.alert-success,
#ajax-msg.alert-success,
#account-orders-notices .alert-success,
.woocommerce-MyAccount-content .woocommerce-notices-wrapper .alert-success {
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 400;
    padding: var(--portal-success-padding, 0.75rem 1.25rem);
    border-radius: var(--portal-notice-radius, 6px);
    border-width: 1px;
    border-style: solid;
    margin-bottom: 1rem;
}

.custom-template-wrapper .alert.alert-danger,
.custom-template-wrapper .alert.alert-warning,
.bg-general .alert.alert-danger,
.bg-general .alert.alert-warning,
.prescribe-batch-fragment .alert.alert-danger,
.prescribe-batch-fragment .alert.alert-warning,
.prescribe-batch-embed-document .alert.alert-danger,
.screen-batch-fragment .alert.alert-danger,
.screen-batch-fragment .alert.alert-warning,
.patient-error-msg .alert.alert-danger,
.patient-error-msg .alert.alert-warning,
#error-msg .alert.alert-danger,
#ajax-msg.alert-danger,
#ajax-msg.alert-warning,
#account-orders-notices .alert-danger,
#account-orders-notices .alert-warning,
.woocommerce-MyAccount-content .woocommerce-notices-wrapper .alert-danger,
.woocommerce-MyAccount-content .woocommerce-notices-wrapper .alert-warning,
.portal-reject-msg.portal-notice-inline,
.compound-validation-msg.is-visible {
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 400;
    padding: var(--portal-validation-padding, 12px 16px);
    border-radius: var(--portal-notice-radius, 6px);
    border-width: 1px;
    border-style: solid;
    margin-bottom: 1rem;
}

.custom-template-wrapper .alert.alert-info,
.bg-general .alert.alert-info,
.prescribe-batch-fragment .alert.alert-info,
#ajax-msg.alert-info,
#account-orders-notices .alert-info,
.woocommerce-MyAccount-content .woocommerce-notices-wrapper .alert-info {
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 400;
    padding: var(--portal-success-padding, 0.75rem 1.25rem);
    border-radius: var(--portal-notice-radius, 6px);
    border-width: 1px;
    border-style: solid;
    margin-bottom: 1rem;
}

#ajax-msg.alert {
    font-family: inherit;
    margin-bottom: 1rem;
    border-width: 1px;
    border-style: solid;
    border-radius: var(--portal-notice-radius, 6px);
}

/* --- Success box: match Orders (no shadow; override main.css .bg-general) --- */
.custom-template-wrapper .alert.alert-success,
.bg-general .alert.alert-success,
.prescribe-batch-fragment .alert.alert-success,
.prescribe-batch-embed-document .alert.alert-success,
.screen-batch-fragment .alert.alert-success,
.patient-success-msg .alert.alert-success,
#success-msg .alert.alert-success,
#ajax-msg.alert-success,
.woocommerce-MyAccount-content .woocommerce-notices-wrapper .alert-success,
#account-orders-notices .alert-success {
    background-color: var(--portal-notice-success-bg, #edf6e5) !important;
    border-color: var(--portal-notice-success-border, #c3e6cb) !important;
    color: var(--portal-notice-success-text, #155724) !important;
    box-shadow: none !important;
}

/* --- Compound validation / error / warning (portal standard; matches compound.php .compound-validation-msg) --- */
.custom-template-wrapper .alert-danger,
.custom-template-wrapper .alert-warning,
.bg-general .alert-danger,
.bg-general .alert-warning,
.prescribe-batch-fragment .alert-danger,
.prescribe-batch-fragment .alert-warning,
.prescribe-batch-embed-document .alert-danger,
.screen-batch-fragment .alert-danger,
.screen-batch-fragment .alert-warning,
.patient-error-msg .alert-danger,
.patient-error-msg .alert-warning,
#error-msg .alert-danger,
#ajax-msg.alert-danger,
#ajax-msg.alert-warning,
#account-orders-notices .alert-danger,
#account-orders-notices .alert-warning,
.woocommerce-MyAccount-content .woocommerce-notices-wrapper .alert-danger,
.woocommerce-MyAccount-content .woocommerce-notices-wrapper .alert-warning,
.portal-reject-msg.portal-notice-inline,
.consultant-prescribe-batch-error,
.compound-validation-msg.is-visible {
    color: var(--portal-validation-text, #721c24) !important;
    background-color: var(--portal-validation-bg, #f8d7da) !important;
    border-color: var(--portal-validation-border, #f5c6cb) !important;
    box-shadow: none !important;
}

.custom-template-wrapper .alert-danger strong,
.custom-template-wrapper .alert-warning strong,
.bg-general .alert-danger strong,
.bg-general .alert-warning strong,
.prescribe-batch-fragment .alert-danger strong,
.prescribe-batch-fragment .alert-warning strong,
.prescribe-batch-embed-document .alert-danger strong,
.screen-batch-fragment .alert-danger strong,
.screen-batch-fragment .alert-warning strong,
.patient-error-msg .alert-danger strong,
.patient-error-msg .alert-warning strong,
#error-msg .alert-danger strong,
#ajax-msg.alert-danger strong,
#ajax-msg.alert-warning strong,
#account-orders-notices .alert-danger strong,
#account-orders-notices .alert-warning strong,
.woocommerce-MyAccount-content .woocommerce-notices-wrapper .alert-danger strong,
.woocommerce-MyAccount-content .woocommerce-notices-wrapper .alert-warning strong {
    font-weight: 400;
    color: var(--portal-validation-text, #721c24) !important;
}

/* --- Info notices: Orders white card (unchanged) --- */
.custom-template-wrapper .alert-info,
.bg-general .alert-info,
.prescribe-batch-fragment .alert-info,
#ajax-msg.alert-info,
#account-orders-notices .alert-info,
.woocommerce-MyAccount-content .woocommerce-notices-wrapper .alert-info {
    color: var(--portal-info-text, #212529) !important;
    background-color: var(--portal-info-bg, #ffffff) !important;
    border-color: var(--portal-info-border, #e1e1e1) !important;
    box-shadow: var(--portal-info-shadow) !important;
}

.custom-template-wrapper .alert-info strong,
.bg-general .alert-info strong,
#account-orders-notices .alert-info strong,
#ajax-msg.alert-info strong {
    font-weight: 400;
    color: #212529 !important;
}

/* Compound validation layout (block; no icon) */
.account-orders-alert:not(.alert-success) {
    display: block;
}

#account-orders-notices .alert.alert-info.account-orders-alert {
    display: flex;
    align-items: center;
    gap: 10px;
}

.patient-error-msg .alert.alert-danger,
.patient-error-msg .alert.alert-warning,
.prescribe-batch-fragment .alert.alert-danger,
.prescribe-batch-embed-document .alert.alert-danger,
.screen-batch-fragment .alert.alert-danger,
.custom-template-wrapper .alert.alert-danger:not(.alert-success),
.bg-general .alert.alert-danger:not(.alert-success),
#error-msg .alert.alert-danger,
#ajax-msg.alert-danger,
#ajax-msg.alert-warning,
.portal-reject-msg.portal-notice-inline {
    display: block;
}

/* --- Success: inline check only (Orders “Subscription resumed” source of truth) --- */
.account-orders-alert .alert-icon,
.woocommerce-MyAccount-content .woocommerce-notices-wrapper .alert-success .alert-icon,
#account-orders-notices .alert-success .alert-icon {
    display: inline;
    width: auto;
    height: auto;
    min-width: 0;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    border-radius: 0;
    box-sizing: content-box;
}

.account-orders-alert .alert-icon svg {
    display: inline;
}

.custom-template-wrapper .alert-success .fa-solid.fa-check,
.custom-template-wrapper .alert-success .fa-check,
.custom-template-wrapper .alert-success i.fa-check,
.bg-general .alert-success .fa-solid.fa-check,
.bg-general .alert-success .fa-check,
.bg-general .alert-success i.fa-check,
.prescribe-batch-fragment .alert-success .fa-solid.fa-check,
.prescribe-batch-fragment .alert-success .fa-check,
.prescribe-batch-fragment .alert-success i.fa-check,
.prescribe-batch-embed-document .alert-success .fa-solid.fa-check,
.screen-batch-fragment .alert-success .fa-solid.fa-check,
.screen-batch-embed-document .alert-success .fa-solid.fa-check,
.patient-success-msg .alert-success .fa-solid.fa-check,
.patient-success-msg .alert-success .fa-check,
#success-msg .alert-success .fa-solid.fa-check,
#success-msg .alert-success .fa-check,
#ajax-msg.alert-success .fa-solid.fa-check,
#ajax-msg.alert-success .fa-check,
#ajax-msg.alert-success i.fa-check,
.woocommerce-MyAccount-content .woocommerce-notices-wrapper .alert-success .alert-icon i,
#account-orders-notices .alert-success .alert-icon i,
.woocommerce-MyAccount-content .woocommerce-notices-wrapper .alert-success .alert-icon .fa-check,
#account-orders-notices .alert-success .alert-icon .fa-check,
.alert-success .alert-icon .fa-solid.fa-check,
.alert-success .alert-icon .fa-check {
    color: #155724 !important;
    font-weight: 900;
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    display: inline !important;
    box-sizing: content-box;
    font-size: inherit;
    line-height: inherit;
}

.custom-template-wrapper .alert-success .fa-solid.fa-check,
.custom-template-wrapper .alert-success .fa-check,
.custom-template-wrapper .alert-success i.fa-check,
.bg-general .alert-success .fa-solid.fa-check,
.bg-general .alert-success .fa-check,
.bg-general .alert-success i.fa-check,
.prescribe-batch-fragment .alert-success .fa-solid.fa-check,
.prescribe-batch-fragment .alert-success .fa-check,
.prescribe-batch-fragment .alert-success i.fa-check,
.prescribe-batch-embed-document .alert-success .fa-solid.fa-check,
.screen-batch-fragment .alert-success .fa-solid.fa-check,
.screen-batch-embed-document .alert-success .fa-solid.fa-check,
.patient-success-msg .alert-success .fa-solid.fa-check,
.patient-success-msg .alert-success .fa-check,
#success-msg .alert-success .fa-solid.fa-check,
#success-msg .alert-success .fa-check,
#ajax-msg.alert-success .fa-solid.fa-check,
#ajax-msg.alert-success .fa-check,
#ajax-msg.alert-success i.fa-check,
.alert.alert-success .fa-solid.fa-check,
.alert-success .fa-solid.fa-check {
    margin-right: 10px;
}

.woocommerce-MyAccount-content .woocommerce-notices-wrapper .alert-success .alert-icon i,
#account-orders-notices .alert-success .alert-icon i,
.woocommerce-MyAccount-content .woocommerce-notices-wrapper .alert-success .alert-icon .fa-solid.fa-check,
#account-orders-notices .alert-success .alert-icon .fa-solid.fa-check {
    margin-right: 0 !important;
}

.woocommerce-MyAccount-content .woocommerce-notices-wrapper .alert-success .alert-icon .fa-check:before,
#account-orders-notices .alert-success .alert-icon .fa-check:before,
.woocommerce-MyAccount-content .woocommerce-notices-wrapper .alert-success .alert-icon .fa-solid.fa-check:before,
#account-orders-notices .alert-success .alert-icon .fa-solid.fa-check:before,
.custom-template-wrapper .alert-success .fa-solid.fa-check::before,
.custom-template-wrapper .alert-success .fa-check::before,
.bg-general .alert-success .fa-solid.fa-check::before,
.bg-general .alert-success .fa-check::before,
.alert-success .fa-solid.fa-check::before,
.alert-success .alert-icon .fa-check::before {
    color: #155724 !important;
    font-family: "Font Awesome 5 Free", "Font Awesome 6 Free";
    font-weight: 900;
}

.woocommerce-MyAccount-content .woocommerce-notices-wrapper .alert-success strong,
#account-orders-notices .alert-success strong,
.custom-template-wrapper .alert-success > strong,
.bg-general .alert-success > strong {
    font-weight: 400;
    color: #155724 !important;
}

.custom-template-wrapper .alert-success > strong,
.bg-general .alert-success > strong,
.prescribe-batch-fragment .alert-success > strong,
.prescribe-batch-embed-document .alert-success > strong,
.screen-batch-fragment .alert-success > strong,
.patient-success-msg .alert-success > strong,
#success-msg .alert-success > strong,
#ajax-msg.alert-success #ajax-msg-text {
    display: flex;
    align-items: center;
    gap: 10px;
}

/*
 * Compound validation: no icons (matches .compound-validation-msg).
 */
.custom-template-wrapper .alert-danger .fa-solid.fa-xmark,
.bg-general .alert-danger .fa-solid.fa-xmark,
.prescribe-batch-fragment .alert-danger .fa-solid.fa-xmark,
.prescribe-batch-embed-document .alert-danger .fa-solid.fa-xmark,
.screen-batch-fragment .alert-danger .fa-solid.fa-xmark,
.patient-error-msg .alert-danger .fa-solid.fa-xmark,
.patient-error-msg .alert-danger .fa-xmark,
#error-msg .alert-danger .fa-solid.fa-xmark,
#ajax-msg.alert-danger .fa-solid.fa-xmark,
.custom-template-wrapper .alert-danger > strong:not(:has(i))::before,
.bg-general .alert-danger > strong:not(:has(i))::before,
.prescribe-batch-fragment .alert-danger > strong:not(:has(i))::before,
.prescribe-batch-embed-document .alert-danger > strong:not(:has(i))::before,
.screen-batch-fragment .alert-danger > strong:not(:has(i))::before,
.patient-error-msg .alert-danger > strong:not(:has(i))::before,
#ajax-msg.alert-danger #ajax-msg-text:not(:has(i))::before {
    content: none !important;
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Text inset: Compound uses box padding only (not Orders strong.ml-3) */
.patient-error-msg .alert-danger > strong,
.patient-error-msg .alert-warning > strong,
.prescribe-batch-fragment .alert-danger > strong,
.prescribe-batch-embed-document .alert-danger > strong,
.screen-batch-fragment .alert-danger > strong,
.custom-template-wrapper .alert-danger:not(.alert-success) > strong,
.custom-template-wrapper .alert-warning > strong,
.bg-general .alert-danger:not(.alert-success) > strong,
.bg-general .alert-warning > strong,
#error-msg .alert-danger > strong,
#ajax-msg.alert-danger #ajax-msg-text,
#ajax-msg.alert-warning #ajax-msg-text,
#account-orders-notices .alert-danger > strong,
#account-orders-notices .alert-warning > strong,
#account-orders-notices .alert-danger > strong.ml-3,
#account-orders-notices .alert-warning > strong.ml-3 {
    margin-left: 0 !important;
    margin-right: 0 !important;
    font-weight: 400;
    color: var(--portal-validation-text, #721c24) !important;
}

#account-orders-notices .alert-info > strong.ml-3,
#ajax-msg.alert-info #ajax-msg-text {
    margin-left: 1rem !important;
    margin-right: 0 !important;
    font-weight: 400;
    color: #212529 !important;
}

.patient-error-msg,
.patient-success-msg {
    width: 100%;
    max-width: 100%;
}

.custom-template-wrapper .alert-success > strong:not(:has(i))::before,
.bg-general .alert-success > strong:not(:has(i))::before,
#ajax-msg.alert-success #ajax-msg-text:not(:has(i))::before {
    content: "\f00c";
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free";
    font-weight: 900;
    margin-right: 10px;
    color: #155724;
}

/* --- Profile: WooCommerce native notices → Orders-equivalent (CSS only) --- */
.page-template-consultation .woocommerce-MyAccount-content .woocommerce-message {
    background-color: #edf6e5 !important;
    border: 1px solid #c3e6cb !important;
    border-radius: 6px;
    color: #155724 !important;
    padding: 0.75rem 1.25rem;
    box-shadow: none !important;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.5;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.page-template-consultation .consulation-bg .woocommerce-notices-wrapper .woocommerce-message {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.page-template-consultation .woocommerce-MyAccount-content .woocommerce-error {
    color: #721c24 !important;
    background-color: #f8d7da !important;
    border: 1px solid #f5c6cb !important;
    border-radius: 6px;
    box-shadow: none !important;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 400;
    list-style: none;
}

.page-template-consultation .woocommerce-MyAccount-content .woocommerce-error li {
    font-weight: 400;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

.page-template-consultation .woocommerce-MyAccount-content .woocommerce-error::before {
    color: #721c24 !important;
}

.page-template-consultation .woocommerce-MyAccount-content .woocommerce-info {
    color: #212529 !important;
    background-color: #ffffff !important;
    border: 1px solid #e1e1e1 !important;
    border-radius: 6px !important;
    box-shadow: 0px 4px 20px 0px rgb(210 210 210 / 5%) !important;
    padding: 0.75rem 1.25rem 0.75rem 3.75rem !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
    font-weight: 400 !important;
}

.page-template-consultation .woocommerce-MyAccount-content .woocommerce-message::before,
.page-template-consultation .consulation-bg .woocommerce-notices-wrapper .woocommerce-message::before {
    content: "\f00c";
    color: #155724 !important;
    font-family: "Font Awesome 5 Free", "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 1em;
    line-height: 1;
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    position: static !important;
    left: auto !important;
    top: auto !important;
    float: none !important;
    display: block;
    flex: 0 0 auto;
}

.page-template-consultation .woocommerce-MyAccount-content .woocommerce-info::before {
    top: 0.75rem;
    font-family: "Font Awesome 5 Free", "Font Awesome 6 Free";
    font-size: 14px;
    line-height: 1;
    color: #155724 !important;
}

/* --- Records AJAX notice bar --- */
#ajax-msg-container.portal-ajax-msg-container {
    display: none;
}

#ajax-msg-close.portal-ajax-msg-close {
    float: right;
    background: none;
    border: none;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    padding: 0 0 0 0.75rem;
    margin: -0.25rem -0.25rem -0.25rem auto;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
}

#ajax-msg.alert-success .portal-ajax-msg-close {
    display: none;
}

#ajax-msg.alert-success {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

#ajax-msg.alert-success #ajax-msg-text {
    flex: 1 1 auto;
    min-width: 0;
}

#ajax-msg.alert-danger,
#ajax-msg.alert-info,
#ajax-msg.alert-warning {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

#ajax-msg.alert-danger #ajax-msg-text,
#ajax-msg.alert-info #ajax-msg-text,
#ajax-msg.alert-warning #ajax-msg-text {
    flex: 1 1 auto;
    min-width: 0;
}

/* Batch modal host: plain <p> errors → Compound validation */
.consultant-prescribe-batch-error {
    margin: 0 0 1rem;
    padding: var(--portal-validation-padding, 12px 16px);
    border-radius: var(--portal-notice-radius, 6px);
    font-size: 14px;
    line-height: 1.5;
    font-weight: 400;
    font-family: inherit;
    color: var(--portal-validation-text, #721c24) !important;
    background-color: var(--portal-validation-bg, #f8d7da) !important;
    border: 1px solid var(--portal-validation-border, #f5c6cb) !important;
    box-shadow: none !important;
}

.compound-validation-msg {
    display: none;
    margin-bottom: 1rem;
    padding: var(--portal-validation-padding, 12px 16px);
    border: 1px solid var(--portal-validation-border, #f5c6cb);
    border-radius: var(--portal-notice-radius, 6px);
    background: var(--portal-validation-bg, #f8d7da);
    color: var(--portal-validation-text, #721c24);
    font-size: 14px;
    line-height: 1.5;
    font-weight: 400;
    box-shadow: none;
}

.compound-validation-msg.is-visible {
    display: block;
}

/* Suppress Bootstrap default alert-success when Orders tokens apply */
.bg-general .alert.alert-success,
.custom-template-wrapper .alert.alert-success,
.prescribe-batch-fragment .alert.alert-success,
#ajax-msg.alert-success,
#account-orders-notices .alert-success {
    width: 100%;
    max-width: 100%;
}

/* --- Reject modal inline messages (Compound validation) --- */
.portal-reject-msg.portal-notice-inline {
    display: none;
    margin-bottom: 1rem;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 400;
    font-family: inherit;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    box-shadow: none;
}
