/* ═══════════════════════════════════════════════════════════════════════════
   TI CORP PRIVE · TOAST NOTIFICATIONS  —  Crocs / Bootstrap 5 shape
   ───────────────────────────────────────────────────────────────────────────
   The single source of truth for notification styling across the whole panel.
   Loaded by the auth layout AND by the admin / agent / family-office layouts,
   so a notification looks identical wherever it fires.

   Shape and metrics are taken from the Crocs template's own toast — a 350px
   card with a `.toast-header` strip above a `.toast-body`:

       .toast         350px · 1px solid rgba(106,113,133,.2) · square corners
       .toast-header  navy strip, bottom hairline, icon + title + close
       .toast-body    message text on the same navy surface (`.toast-dark`)

   Written standalone rather than leaning on Bootstrap, because the three
   authed layouts still run Tailwind and have not been ported to Crocs yet.
   When they are, these rules keep matching — they are the same values.

   Markup is produced by showToast() in public/js/layout.js (authed shell) and
   in resources/views/layouts/main.blade.php (auth screens). Both emit:

       <div class="toast toast-{type}">
         <div class="toast-header">
           <span class="toast-icon">…svg…</span>
           <strong class="toast-title">Title</strong>
           <button class="toast-close">…svg…</button>
         </div>
         <div class="toast-body toast-dark">Message</div>
       </div>

   Type accents use the Crocs semantic palette so notifications read as part of
   the template rather than as brand chrome. `error` is our own name for what
   Crocs calls `danger`; both are defined.
   ═══════════════════════════════════════════════════════════════════════════ */

.toast-container {
    position: fixed;
    top: 1.75rem;
    right: 1.75rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast-container .toast {
    pointer-events: auto;
    margin-bottom: 0 !important;
}

/* ─── Card ──────────────────────────────────────────────────────────────── */
.toast {
    display: block;
    width: 350px;
    max-width: calc(100vw - 3.5rem);
    font-family: var(--font-body, system-ui, sans-serif);
    font-size: 0.875rem;
    background-color: var(--luxe-bg, #122238);
    background-clip: padding-box;
    border: 1px solid rgba(106, 113, 133, 0.2);
    border-radius: 0;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.35);

    /* Enter/exit animation. showToast() adds `.show` a tick after append and
       removeToast() strips it, so both directions are covered here. */
    opacity: 0;
    transform: translateX(28px);
    transition: opacity 320ms cubic-bezier(0.22, 1, 0.36, 1),
                transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

/* ─── Header strip ──────────────────────────────────────────────────────── */
.toast .toast-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    background-color: var(--luxe-bg, #122238);
    background-clip: padding-box;
    border-bottom: 1px solid var(--luxe-line-strong, rgba(255, 255, 255, 0.17));
    color: var(--luxe-ink-muted, rgba(255, 255, 255, 0.6));
}

.toast .toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: currentColor;
}

.toast .toast-title {
    flex: 1 1 auto;          /* stands in for Bootstrap's .me-auto */
    min-width: 0;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    line-height: 1.2;
    color: currentColor;
}

.toast .toast-close {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    padding: 0;
    background: transparent;
    border: 0;
    color: var(--luxe-ink-soft, rgba(255, 255, 255, 0.45));
    cursor: pointer;
    transition: color 200ms ease;
}

.toast .toast-close:hover { color: var(--luxe-ink, #F4F2EC); }

.toast .toast-close:focus-visible {
    outline: 2px solid var(--gold, #C68A42);
    outline-offset: 1px;
    color: var(--luxe-ink, #F4F2EC);
}

/* ─── Body ──────────────────────────────────────────────────────────────── */
.toast .toast-body {
    padding: 0.75rem;
    line-height: 1.55;
    word-wrap: break-word;
    /* A directly-matching declaration beats inherited colour, so this holds
       even though the type classes below set `color` on the card itself. */
    color: var(--luxe-ink-2, rgba(255, 255, 255, 0.72));
}

/* Crocs' own modifier for a dark body surface; the markup carries it so the
   card matches the template when Bootstrap's light `.toast` base is present. */
.toast .toast-body.toast-dark {
    background-color: var(--luxe-bg, #122238);
    color: var(--luxe-ink-2, rgba(255, 255, 255, 0.72)) !important;
}

/* ─── Type accents — Crocs semantic palette ─────────────────────────────────
   Doubled selectors on purpose: Crocs ships
   `body.dark-only .toast .toast-header { color: … }` at (0,0,3,1), which
   outranks a plain `.toast.toast-error .toast-header` at (0,0,3,0). The
   `body.dark-only` form wins on the auth screens; the bare form covers the
   three authed layouts, which do not carry that body class. */
body.dark-only .toast.toast-success .toast-header,
.toast.toast-success .toast-header { color: #61AE41; }

body.dark-only .toast.toast-error   .toast-header,
body.dark-only .toast.toast-danger  .toast-header,
.toast.toast-error   .toast-header,
.toast.toast-danger  .toast-header { color: #F81F58; }

body.dark-only .toast.toast-warning .toast-header,
.toast.toast-warning .toast-header { color: #E7AE2F; }

body.dark-only .toast.toast-info    .toast-header,
.toast.toast-info    .toast-header { color: #44A8D7; }

@media (prefers-reduced-motion: reduce) {
    .toast { transition-duration: 1ms; }
}

@media (max-width: 575.98px) {
    .toast-container {
        top: 1rem;
        right: 1rem;
        left: 1rem;
    }
    .toast { width: 100%; }
}
