/* Shared by Login and its destination so the overlay survives the SPA page swap. */
.kpv-route-curtain { position: fixed; z-index: 100000; inset: 0; display: grid; place-items: center; visibility: hidden; opacity: 0; pointer-events: none; overflow: hidden; background: radial-gradient(ellipse at 50% 45%,#79243b 0%,#4c1026 45%,#260a18 100%); transition: opacity .28s .18s ease,visibility .28s .18s; }
.kpv-route-curtain::before { content: ''; position: absolute; inset: -45%; opacity: .5; background: linear-gradient(115deg,transparent 38%,#f5cc8b14 48%,#ffe7b93b 50%,transparent 60%); transform: translateX(-45%) rotate(-5deg); }
.kpv-route-curtain::after { content: ''; position: absolute; inset: 0; opacity: .12; background: url('/images/kpv-ci/atgm-engraved-lines.svg') center / cover no-repeat; }
.kpv-route-mark { position: relative; z-index: 1; display: flex; align-items: center; flex-direction: column; gap: 24px; color: #f6d7ae; transform: translateY(12px); opacity: 0; transition: opacity .3s .24s,transform .45s .2s cubic-bezier(.2,.8,.2,1); }
.kpv-route-mark :is(img, .kpv-brand-logo) { display: block; width: 250px; height: auto; }
.kpv-route-mark svg { width: 38px; height: 38px; }
.kpv-route-mark p { margin: 0; font: 400 13px/1.7 'Noto Sans Lao',sans-serif; }
.kpv-route-check { stroke-dasharray: 1; stroke-dashoffset: 1; }
.atgm-route-leaving .kpv-route-curtain { opacity: 1; visibility: visible; pointer-events: auto; }
.atgm-route-leaving .kpv-route-mark { opacity: 1; transform: translateY(0); }
.atgm-route-leaving .kpv-route-curtain::before { animation: kpv-route-light 1.4s both cubic-bezier(.2,.7,.2,1); }
.atgm-route-leaving .kpv-route-check { animation: kpv-route-check .4s .2s both; }
.atgm-route-leaving :is(.atgm-access-card, .fi-simple-main) { transform: translateY(-8px) scale(.98); opacity: 0; filter: blur(2px); transition: transform .28s ease,opacity .24s ease,filter .28s ease; }
.atgm-route-arriving .kpv-route-curtain { opacity: 1; visibility: visible; transform-origin: top; animation: kpv-route-open .95s both cubic-bezier(.65,0,.2,1); box-shadow: 0 20px 60px #24071a55; }
.atgm-route-arriving .kpv-route-mark { opacity: 1; transform: translateY(0); }
.atgm-route-arriving .kpv-route-check { stroke-dashoffset: 0; }
.atgm-route-arriving .fi-layout { animation: kpv-route-content .85s .14s both cubic-bezier(.2,.7,.2,1); }
@keyframes kpv-route-light { to { transform: translateX(45%) rotate(-5deg); } }
@keyframes kpv-route-check { to { stroke-dashoffset: 0; } }
@keyframes kpv-route-open { 0% { opacity: 1; transform: translateY(0); } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-102%); visibility: hidden; } }
@keyframes kpv-route-content { from { opacity: .12; transform: translateY(42px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .kpv-route-curtain { display: none; } .atgm-route-leaving :is(.atgm-access-card, .fi-simple-main), .atgm-route-arriving .fi-layout { animation: none; transition: none; transform: none; filter: none; opacity: 1; } }

.atgm-route-arriving .kpv-route-curtain::before { animation: kpv-route-light 1.4s -.65s both cubic-bezier(.2,.7,.2,1); }

.kpv-route-progress { position: relative; overflow: hidden; width: 220px; height: 3px; margin-top: -6px; border-radius: 3px; background: #e9c89620; }
.kpv-route-progress > span { position: absolute; inset: 0 auto 0 0; width: 35%; border-radius: inherit; background: linear-gradient(90deg,#BD8E50,#FFE7B5); box-shadow: 0 0 12px #e8c08170; transform: translateX(-110%); }
.atgm-route-leaving .kpv-route-progress > span { animation: kpv-route-loading 1.15s .15s linear infinite; }
.atgm-route-arriving .kpv-route-progress > span { width: 100%; transform: translateX(0); }
.atgm-route-leaving #nprogress .bar { background: #edcb91; }
@keyframes kpv-route-loading { to { transform: translateX(390%); } }
@media (prefers-reduced-motion: reduce) { .kpv-route-progress > span { animation: none !important; } }

.atgm-route-waiting .kpv-route-curtain { opacity: 1; visibility: visible; transition: none; pointer-events: auto; }
.atgm-route-waiting .kpv-route-mark { opacity: 1; transform: translateY(0); transition: none; }

.atgm-route-waiting .kpv-route-progress > span { animation: kpv-route-loading 1.15s linear infinite; }
.atgm-route-waiting .fi-layout { visibility: hidden; }

.kpv-route-status { position: relative; width: 52px; height: 52px; display: grid; place-items: center; }
.kpv-route-status > svg { position: absolute; width: 52px; height: 52px; transition: opacity .2s,transform .35s cubic-bezier(.2,.8,.2,1); }
.kpv-route-spinner { transform-origin: 20px 20px; animation: kpv-route-spin 1.25s linear infinite; }
.kpv-route-success { opacity: 0; transform: scale(.72); }
.kpv-route-ready-label { display: none; }
.kpv-route-success-ring { position: absolute; inset: 0; opacity: 0; border: 1px solid #75E3A3; border-radius: 50%; }
.kpv-route-burst { position: absolute; inset: 0; pointer-events: none; }
.kpv-route-burst i { position: absolute; top: 50%; left: 50%; width: 2px; height: 7px; border-radius: 2px; background: #F9D28D; opacity: 0; transform: rotate(calc(var(--spark)*45deg)) translateY(-24px); }
.kpv-route-burst i:nth-child(even) { background: #75E3A3; }
.atgm-route-ready .kpv-route-loader, .atgm-route-arriving .kpv-route-loader { opacity: 0; transform: scale(.8); }
.atgm-route-ready .kpv-route-success, .atgm-route-arriving .kpv-route-success { opacity: 1; transform: scale(1); }
.atgm-route-ready .kpv-route-check { animation: kpv-route-check .4s .08s both; }
.atgm-route-ready .kpv-route-success-ring { animation: kpv-route-confirm-ring .8s both; }
.atgm-route-ready .kpv-route-burst i { animation: kpv-route-spark .75s .1s both; }
.atgm-route-ready .kpv-route-mark > :is(img, .kpv-brand-logo, .kpv-brand-shine) { animation: kpv-route-logo-wow .85s both; }
.atgm-route-ready .kpv-route-progress > span, .atgm-route-arriving .kpv-route-progress > span { animation: none; width: 100%; transform: translateX(0); background: linear-gradient(90deg,#3BB47A,#8CF0B4); box-shadow: 0 0 15px #75E3A33b; }
.atgm-route-ready .kpv-route-loading-label, .atgm-route-arriving .kpv-route-loading-label { display: none; }
.atgm-route-ready .kpv-route-ready-label, .atgm-route-arriving .kpv-route-ready-label { display: inline; color: #99EDBB; }
@keyframes kpv-route-spin { to { transform: rotate(360deg); } }
@keyframes kpv-route-confirm-ring { 0% { opacity: .8; transform: scale(.85); } 100% { opacity: 0; transform: scale(1.9); } }
@keyframes kpv-route-spark { 0% { opacity: 0; transform: rotate(calc(var(--spark)*45deg)) translateY(-24px) scale(.3); } 25% { opacity: 1; } 100% { opacity: 0; transform: rotate(calc(var(--spark)*45deg)) translateY(-58px) scale(.3); } }
@keyframes kpv-route-logo-wow { 0%,100% { transform: scale(1); filter: drop-shadow(0 0 0 #F2C47F00); } 40% { transform: scale(1.035); filter: drop-shadow(0 0 18px #F2C47F44); } }
@media (prefers-reduced-motion: reduce) { .kpv-route-status *, .kpv-route-burst *, .kpv-route-mark > :is(img, .kpv-brand-logo, .kpv-brand-shine) { animation: none !important; } }

/* Logout reverses the journey: curtain down, then return the Login card. */
.kpv-route-logout-copy { display: none; }
.atgm-route-logout .kpv-route-login-copy { display: none; }
.atgm-route-logout .kpv-route-logout-copy { display: inline; }
.atgm-route-logout.atgm-route-leaving .kpv-route-curtain { transition: none; animation: kpv-route-close-down .65s both cubic-bezier(.65,0,.2,1); }
.atgm-route-logout.atgm-route-leaving .fi-layout { pointer-events: none; animation: kpv-route-home-out .5s both ease; }
.atgm-route-logout.atgm-route-waiting :is(.atgm-access-main, .fi-simple-main) { visibility: hidden; }
.atgm-route-logout.atgm-route-arriving .kpv-route-curtain { animation: kpv-route-settle .55s both ease; box-shadow: none; }
.atgm-route-logout.atgm-route-arriving :is(.atgm-access-card, .fi-simple-main) { animation: kpv-route-card-return .9s .55s both cubic-bezier(.2,.8,.2,1); }
.atgm-route-logout.atgm-route-arriving .atgm-access-footer { animation: kpv-route-card-return .65s .8s both ease; }
@keyframes kpv-route-close-down { from { opacity: 1; transform: translateY(-102%); } to { opacity: 1; transform: translateY(0); } }
@keyframes kpv-route-home-out { from { opacity: 1; transform: translateY(0); } to { opacity: .4; transform: translateY(18px); } }
@keyframes kpv-route-settle { from { opacity: 1; transform: translateY(0); } to { opacity: 0; visibility: hidden; transform: translateY(0); } }
@keyframes kpv-route-card-return { from { opacity: 0; transform: translateY(-8px) scale(.98); filter: blur(2px); } to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); } }
@media (prefers-reduced-motion: reduce) {
 .atgm-route-logout.atgm-route-leaving .fi-layout, .atgm-route-logout.atgm-route-arriving :is(.atgm-access-card, .fi-simple-main), .atgm-route-logout.atgm-route-arriving .atgm-access-footer { animation: none; transform: none; filter: none; opacity: 1; }
}

.atgm-route-logout.atgm-route-waiting .atgm-access .story-motion { animation-play-state: paused !important; }
