/* TDC Coaching — B+ Studio Pop motion system. Requires tokens.css + bundle.css.
   Load order: tokens.css → bundle.css → motion.css. bundle.css components use the
   keyframes below (tdc-float, tdc-pulse, tdc-fill, tdc-rise), so always load both.
   Two levels: Sống động (default) and Tinh tế (.tdc-motion-calm on the app root).
   Everything is off under prefers-reduced-motion. See components/MotionLab. */

/* ---------- tokens ---------- */
:root{--dur-fast:150ms;--dur-base:280ms;--dur-slow:520ms;--ease-out:cubic-bezier(.2,.8,.2,1);--ease-spring:cubic-bezier(.3,1.6,.5,1)}

/* ---------- keyframes ---------- */
@keyframes tdc-rise{from{opacity:0;transform:translateY(18px)}to{opacity:1;transform:none}}
@keyframes tdc-float{50%{transform:translateY(8px) rotate(4deg)}}
@keyframes tdc-pulse{50%{transform:scale(1.6);opacity:.5}}
@keyframes tdc-fill{from{transform:scaleX(0)}}
@keyframes tdc-slide-in{from{opacity:0;transform:translateX(18px)}to{opacity:1;transform:none}}
@keyframes tdc-slide-in-left{from{opacity:0;transform:translateX(-18px)}to{opacity:1;transform:none}}
@keyframes tdc-pop{0%{transform:scale(.55)}60%{transform:scale(1.15)}100%{transform:scale(1)}}
@keyframes tdc-wiggle{0%,72%,100%{transform:rotate(0)}78%{transform:rotate(-4deg)}86%{transform:rotate(3deg)}93%{transform:rotate(-1.5deg)}}
@keyframes tdc-shimmer{from{background-position:120% 0}to{background-position:-20% 0}}
@keyframes tdc-ring-pulse{0%{box-shadow:0 0 0 0 rgba(184,35,42,.35)}70%{box-shadow:0 0 0 10px rgba(184,35,42,0)}100%{box-shadow:0 0 0 0 rgba(184,35,42,0)}}
@keyframes tdc-draw{to{stroke-dashoffset:0}}
@keyframes tdc-burst{0%{opacity:0;transform:translate(0,0) rotate(0) scale(.3)}20%{opacity:1}100%{opacity:0;transform:translate(var(--dx),var(--dy)) rotate(var(--rot)) scale(1)}}

/* ---------- entrances ---------- */
.tdc-rise{animation:tdc-rise .7s cubic-bezier(.2,.8,.2,1) both}
/* screen / tab content change: direction-aware */
.tdc-enter{animation:tdc-slide-in var(--dur-base) var(--ease-out) both}
.tdc-enter.from-left{animation-name:tdc-slide-in-left}
/* list stagger: children rise one after another (first 8) */
.tdc-stagger>*{animation:tdc-rise var(--dur-slow) var(--ease-out) both}
.tdc-stagger>*:nth-child(2){animation-delay:50ms}.tdc-stagger>*:nth-child(3){animation-delay:100ms}.tdc-stagger>*:nth-child(4){animation-delay:150ms}
.tdc-stagger>*:nth-child(5){animation-delay:200ms}.tdc-stagger>*:nth-child(6){animation-delay:250ms}.tdc-stagger>*:nth-child(7){animation-delay:300ms}.tdc-stagger>*:nth-child(n+8){animation-delay:350ms}
/* mascot idle: a small shrug every few seconds, pivoting on its feet */
.tdc-wiggle{animation:tdc-wiggle 5s ease-in-out infinite;transform-origin:50% 100%}
/* loading */
.tdc-skeleton{display:block;border-radius:8px;background:linear-gradient(90deg,var(--paper-sunk) 30%,#FBF9F6 50%,var(--paper-sunk) 70%);background-size:250% 100%;animation:tdc-shimmer 1.3s linear infinite}
/* selected tab icon pops; chips and days spring */
.tdc-tab[aria-current="page"] svg{animation:tdc-pop .45s var(--ease-spring)}
.tdc-choice,.tdc-chip{transition:transform var(--dur-fast) var(--ease-spring),background var(--dur-base)}
.tdc-choice:active,.tdc-chip:active,.tdc-day:active,.tdc-slot:active{transform:scale(.94)}
/* deadline under 3 hours: ring breathes red */
.tdc-ring.is-urgent{border-radius:50%;animation:tdc-ring-pulse 1.8s ease-out infinite}

/* EmptyState mascot: rises in, then idles */
.tdc-empty.is-alive img{transform-origin:50% 100%;animation:tdc-rise .7s cubic-bezier(.2,.8,.2,1) both,tdc-wiggle 5s 1s ease-in-out infinite}

/* SuccessBurst */
.tdc-success{position:absolute;inset:0;z-index:20;display:grid;place-items:center;background:rgba(248,247,245,.92);animation:tdc-rise var(--dur-base) var(--ease-out) both}
.tdc-success__box{position:relative;text-align:center;padding:0 24px}
.tdc-success__check{width:72px;height:72px;border-radius:50%;background:var(--lab-strong);display:grid;place-items:center;margin:0 auto 14px;animation:tdc-pop .55s var(--ease-spring) both}
.tdc-success__check svg{width:36px;height:36px;fill:none;stroke:var(--ink);stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.tdc-success__check path{stroke-dasharray:30;stroke-dashoffset:30;animation:tdc-draw .45s .3s var(--ease-out) forwards}
.tdc-success__title{font:700 26px/28px var(--font-display);margin:0 0 6px}
.tdc-success__img{height:96px;display:block;margin:0 auto 10px;animation:tdc-pop .6s .15s var(--ease-spring) both}
.tdc-success .tdc-burst{position:absolute;left:50%;top:36px;width:22px;height:38px;margin:-19px 0 0 -11px;fill:var(--lab-strong);animation:tdc-burst 1s var(--ease-out) both}

/* ---------- Tinh tế level (.tdc-motion-calm) ---------- */
.tdc-motion-calm .tdc-burst,.tdc-motion-calm .tdc-wiggle{animation:none!important}
.tdc-motion-calm .tdc-burst{display:none}
.tdc-motion-calm .tdc-stagger>*{animation-duration:var(--dur-base);animation-delay:0s!important}
.tdc-motion-calm .tdc-empty.is-alive img{animation:tdc-rise .7s both}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion:reduce){.tdc-root *,.tdc-rise,[class*="tdc-"]{animation:none!important;transition:none!important}}
