@keyframes agencia-flash-in {
    from {
        opacity: 0;
        transform: translateX(40px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes agencia-flash-progress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

@keyframes agencia-flash-out {
    to {
        opacity: 0;
        transform: translateX(40px) scale(0.95);
    }
}

/* ── Colour variants ──────────────────────────────────────────── */

/* Success */
.agencia-flash-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #14532d;
}
.agencia-flash-success .agencia-flash-icon {
    color: #16a34a;
}
.agencia-flash-success .agencia-flash-title {
    color: #15803d;
}
.agencia-flash-success .agencia-flash-close {
    color: #14532d;
}
.agencia-flash-success .agencia-flash-progress {
    background: #16a34a;
}

/* Error */
.agencia-flash-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #7f1d1d;
}
.agencia-flash-error .agencia-flash-icon {
    color: #dc2626;
}
.agencia-flash-error .agencia-flash-title {
    color: #991b1b;
}
.agencia-flash-error .agencia-flash-close {
    color: #7f1d1d;
}
.agencia-flash-error .agencia-flash-progress {
    background: #dc2626;
}

/* Warning */
.agencia-flash-warning {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #7c2d12;
}
.agencia-flash-warning .agencia-flash-icon {
    color: #ea580c;
}
.agencia-flash-warning .agencia-flash-title {
    color: #9a3412;
}
.agencia-flash-warning .agencia-flash-close {
    color: #7c2d12;
}
.agencia-flash-warning .agencia-flash-progress {
    background: #ea580c;
}

/* Info */
.agencia-flash-info {
    background: #eff8ff;
    border-color: #bfdbfe;
    color: #1e3a5f;
}
.agencia-flash-info .agencia-flash-icon {
    color: #035772;
}
.agencia-flash-info .agencia-flash-title {
    color: #035772;
}
.agencia-flash-info .agencia-flash-close {
    color: #1e3a5f;
}
.agencia-flash-info .agencia-flash-progress {
    background: #035772;
}

/* Mobile */
@media (max-width: 576px) {
    .flash-message-container {
        top: auto;
        bottom: 24px;
        right: 12px;
        left: 12px;
        max-width: 100%;
        width: auto;
    }
}

/* Login page — flash sits inline, not fixed */
.login-page .agencia-flash-wrap {
    position: relative;
    top: auto;
    right: auto;
    margin-bottom: 1rem;
    animation: agencia-flash-in 0.3s ease both;
}

.login-page .flash-message-container {
    position: relative;
    top: auto;
    right: auto;
    max-width: 100%;
    width: 100%;
}

/* ── Button and progress bar fixes ───────────────────────────── */

.agencia-flash-close {
    flex-shrink: 0;
    background: none !important;
    border: 1px solid transparent !important;
    border-radius: 6px !important;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 4px 6px !important;
    opacity: 0.5;
    transition:
        opacity 0.15s,
        background 0.15s;
    margin-top: 1px;
    line-height: 1;
    box-shadow: none !important;
    outline: none !important;
    min-width: unset !important;
    width: auto !important;
}
.agencia-flash-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.06) !important;
}

.agencia-flash-wrap {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 14px !important;
    padding: 14px 16px 18px !important;
    border-radius: 14px !important;
    border: 1px solid transparent !important;
    box-shadow:
        0 8px 24px rgba(9, 20, 5, 0.1),
        0 2px 6px rgba(9, 20, 5, 0.06) !important;
    position: relative !important;
    overflow: hidden !important;
    pointer-events: all !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.agencia-flash-progress {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    height: 3px !important;
    border-radius: 0 !important;
    animation: agencia-flash-progress 6s linear forwards !important;
}

.login-page .agencia-flash-wrap {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    margin-bottom: 1rem;
    max-width: 100%;
    pointer-events: all;
}

/* ── Login page specific overrides ───────────────────────────── */
.login-form-inner .agencia-flash-wrap {
    min-width: 0 !important;
    width: 100% !important;
}

.login-form-inner .agencia-flash-body {
    min-width: 0 !important;
    flex: 1 !important;
    overflow: visible !important;
}

.login-form-inner .agencia-flash-close,
.login-page .agencia-flash-close {
    appearance: none !important;
    -webkit-appearance: none !important;
    background: none !important;
    border: none !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 4px 6px !important;
    margin: 0 !important;
    cursor: pointer !important;
    font-size: 0.75rem !important;
    line-height: 1 !important;
    width: auto !important;
    min-width: unset !important;
    height: auto !important;
    min-height: unset !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0.5;
    transition: opacity 0.15s;
}

.login-form-inner .agencia-flash-close:hover,
.login-page .agencia-flash-close:hover {
    opacity: 1 !important;
    background: rgba(0, 0, 0, 0.06) !important;
}

.login-form-inner .agencia-flash-wrap,
.login-page .agencia-flash-wrap {
    position: relative !important;
    overflow: hidden !important;
}

.login-form-inner .agencia-flash-progress,
.login-page .agencia-flash-progress {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    height: 3px !important;
    border-radius: 0 !important;
    animation: agencia-flash-progress 6s linear forwards !important;
}

.agencia-flash-body {
    flex: 1 !important;
    min-width: 0 !important;
    overflow: hidden !important;
}

.agencia-flash-title {
    font-family: "Space Grotesk", sans-serif !important;
    font-weight: 700 !important;
    font-size: 0.72rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    margin-bottom: 3px !important;
}

.agencia-flash-message {
    font-family: "Poppins", sans-serif !important;
    font-size: 0.8rem !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    @keyframes agencia-flash-out {
    to { opacity: 0; transform: translateX(40px) scale(0.95); }
}

.flash-dismissing {
    animation: agencia-flash-out 0.35s ease forwards !important;
}

}
/* ── RAP Status Badge Colours ── */
.rap-status-badge-on-time    { background:#E8F6EE; color:#18794E; border-color:#B7E1C1; }
.rap-status-badge-complete   { background:#E8F6EE; color:#18794E; border-color:#B7E1C1; }
.rap-status-badge-closed     { background:#F1F5F9; color:#475569; border-color:#CBD5E1; }
.rap-status-badge-at-risk    { background:#FFF7E6; color:#9A6700; border-color:#F2D6A2; }
.rap-status-badge-in-progress{ background:#FFF7E6; color:#9A6700; border-color:#F2D6A2; }
.rap-status-badge-late       { background:#FEE2E2; color:#991B1B; border-color:#FCA5A5; }
.rap-status-badge-blocked    { background:#FEE2E2; color:#991B1B; border-color:#FCA5A5; }
.rap-status-badge-default    { background:#F8FAF6; color:#80877D; border-color:#D8E2E3; }
