/*
 * Airocode alerts
 * Shared by the public website, learner experiences, authentication, and admin portal.
 */
:root {
    --airo-alert-radius: 18px;
    --airo-alert-shadow: 0 16px 38px rgba(11, 27, 74, 0.10);
    --airo-alert-font: "Nunito", "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.alert {
    --airo-alert-accent: #1473e6;
    --airo-alert-accent-deep: #0b4ea2;
    --airo-alert-surface: #f2f8ff;
    --airo-alert-surface-end: #ffffff;
    --airo-alert-border: rgba(20, 115, 230, 0.23);
    --airo-alert-text: #123b69;
    --airo-alert-glow: rgba(42, 183, 255, 0.15);
    --airo-alert-symbol: "i";

    position: relative;
    isolation: isolate;
    min-height: 64px;
    overflow: hidden;
    padding: 1rem 1.15rem 1rem 4.25rem !important;
    border: 1px solid var(--airo-alert-border) !important;
    border-radius: var(--airo-alert-radius) !important;
    background:
        radial-gradient(circle at 100% 0, var(--airo-alert-glow), transparent 42%),
        linear-gradient(135deg, var(--airo-alert-surface), var(--airo-alert-surface-end)) !important;
    box-shadow: var(--airo-alert-shadow) !important;
    color: var(--airo-alert-text) !important;
    font-family: var(--airo-alert-font);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.55;
    text-align: left;
    animation: airoAlertEnter 0.36s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.alert::before {
    content: var(--airo-alert-symbol);
    position: absolute;
    z-index: 2;
    top: 0.82rem;
    left: 0.95rem;
    display: grid;
    width: 2.35rem;
    height: 2.35rem;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 13px;
    background: linear-gradient(145deg, var(--airo-alert-accent), var(--airo-alert-accent-deep));
    box-shadow: 0 8px 20px var(--airo-alert-glow), inset 0 1px 0 rgba(255, 255, 255, 0.32);
    color: #ffffff;
    font-family: var(--airo-alert-font);
    font-size: 1rem;
    font-weight: 900;
    line-height: 1;
}

.alert::after {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, var(--airo-alert-accent), var(--airo-alert-accent-deep));
}

.alert-success {
    --airo-alert-accent: #10b981;
    --airo-alert-accent-deep: #047857;
    --airo-alert-surface: #effcf7;
    --airo-alert-surface-end: #fbfffd;
    --airo-alert-border: rgba(16, 185, 129, 0.25);
    --airo-alert-text: #075f49;
    --airo-alert-glow: rgba(16, 185, 129, 0.17);
    --airo-alert-symbol: "✓";
}

.alert-danger {
    --airo-alert-accent: #f05252;
    --airo-alert-accent-deep: #be123c;
    --airo-alert-surface: #fff3f5;
    --airo-alert-surface-end: #fffdfd;
    --airo-alert-border: rgba(225, 29, 72, 0.22);
    --airo-alert-text: #9f1239;
    --airo-alert-glow: rgba(244, 63, 94, 0.16);
    --airo-alert-symbol: "!";
}

.alert-warning {
    --airo-alert-accent: #fbbf24;
    --airo-alert-accent-deep: #d97706;
    --airo-alert-surface: #fff9e9;
    --airo-alert-surface-end: #fffefa;
    --airo-alert-border: rgba(217, 119, 6, 0.24);
    --airo-alert-text: #854d0e;
    --airo-alert-glow: rgba(251, 191, 36, 0.20);
    --airo-alert-symbol: "!";
}

.alert-info,
.alert-primary {
    --airo-alert-accent: #2ab7ff;
    --airo-alert-accent-deep: #1267d6;
    --airo-alert-surface: #eef9ff;
    --airo-alert-surface-end: #fbfdff;
    --airo-alert-border: rgba(18, 103, 214, 0.22);
    --airo-alert-text: #0b4e80;
    --airo-alert-glow: rgba(42, 183, 255, 0.19);
    --airo-alert-symbol: "i";
}

.alert-secondary,
.alert-light {
    --airo-alert-accent: #64748b;
    --airo-alert-accent-deep: #334155;
    --airo-alert-surface: #f6f8fb;
    --airo-alert-surface-end: #ffffff;
    --airo-alert-border: rgba(71, 85, 105, 0.20);
    --airo-alert-text: #334155;
    --airo-alert-glow: rgba(100, 116, 139, 0.14);
    --airo-alert-symbol: "i";
}

.alert-dark {
    --airo-alert-accent: #2ab7ff;
    --airo-alert-accent-deep: #fbbf24;
    --airo-alert-surface: #0b1b4a;
    --airo-alert-surface-end: #102a6b;
    --airo-alert-border: rgba(142, 231, 255, 0.28);
    --airo-alert-text: #eef8ff;
    --airo-alert-glow: rgba(42, 183, 255, 0.20);
    --airo-alert-symbol: "i";
}

/*
 * Feature pages historically shipped highly specific, sometimes !important,
 * alert colors. Keep one visual source of truth even when those old rules load
 * later inside a page body.
 */
html body .alert,
html body .alert:is(
    .alert-success,
    .alert-danger,
    .alert-warning,
    .alert-info,
    .alert-primary,
    .alert-secondary,
    .alert-light,
    .alert-dark
) {
    padding: 1rem 1.15rem 1rem 4.25rem !important;
    border: 1px solid var(--airo-alert-border) !important;
    border-radius: var(--airo-alert-radius) !important;
    background:
        radial-gradient(circle at 100% 0, var(--airo-alert-glow), transparent 42%),
        linear-gradient(135deg, var(--airo-alert-surface), var(--airo-alert-surface-end)) !important;
    box-shadow: var(--airo-alert-shadow) !important;
    color: var(--airo-alert-text) !important;
}

.alert strong,
.alert b,
.alert .alert-heading {
    color: inherit !important;
    font-weight: 850;
}

.alert p:last-child,
.alert ul:last-child,
.alert ol:last-child {
    margin-bottom: 0;
}

.alert ul,
.alert ol {
    padding-left: 1.2rem;
}

.alert li + li {
    margin-top: 0.3rem;
}

.alert .alert-link,
.alert a:not(.btn) {
    color: inherit !important;
    font-weight: 800;
    text-decoration: underline;
    text-decoration-color: var(--airo-alert-accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.alert .btn:not(.btn-close) {
    min-height: 0;
    padding: 0.48rem 0.78rem !important;
    border-radius: 10px !important;
    font-size: 0.84rem;
    line-height: 1.25;
}

.alert-dismissible {
    padding-right: 3.7rem !important;
}

.alert .btn-close {
    top: 50%;
    right: 0.9rem;
    padding: 0.65rem;
    border-radius: 10px;
    opacity: 0.56;
    transform: translateY(-50%);
    transition: background-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.alert .btn-close:hover,
.alert .btn-close:focus-visible {
    background-color: rgba(15, 23, 42, 0.08);
    opacity: 0.9;
    transform: translateY(-50%) scale(1.04);
}

/* Old templates sometimes include their own status icon. The shared badge is the source of truth. */
.alert > .bi:first-child,
.alert > .fas:first-child,
.alert > .far:first-child,
.alert > .fa:first-child {
    display: none !important;
}

.alert.airo-alert-compact {
    min-height: 52px;
    padding-top: 0.72rem !important;
    padding-bottom: 0.72rem !important;
}

.alert.airo-alert-compact::before {
    top: 0.52rem;
    width: 2.15rem;
    height: 2.15rem;
}

@keyframes airoAlertEnter {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 575.98px) {
    html body .alert,
    html body .alert:is(
        .alert-success,
        .alert-danger,
        .alert-warning,
        .alert-info,
        .alert-primary,
        .alert-secondary,
        .alert-light,
        .alert-dark
    ) {
        min-height: 58px;
        padding: 0.85rem 0.9rem 0.85rem 3.75rem !important;
        border-radius: 15px !important;
        font-size: 0.9rem;
    }

    .alert::before {
        top: 0.68rem;
        left: 0.72rem;
        width: 2.15rem;
        height: 2.15rem;
        border-radius: 11px;
    }

    .alert-dismissible {
        padding-right: 3.2rem !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .alert {
        animation: none;
    }

    .alert .btn-close {
        transition: none;
    }
}

@media print {
    .alert {
        box-shadow: none !important;
        background: #ffffff !important;
    }
}
