/* ==========================================================================
   Flash Messages
   Modern session flash component rendered by
   app/views/elements/layouts/flash_messages.ctp.
   Palette aligned with .notification.* (onboarding.css) and dashboard tokens.
   ========================================================================== */

#messages:empty {
    display: none;
}

#messages {
    margin: 0 0 16px 0;
}

/* Login page has no navbar above the flash — give it breathing room. */
body#login #messages {
    margin: 24px 24px 16px 24px;
}

#messages .flash-message + .flash-message {
    margin-top: 8px;
}

.flash-message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid transparent;
    border-left-width: 4px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    animation: flashSlideIn 0.25s ease-out;
}

.flash-message--hiding {
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.flash-message__icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    margin-top: 1px;
    display: block;
}

.flash-message__body {
    flex: 1 1 auto;
    color: inherit;
    word-break: break-word;
}

.flash-message__body a {
    color: inherit;
    text-decoration: underline;
}

.flash-message__dismiss {
    flex: 0 0 auto;
    background: transparent;
    border: 0;
    padding: 4px;
    margin: -4px -4px -4px 0;
    cursor: pointer;
    opacity: 0.55;
    border-radius: 4px;
    line-height: 0;
}

.flash-message__dismiss:hover,
.flash-message__dismiss:focus-visible {
    opacity: 1;
    background: rgba(0, 0, 0, 0.06);
    outline: none;
}

.flash-message__dismiss img {
    width: 16px;
    height: 16px;
    display: block;
}

/* Type tokens */
.flash-message--success {
    background: #e8f7ee;
    border-color: #c3e6cb;
    border-left-color: #2ecc71;
    color: #1d5b2b;
}

.flash-message--error {
    background: #fdecee;
    border-color: #f5c6cb;
    border-left-color: #e74c3c;
    color: #721c24;
}

.flash-message--warning {
    background: #fff8e1;
    border-color: #ffeeba;
    border-left-color: #f39c12;
    color: #6b4a00;
}

.flash-message--info {
    background: #e7f3fb;
    border-color: #bee5eb;
    border-left-color: #3498db;
    color: #1a3f5c;
}

.flash-message--notice {
    background: #eef2fb;
    border-color: #d6dff5;
    border-left-color: #5b6bcf;
    color: #2a3372;
}

@keyframes flashSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Flash Page Layout
   Used by app/views/layouts/flash.ctp (Controller::flash() interstitials).
   ========================================================================== */

#content.flash-page-host {
    margin-left: 0;
}

.flash-page {
    max-width: 560px;
    margin: 0 auto;
    padding: 64px 24px 48px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.flash-page__icon {
    width: 48px;
    height: 48px;
    opacity: 0.6;
    /* Tint the SVG to the primary blue used in modern-nav / dashboard. */
    filter: invert(36%) sepia(93%) saturate(1892%) hue-rotate(199deg) brightness(96%) contrast(101%);
}

.flash-page__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    color: #2c3e50;
}

.flash-page__actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.flash-page__actions .btn-primary-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 280px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #1f77ca 0%, #1565c0 100%);
    color: #fff;
    border: 0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.flash-page__actions .btn-primary-modern:hover,
.flash-page__actions .btn-primary-modern:focus-visible {
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
    box-shadow: 0 3px 8px rgba(21, 101, 192, 0.25);
    transform: translateY(-1px);
    outline: none;
}
