/* ===== Post-login welcome (replaces the old "Login Successful" toast) =====
   Base rules describe the FINAL state, so with reduced motion the user simply
   sees the finished card. All movement lives in the no-preference block. */
.lw-overlay { --lw-accent: #1d4ed8; --lw-a: -8deg; position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(7, 18, 40, .58); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .22s ease, visibility 0s linear .22s; font-family: 'Quicksand', ui-sans-serif, system-ui, sans-serif; }
.lw-overlay.is-open { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .22s ease; }
.lw-overlay.is-leaving { opacity: 0; transition: opacity .15s ease; }
.lw-overlay.is-leaving .lw-card { transform: translateY(-8px) scale(.98); transition: transform .15s ease; }

.lw-card { width: min(92vw, 360px); background: #fff; border-radius: 1.25rem; overflow: hidden; box-shadow: 0 30px 80px -20px rgba(2, 12, 40, .65); padding-bottom: 1.5rem; text-align: center; }
.lw-scene { position: relative; height: 140px; overflow: hidden; background: linear-gradient(135deg, #4a8fe6 0%, #2b70ca 100%); } /* rich mid-blue base: darker blobs blend into blue instead of fading to gray over a pale base */



.lw-avatar { position: relative; z-index: 3; width: 88px; height: 88px; margin: -44px auto 0; border-radius: 50%; background: #fff; box-shadow: 0 8px 24px -8px rgba(15, 23, 42, .35); }
.lw-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.lw-ring circle { fill: none; stroke-width: 4; }
.lw-ring-track { stroke: #e2e8f0; }
.lw-ring-bar { stroke: var(--lw-accent); stroke-linecap: round; stroke-dasharray: 251.33; stroke-dashoffset: 0; }
.lw-avatar-face { position: absolute; inset: 8px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1e40af, #3b82f6); color: #fff; font-weight: 700; font-size: 1.35rem; letter-spacing: .02em; }
.lw-avatar-face img { width: 100%; height: 100%; object-fit: cover; }
.lw-avatar-face [hidden] { display: none; }
.lw-check { position: absolute; right: -2px; bottom: -2px; width: 30px; height: 30px; border-radius: 50%; background: #16a34a; border: 3px solid #fff; display: flex; align-items: center; justify-content: center; }
.lw-check path { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 20; stroke-dashoffset: 0; }

.lw-copy { padding: 0 1.25rem; }
.lw-hello { margin: .9rem 0 0; font-size: .85rem; font-weight: 600; color: #64748b; }
.lw-name { margin: .1rem 0 0; font-size: 1.65rem; font-weight: 700; color: #0f172a; line-height: 1.15; min-height: 1.9rem; overflow-wrap: normal; }
.lw-sub { margin: .55rem 0 0; font-size: .8rem; color: #64748b; display: flex; align-items: center; justify-content: center; gap: .3rem; }
.lw-dots i { display: inline-block; width: 4px; height: 4px; margin-left: 2px; border-radius: 50%; background: currentColor; }
.lw-overlay.is-done .lw-dots { display: none; }
.lw-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lw-letter { display: inline-block; }
/* A whole word stays together: lines wrap only at the spaces between words, never inside one. */
.lw-word { display: inline-block; white-space: nowrap; }

@media (prefers-reduced-motion: no-preference) {
    .lw-overlay.is-open .lw-card { animation: lw-card-in .33s cubic-bezier(.2, .9, .25, 1.12) both; }
    .lw-overlay.is-open .lw-avatar { animation: lw-pop .36s .2s cubic-bezier(.2, 1.3, .4, 1) both; }
    .lw-overlay.is-open .lw-ring-bar { animation: lw-ring .65s .33s cubic-bezier(.4, 0, .2, 1) both; }
    .lw-overlay.is-open .lw-check { animation: lw-badge .26s .95s cubic-bezier(.2, 1.6, .4, 1) both; }
    .lw-overlay.is-open .lw-check path { animation: lw-draw .2s 1.05s ease-out both; }
    .lw-overlay.is-open .lw-hello { animation: lw-up .3s .23s ease-out both; }
    .lw-overlay.is-open .lw-letter { animation: lw-letter .26s calc(.33s + var(--i, 0) * .026s) cubic-bezier(.2, .9, .3, 1.2) both; }
    .lw-overlay.is-open .lw-sub { animation: lw-up .3s .6s ease-out both; }
    .lw-overlay.is-open .lw-dots i { animation: lw-dot 1s ease-in-out infinite; }
    .lw-overlay.is-open .lw-dots i:nth-child(2) { animation-delay: .15s; } .lw-overlay.is-open .lw-dots i:nth-child(3) { animation-delay: .3s; }
}
@keyframes lw-card-in { from { opacity: 0; transform: translateY(18px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes lw-pop { 0% { opacity: 0; transform: scale(.4); } 60% { opacity: 1; transform: scale(1.08); } 100% { opacity: 1; transform: scale(1); } }
@keyframes lw-ring { from { stroke-dashoffset: 251.33; } to { stroke-dashoffset: 0; } }
@keyframes lw-badge { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes lw-draw { from { stroke-dashoffset: 20; } to { stroke-dashoffset: 0; } }
@keyframes lw-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes lw-letter { from { opacity: 0; transform: translateY(10px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes lw-dot { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

/* ===== Scene: a mesh gradient of the module colours (CRM red, EMS orange, AFIS gold, AMS green,
   HRIS blue, PMS purple, over the UMS slate) with a moving wave along the bottom. ===== */
.lw-mesh { position: absolute; inset: 0; }
.lw-blob { position: absolute; width: 210px; height: 210px; border-radius: 50%; opacity: .92; background: radial-gradient(circle, var(--c) 0%, transparent 72%); }
/* Eight blues in one row, evenly spaced and alternating high and low, over a mid-blue base. The Stafify login-background blues (#1F5498, #2B70CA, #2A60A7, #17447F) plus one deep navy, #0E2E58, used by a single blob at 75% so it reads as deep blue, not black. The 5th blob is the Stafify-blue highlight: brighter (#1B6AF0 with a #5AA2FF core) and fully opaque. Order, left to right: #2A60A7, #17447F, #0E2E58, #2B70CA, #1B6AF0 (highlight), #1F5498, #17447F, #2A60A7. */
.lw-blob:nth-child(1) { --c: #2a60a7; left: calc(0% - 105px);      top: -65px; --r: 46px; --d: 4.2s; --dir: normal; }
.lw-blob:nth-child(2) { --c: #17447f; left: calc(14.29% - 105px);  top: -20px; --r: 52px; --d: 5s;   --dir: reverse; }
.lw-blob:nth-child(3) { --c: #0e2e58; opacity: .75; left: calc(28.57% - 105px);  top: -65px; --r: 44px; --d: 3.6s; --dir: normal; }
.lw-blob:nth-child(4) { --c: #2b70ca; left: calc(42.86% - 105px);  top: -20px; --r: 54px; --d: 4.8s; --dir: reverse; }
.lw-blob:nth-child(5) { --c: #1f5498; left: calc(71.43% - 105px);  top: -20px; --r: 46px; --d: 3.9s; --dir: normal; }
.lw-blob:nth-child(6) { --c: #17447f; left: calc(85.71% - 105px);  top: -65px; --r: 50px; --d: 5.2s; --dir: reverse; }
.lw-blob:nth-child(7) { --c: #2a60a7; left: calc(100% - 105px);    top: -20px; --r: 42px; --d: 4.4s; --dir: normal; }
.lw-blob-brand { --c: #1b6af0; left: calc(57.14% - 105px); top: -65px; --r: 48px; --d: 4.1s; --dir: normal; opacity: 1;
    background: radial-gradient(circle, #5aa2ff 0%, var(--c) 30%, transparent 72%); }
.lw-wave { position: absolute; left: 0; right: 0; background-repeat: repeat-x; background-position: 0 100%; }
.lw-wave-a { z-index: 2; bottom: -1px; height: 30px; background-size: 200px 100%; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 40' preserveAspectRatio='none'%3E%3Cpath d='M0 20Q50 0 100 20T200 20V40H0Z' fill='white'/%3E%3C/svg%3E"); }
.lw-wave-b { z-index: 1; bottom: 4px; height: 38px; background-size: 260px 100%; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 40' preserveAspectRatio='none'%3E%3Cpath d='M0 20Q50 0 100 20T200 20V40H0Z' fill='white' fill-opacity='.45'/%3E%3C/svg%3E"); }

/* Module icons, three down the left and four down the right of the avatar. */
.lw-icons { position: absolute; inset: 0; z-index: 3; }
.lw-ico { position: absolute; left: var(--x); top: var(--y); width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--c); background: rgba(255, 255, 255, .94); box-shadow: 0 5px 12px -3px rgba(15, 23, 42, .35); }
.lw-ico svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

@media (prefers-reduced-motion: no-preference) {
    .lw-overlay.is-open .lw-ico { animation: lw-ico-pop .3s calc(.15s + var(--k, 0) * .06s) cubic-bezier(.2, 1.4, .4, 1) both, lw-bob 2.6s calc(var(--k, 0) * -.4s) ease-in-out infinite alternate; }
    .lw-overlay.is-open .lw-blob { animation: lw-orbit var(--d, 4s) linear infinite var(--dir, normal), lw-breathe calc(var(--d, 4s) / 2) ease-in-out infinite alternate; }
    .lw-overlay.is-open .lw-wave-a { animation: lw-wave-a 5s linear infinite; }
    .lw-overlay.is-open .lw-wave-b { animation: lw-wave-b 8s linear infinite; }
}
@keyframes lw-ico-pop { from { opacity: 0; scale: .3; } }
@keyframes lw-bob { from { translate: 0 -3px; } to { translate: 0 4px; } }
/* Each blob travels a full circle (a closed loop, so it never snaps or reverses) while breathing in and out. */
@keyframes lw-orbit { from { transform: rotate(0deg) translateX(var(--r, 44px)); } to { transform: rotate(360deg) translateX(var(--r, 44px)); } }
@keyframes lw-breathe { from { scale: .88; } to { scale: 1.22; } }
@keyframes lw-wave-a { to { background-position-x: -200px; } }
@keyframes lw-wave-b { to { background-position-x: 260px; } }
/* ===== Desktop: a larger card (phones keep the compact 360px one) ===== */
@media (min-width: 768px) {
    .lw-card { width: 460px; padding-bottom: 1.9rem; border-radius: 1.5rem; }
    .lw-scene { height: 170px; }
    .lw-blob { width: 260px; height: 260px; margin: -25px 0 0 -25px; }
    .lw-wave-a { height: 38px; }
    .lw-wave-b { height: 48px; }
    .lw-ico { top: calc(var(--y) * 1.3); width: 38px; height: 38px; }
    .lw-ico svg { width: 21px; height: 21px; }
    .lw-avatar { width: 108px; height: 108px; margin-top: -54px; }
    .lw-avatar-face { inset: 9px; font-size: 1.7rem; }
    .lw-check { width: 36px; height: 36px; right: -1px; bottom: -1px; }
    .lw-check svg { width: 19px; height: 19px; }
    .lw-hello { margin-top: 1.1rem; font-size: 1rem; }
    .lw-name { font-size: 2.1rem; min-height: 2.4rem; }
    .lw-sub { margin-top: .7rem; font-size: .92rem; }
}

/* ===== Logout farewell: the same card on the Stafify blue of the login screen ===== */
.lw-overlay.lw-farewell {
    background-color: hsl(214, 66%, 36%);
    background-image: radial-gradient(at 40% 20%, hsl(214, 66%, 36%) 0px, transparent 50%), radial-gradient(at 80% 0%, hsl(214, 66%, 36%) 0px, transparent 50%), radial-gradient(at 0% 50%, hsl(214, 66%, 36%) 0px, transparent 50%), radial-gradient(at 77% 57%, hsl(214, 65%, 48%) 0px, transparent 50%), radial-gradient(at 0% 100%, hsl(214, 60%, 41%) 0px, transparent 50%), radial-gradient(at 80% 100%, hsl(214, 57%, 29%) 0px, transparent 50%), radial-gradient(at 0% 0%, hsl(214, 69%, 29%) 0px, transparent 50%);
    -webkit-backdrop-filter: none; backdrop-filter: none;
}
.lw-overlay.lw-farewell.is-open { transition: opacity .4s ease; }

/* The login page after a farewell: the box rises out of the blue instead of just appearing. */
@media (prefers-reduced-motion: no-preference) {
    html.lf-arrive main { animation: lf-in .7s cubic-bezier(.2, .7, .2, 1) .05s backwards; }
}
@keyframes lf-in { from { opacity: 0; transform: translateY(16px) scale(.985); } }