/* AzerGid Notice System v1.0
 * One presentation layer for Design System alerts, native WooCommerce notices,
 * customer auth/account feedback and partner flash notices.
 * Presentation only: notice sources, roles, messages and lifecycle stay native.
 */

:root {
    --ag-notice-radius: var(--radius-md, 12px);
    --ag-notice-shadow: var(--shadow-xs, 0 4px 12px rgba(20,33,61,.06));
    --ag-notice-surface: var(--color-warm-white, #fffdf8);
    --ag-notice-accent: var(--color-info, #0077b6);
    --ag-notice-border: color-mix(in srgb, var(--ag-notice-accent) 34%, var(--color-stone, #e4ded4));
    --ag-notice-tint: color-mix(in srgb, var(--ag-notice-accent) 7%, var(--ag-notice-surface));
}

/* Canonical AzerGid alert component. */
.ag-alert {
    --ag-notice-accent: var(--color-neutral, #64748b);
    --ag-notice-border: color-mix(in srgb, var(--ag-notice-accent) 28%, var(--color-stone, #e4ded4));
    --ag-notice-tint: color-mix(in srgb, var(--ag-notice-accent) 6%, var(--color-warm-white, #fffdf8));
    grid-template-columns: 28px minmax(0, 1fr) auto !important;
    gap: 12px !important;
    align-items: start;
    padding: 13px 16px !important;
    border: 1px solid var(--ag-notice-border) !important;
    border-radius: var(--ag-notice-radius) !important;
    background: var(--ag-notice-tint) !important;
    color: var(--color-deep-navy, #14213d) !important;
    box-shadow: var(--ag-notice-shadow) !important;
}

.ag-alert--success { --ag-notice-accent: var(--color-success, #2e8b57); }
.ag-alert--warning { --ag-notice-accent: var(--color-warning, #b7791f); }
.ag-alert--error { --ag-notice-accent: var(--color-error, #dc2626); }
.ag-alert--info { --ag-notice-accent: var(--color-info, #0077b6); }
.ag-alert--neutral { --ag-notice-accent: var(--color-neutral, #64748b); }

.ag-alert__marker {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 50%;
    background: color-mix(in srgb, var(--ag-notice-accent) 13%, white);
    color: var(--ag-notice-accent);
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
}
.ag-alert__marker::before { content: "•"; }
.ag-alert--success .ag-alert__marker::before { content: "✓"; }
.ag-alert--warning .ag-alert__marker::before,
.ag-alert--error .ag-alert__marker::before { content: "!"; }
.ag-alert--info .ag-alert__marker::before { content: "i"; }
.ag-alert__title { color: var(--color-deep-navy, #14213d) !important; }
.ag-alert__text { color: var(--color-charcoal, #344054) !important; }

/* Shared compatibility targets. These rules intentionally carry !important
 * to neutralize WooCommerce and older route-local notice presentation while
 * leaving their markup, links, roles and validation logic untouched.
 */
body .woocommerce-error,
body .woocommerce-message,
body .woocommerce-info,
body .ag-auth-notice,
body .azergid-partner-notice,
body .azergid-partner-car-create__notice,
body .azergid-partner-car-create__errors,
body .ag-partner-cabinet-form-notice,
body .azergid-partner-car-edit__moderation-note {
    --ag-notice-accent: var(--color-info, #0077b6);
    --ag-notice-border: color-mix(in srgb, var(--ag-notice-accent) 34%, var(--color-stone, #e4ded4));
    --ag-notice-tint: color-mix(in srgb, var(--ag-notice-accent) 7%, var(--color-warm-white, #fffdf8));
    position: relative !important;
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
    margin: 0 0 16px !important;
    padding: 13px 16px 13px 54px !important;
    border: 1px solid var(--ag-notice-border) !important;
    border-radius: var(--ag-notice-radius) !important;
    border-block-start-width: 1px !important;
    border-inline-start-width: 1px !important;
    background: var(--ag-notice-tint) !important;
    color: var(--color-deep-navy, #14213d) !important;
    box-shadow: var(--ag-notice-shadow) !important;
    font-size: var(--text-small-size, 14px);
    line-height: 1.5;
    list-style: none !important;
    overflow-wrap: anywhere;
}

body .woocommerce-message,
body .azergid-partner-notice--success,
body .azergid-partner-car-create__notice--success {
    --ag-notice-accent: var(--color-success, #2e8b57);
}

body .woocommerce-error,
body .azergid-partner-notice--error,
body .azergid-partner-car-create__notice--error,
body .azergid-partner-car-create__errors {
    --ag-notice-accent: var(--color-error, #dc2626);
}

body .azergid-partner-notice--warning,
body .azergid-partner-car-create__notice--warning,
body .ag-partner-cabinet-form-notice,
body .azergid-partner-car-edit__moderation-note {
    --ag-notice-accent: var(--color-warning, #b7791f);
}

body .woocommerce-info,
body .ag-auth-notice,
body .azergid-partner-notice:not(.azergid-partner-notice--success):not(.azergid-partner-notice--warning):not(.azergid-partner-notice--error),
body .azergid-partner-car-create__notice:not(.azergid-partner-car-create__notice--success):not(.azergid-partner-car-create__notice--warning):not(.azergid-partner-car-create__notice--error) {
    --ag-notice-accent: var(--color-info, #0077b6);
}

body .woocommerce-error::before,
body .woocommerce-message::before,
body .woocommerce-info::before,
body .ag-auth-notice::before,
body .azergid-partner-notice::before,
body .azergid-partner-car-create__notice::before,
body .azergid-partner-car-create__errors::before,
body .ag-partner-cabinet-form-notice::before,
body .azergid-partner-car-edit__moderation-note::before {
    content: "i" !important;
    position: absolute !important;
    inset: 12px auto auto 14px !important;
    display: grid !important;
    width: 26px !important;
    height: 26px !important;
    place-items: center !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: color-mix(in srgb, var(--ag-notice-accent) 13%, white) !important;
    color: var(--ag-notice-accent) !important;
    font-family: Arial, sans-serif !important;
    font-size: 14px !important;
    font-style: normal !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    transform: none !important;
}

body .woocommerce-message::before,
body .azergid-partner-notice--success::before,
body .azergid-partner-car-create__notice--success::before { content: "✓" !important; }

body .woocommerce-error::before,
body .azergid-partner-notice--error::before,
body .azergid-partner-car-create__notice--error::before,
body .azergid-partner-car-create__errors::before,
body .azergid-partner-notice--warning::before,
body .azergid-partner-car-create__notice--warning::before,
body .ag-partner-cabinet-form-notice::before,
body .azergid-partner-car-edit__moderation-note::before { content: "!" !important; }

body .woocommerce-error li,
body .azergid-partner-car-create__errors ul,
body .azergid-partner-car-create__errors li {
    margin: 0;
    padding: 0;
    list-style: none;
}
body .woocommerce-error li + li,
body .azergid-partner-car-create__errors li + li { margin-top: 6px; }

body .woocommerce-error a,
body .woocommerce-message a,
body .woocommerce-info a,
body .ag-auth-notice a,
body .azergid-partner-notice a,
body .azergid-partner-car-create__notice a,
body .azergid-partner-car-create__errors a {
    color: var(--color-caspian-blue, #0077b6);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

/* Woo uses tabindex="-1" and focuses notices after validation/save so assistive
 * technology receives the result. Keep that programmatic focus behavior, but
 * suppress the browser's default black outline on the non-interactive notice
 * container; links/buttons inside retain their own visible keyboard focus. */
body .woocommerce-error:focus,
body .woocommerce-message:focus,
body .woocommerce-info:focus {
    outline: 0 !important;
}

/* Account edit screen previously carried an inline Woo notice treatment.
 * This selector deliberately outranks that legacy selector so the shared
 * system remains authoritative until the template-local block is retired.
 */
body.ag-account-page .woocommerce .woocommerce-MyAccount-content > .woocommerce-message,
body.ag-account-page .woocommerce .woocommerce-MyAccount-content > .woocommerce-error,
body.ag-account-page .woocommerce .woocommerce-MyAccount-content > .woocommerce-info {
    border: 1px solid var(--ag-notice-border) !important;
    border-radius: var(--ag-notice-radius) !important;
    background: var(--ag-notice-tint) !important;
    color: var(--color-deep-navy, #14213d) !important;
    box-shadow: var(--ag-notice-shadow) !important;
    padding: 13px 16px 13px 54px !important;
}

@media (max-width: 640px) {
    .ag-alert,
    body .woocommerce-error,
    body .woocommerce-message,
    body .woocommerce-info,
    body .ag-auth-notice,
    body .azergid-partner-notice,
    body .azergid-partner-car-create__notice,
    body .azergid-partner-car-create__errors,
    body .ag-partner-cabinet-form-notice,
    body .azergid-partner-car-edit__moderation-note {
        border-radius: 11px !important;
        font-size: 13px;
    }

    body .woocommerce-error,
    body .woocommerce-message,
    body .woocommerce-info,
    body .ag-auth-notice,
    body .azergid-partner-notice,
    body .azergid-partner-car-create__notice,
    body .azergid-partner-car-create__errors,
    body .ag-partner-cabinet-form-notice,
    body .azergid-partner-car-edit__moderation-note {
        padding: 12px 13px 12px 50px !important;
    }

    body .woocommerce-error::before,
    body .woocommerce-message::before,
    body .woocommerce-info::before,
    body .ag-auth-notice::before,
    body .azergid-partner-notice::before,
    body .azergid-partner-car-create__notice::before,
    body .azergid-partner-car-create__errors::before,
    body .ag-partner-cabinet-form-notice::before,
    body .azergid-partner-car-edit__moderation-note::before {
        inset: 11px auto auto 12px !important;
        width: 24px !important;
        height: 24px !important;
        font-size: 13px !important;
    }
}
