/* Shared motion layer for dark tech UI. */

body{
  position: relative;
}

body::before,
body::after{
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body::before{
  background:
    linear-gradient(rgba(93,214,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(93,214,255,0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 16%, #000 84%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 16%, #000 84%, transparent);
  opacity: 0.5;
  animation: motion-grid-drift 18s linear infinite;
}

body::after{
  background:
    linear-gradient(115deg, transparent 0%, transparent 42%, rgba(93,214,255,0.12) 49%, rgba(120,255,214,0.08) 51%, transparent 58%, transparent 100%);
  opacity: 0.22;
  transform: translateY(-28%);
  animation: motion-scan 9s ease-in-out infinite;
}

.topbar,
.main,
.page,
.footer{
  position: relative;
  z-index: 1;
}

.topbar{
  z-index: 20;
  animation: motion-topbar-in 420ms cubic-bezier(.2,.9,.2,1) both;
}

.card,
.panel{
  position: relative;
  overflow: hidden;
  animation: motion-surface-in 560ms cubic-bezier(.2,.9,.2,1) both;
  will-change: transform, opacity;
}

.card::before,
.panel::before{
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0%, rgba(255,255,255,0.08) 42%, transparent 58%),
    radial-gradient(520px 180px at 18% 0%, rgba(93,214,255,0.14), transparent 58%);
  opacity: 0;
  transform: translateX(-38%);
  animation: motion-surface-sheen 980ms ease 160ms both;
}

.title,
.panel__title{
  animation: motion-title-in 520ms ease both, motion-title-glow 4.8s ease-in-out 800ms infinite alternate;
}

.subtitle,
.form > .label,
.form .field,
.inputRow,
.actions,
.sub-actions,
.hint,
.panel__tools,
.tableWrap,
.tableHint{
  animation: motion-item-in 500ms ease both;
}

.subtitle{ animation-delay: 80ms; }
.form > .label,
.form .field:nth-of-type(1){ animation-delay: 120ms; }
.form .field:nth-of-type(2),
.inputRow{ animation-delay: 160ms; }
.form .field:nth-of-type(3){ animation-delay: 200ms; }
.form .field:nth-of-type(4){ animation-delay: 240ms; }
.form .field:nth-of-type(5){ animation-delay: 280ms; }
.actions,
.sub-actions,
.panel__tools{ animation-delay: 300ms; }
.hint,
.tableHint{ animation-delay: 360ms; }

.input{
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.input:hover{
  background: rgba(255,255,255,0.10);
}

.input:focus{
  transform: translateY(-1px);
}

.btn{
  position: relative;
  overflow: hidden;
  transition:
    transform 160ms ease,
    background 200ms ease,
    border-color 200ms ease,
    box-shadow 200ms ease,
    filter 200ms ease,
    opacity 200ms ease;
}

.btn::before{
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 0%, rgba(255,255,255,0.18) 48%, transparent 58%);
  opacity: 0;
  transform: translateX(-120%);
}

.btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 0 22px rgba(93,214,255,0.16);
}

.btn:hover::before{
  opacity: 1;
  animation: motion-button-sheen 680ms ease both;
}

.btn:active{
  transform: translateY(1px) scale(0.99);
}

.btn:disabled,
.btn:disabled:hover{
  transform: none;
  box-shadow: none;
}

.resultArea:not(.is-hidden){
  animation: motion-result-in 460ms cubic-bezier(.2,.9,.2,1) both;
}

.qrcodeBox canvas,
.qrcodeBox img{
  animation: motion-pop-in 360ms ease both;
}

.table tbody tr{
  animation: motion-row-in 360ms ease both;
}

.table tbody tr:nth-child(1){ animation-delay: 20ms; }
.table tbody tr:nth-child(2){ animation-delay: 40ms; }
.table tbody tr:nth-child(3){ animation-delay: 60ms; }
.table tbody tr:nth-child(4){ animation-delay: 80ms; }
.table tbody tr:nth-child(5){ animation-delay: 100ms; }
.table tbody tr:nth-child(6){ animation-delay: 120ms; }
.table tbody tr:nth-child(7){ animation-delay: 140ms; }
.table tbody tr:nth-child(8){ animation-delay: 160ms; }
.table tbody tr:nth-child(9){ animation-delay: 180ms; }
.table tbody tr:nth-child(10){ animation-delay: 200ms; }

.table tbody tr:hover td{
  box-shadow: inset 0 0 0 999px rgba(93,214,255,0.018);
}

.swal2-container.swal2-backdrop-show{
  animation: motion-fade-in 160ms ease both;
}

.swal2-popup.swal2-show{
  animation: motion-modal-in 240ms cubic-bezier(.2,.9,.2,1) both !important;
}

.swal2-popup{
  background: rgba(12,16,32,0.94) !important;
  color: rgba(255,255,255,0.92) !important;
  border: 1px solid rgba(255,255,255,0.14) !important;
  box-shadow: 0 26px 80px rgba(0,0,0,0.55), 0 0 32px rgba(93,214,255,0.10) !important;
}

.swal2-title,
.swal2-html-container{
  color: rgba(255,255,255,0.92) !important;
}

.swal2-styled{
  transition:
    transform 160ms ease,
    filter 200ms ease,
    box-shadow 200ms ease !important;
}

.swal2-styled:hover{
  transform: translateY(-1px) !important;
  box-shadow: 0 0 22px rgba(93,214,255,0.18) !important;
}

@keyframes motion-grid-drift{
  from{ background-position: 0 0, 0 0; }
  to{ background-position: 48px 48px, 48px 48px; }
}

@keyframes motion-scan{
  0%{ transform: translateY(-34%); opacity: 0.10; }
  45%, 55%{ opacity: 0.26; }
  100%{ transform: translateY(34%); opacity: 0.10; }
}

@keyframes motion-topbar-in{
  from{ opacity: 0; transform: translateY(-14px); }
  to{ opacity: 1; transform: translateY(0); }
}

@keyframes motion-surface-in{
  from{ opacity: 0; transform: translateY(16px); box-shadow: 0 10px 28px rgba(0,0,0,0.22); }
  to{ opacity: 1; transform: translateY(0); }
}

@keyframes motion-surface-sheen{
  0%{ opacity: 0; transform: translateX(-42%); }
  36%{ opacity: 0.8; }
  100%{ opacity: 0; transform: translateX(46%); }
}

@keyframes motion-title-in{
  from{ opacity: 0; transform: translateY(8px); }
  to{ opacity: 1; transform: translateY(0); }
}

@keyframes motion-title-glow{
  from{ text-shadow: 0 0 0 rgba(93,214,255,0); }
  to{ text-shadow: 0 0 22px rgba(93,214,255,0.20); }
}

@keyframes motion-item-in{
  from{ opacity: 0; transform: translateY(10px); }
  to{ opacity: 1; transform: translateY(0); }
}

@keyframes motion-button-sheen{
  from{ transform: translateX(-120%); }
  to{ transform: translateX(120%); }
}

@keyframes motion-result-in{
  from{ opacity: 0; transform: translateY(12px) scale(0.985); box-shadow: 0 0 0 rgba(93,214,255,0); }
  to{ opacity: 1; transform: translateY(0) scale(1); box-shadow: 0 0 26px rgba(93,214,255,0.08); }
}

@keyframes motion-pop-in{
  from{ opacity: 0; transform: scale(0.96); filter: drop-shadow(0 0 0 rgba(93,214,255,0)); }
  to{ opacity: 1; transform: scale(1); filter: drop-shadow(0 0 14px rgba(93,214,255,0.22)); }
}

@keyframes motion-row-in{
  from{ opacity: 0; transform: translateY(6px); }
  to{ opacity: 1; transform: translateY(0); }
}

@keyframes motion-fade-in{
  from{ opacity: 0; }
  to{ opacity: 1; }
}

@keyframes motion-modal-in{
  from{ opacity: 0; transform: translateY(10px) scale(0.985); }
  to{ opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 520px){
  body::before{
    background-size: 36px 36px;
    animation-duration: 22s;
    opacity: 0.34;
  }

  body::after{
    opacity: 0.14;
    animation-duration: 12s;
  }

  .card,
  .panel{
    animation-duration: 420ms;
  }

  .table tbody tr{
    animation-duration: 240ms;
  }
}

@media (prefers-reduced-motion: reduce){
  *,
  *::before,
  *::after{
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
