/*
 * AB Care — motion layer for the sign-in pages (8 Nov 2026).
 * Owner: «ابي فيه انميشن ولوقو وحركات… بس حلو». One page-load sequence, then a quiet rotating record.
 * Transform and opacity only; everything settles under prefers-reduced-motion. Driven by care-motion.js.
 */

/* drifting blueprint grid and a breathing light behind the dark stage */
.cm-grid { position: absolute; inset: -44px 0 0 -44px; z-index: -1; opacity: .5; pointer-events: none;
  background-image: linear-gradient(#ffffff0b 1px, transparent 1px), linear-gradient(90deg, #ffffff0b 1px, transparent 1px);
  background-size: 44px 44px; -webkit-mask-image: radial-gradient(80% 70% at 70% 30%, #000, transparent 75%); mask-image: radial-gradient(80% 70% at 70% 30%, #000, transparent 75%);
  animation: cm-drift 30s linear infinite; }
@keyframes cm-drift { to { transform: translate3d(44px, 44px, 0); } }
.cm-glow { position: absolute; z-index: -1; width: 560px; height: 560px; border-radius: 50%; top: -240px; left: -180px; pointer-events: none;
  background: radial-gradient(circle, #0a85fd40 0, transparent 65%); animation: cm-breathe 9s ease-in-out infinite; }
@keyframes cm-breathe { 50% { transform: scale(1.14); opacity: .65; } }

/* the logo arrives turning in, and one ring ripples out from it */
.cm-logo { position: relative; display: inline-grid; place-items: center; flex: none; }
.cm-logo > * { position: relative; z-index: 1; animation: cm-logo-in .9s cubic-bezier(.2, .8, .2, 1) .1s both; }
.cm-logo::before { content: ""; position: absolute; inset: -4px; border-radius: inherit; border: 2px solid #5fb2ff; opacity: 0; pointer-events: none;
  animation: cm-ring 1.5s ease-out .7s 1 both; }
.cm-logo.round::before { border-radius: 50%; }
@keyframes cm-logo-in { from { opacity: 0; transform: scale(.55) rotate(-14deg); } to { opacity: 1; transform: none; } }
@keyframes cm-ring { 0% { opacity: .85; transform: scale(.8); } 100% { opacity: 0; transform: scale(1.7); } }

/* the logo badge on the sign-in card: navy tile, and a light that passes over it every few seconds */
.cm-logo.tile { border-radius: 18px; }
.cm-badge { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; overflow: hidden; position: relative;
  background: linear-gradient(150deg, #123A66, #071A33 70%); box-shadow: 0 10px 24px #0718333d, inset 0 1px 0 #ffffff21; }
.cm-badge img { width: 36px; height: 36px; position: relative; }
.cm-badge::after { content: ""; position: absolute; inset: -20% auto -20% -70%; width: 45%; transform: skewX(-18deg); pointer-events: none;
  background: linear-gradient(90deg, transparent, #ffffff45, transparent); animation: cm-sweep 5.5s ease-in-out 1.4s infinite; }
@keyframes cm-sweep { 0%, 72% { left: -70%; } 100% { left: 140%; } }
.cm-head { display: flex; align-items: center; gap: 14px; }
.cm-head > div > :last-child { text-wrap: pretty; }
@media (max-width: 420px) { .cm-badge { width: 52px; height: 52px; border-radius: 15px; } .cm-logo.tile { border-radius: 15px; } .cm-badge img { width: 31px; height: 31px; } }

/* the card arrives once, its parts follow in order (replays when a step is shown again) */
.cm-card { animation: cm-card-in .7s cubic-bezier(.2, .8, .2, 1) .15s both; }
.cm-card > * { animation: cm-up .55s cubic-bezier(.2, .8, .2, 1) both; }
.cm-card > :nth-child(1) { animation-delay: .25s; } .cm-card > :nth-child(2) { animation-delay: .32s; }
.cm-card > :nth-child(3) { animation-delay: .39s; } .cm-card > :nth-child(4) { animation-delay: .46s; }
.cm-card > :nth-child(5) { animation-delay: .53s; } .cm-card > :nth-child(6) { animation-delay: .6s; }
.cm-card > :nth-child(n+7) { animation-delay: .67s; }
@keyframes cm-card-in { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes cm-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* the headline settles word by word (care-motion.js wraps the words) */
.cm-words .w { display: inline-block; animation: cm-word .6s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes cm-word { from { opacity: 0; transform: translateY(16px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }

/* main button: a light passes across on hover */
.cm-shine { position: relative; overflow: hidden; isolation: isolate; }
.cm-shine::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; transform: skewX(-20deg); pointer-events: none;
  background: linear-gradient(90deg, transparent, #ffffff4d, transparent); transition: left .75s ease; }
.cm-shine:hover::after, .cm-shine:focus-visible::after { left: 130%; }

/* the record's heading with a soft beating dot */
.cm-live { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: #8FB0D3; margin-bottom: 4px; }
.cm-live i { width: 8px; height: 8px; border-radius: 50%; background: #3DD39A; box-shadow: 0 0 0 0 #3dd39a88; animation: cm-dot 1.9s ease-out infinite; }
@keyframes cm-dot { to { box-shadow: 0 0 0 9px #3dd39a00; } }

@media (prefers-reduced-motion: reduce) {
  .cm-grid, .cm-glow, .cm-logo > *, .cm-logo::before, .cm-badge::after, .cm-card, .cm-card > *, .cm-words .w, .cm-live i { animation: none !important; }
  .cm-logo::before, .cm-badge::after, .cm-shine::after { display: none; }
}
