/* Motion, brand glow, screenshot chips and login atmosphere. */

.backdrop span:nth-child(4) {
  width: 280px;
  height: 280px;
  top: 12%;
  right: 18%;
  background: #5b8dff;
  opacity: .18;
  animation-delay: -19s;
}
.backdrop i {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  opacity: .35;
  box-shadow: 0 0 12px rgba(160, 200, 255, .8);
  animation: spark 7s ease-in-out infinite;
}
.backdrop i:nth-of-type(1) { top: 18%; left: 12%; animation-delay: -1s; }
.backdrop i:nth-of-type(2) { top: 34%; right: 16%; width: 3px; height: 3px; animation-delay: -2.4s; }
.backdrop i:nth-of-type(3) { bottom: 22%; left: 28%; animation-delay: -3.8s; }
.backdrop i:nth-of-type(4) { top: 62%; right: 32%; width: 4px; height: 4px; animation-delay: -5s; }
.backdrop i:nth-of-type(5) { bottom: 12%; right: 10%; animation-delay: -6.2s; }
.backdrop .mesh {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 20% 20%, rgba(110, 168, 255, .08), transparent 28%),
    repeating-linear-gradient(115deg, transparent 0 34px, rgba(148, 178, 235, .035) 34px 35px);
  mask-image: radial-gradient(circle at 50% 40%, #000 20%, transparent 78%);
  animation: meshDrift 28s linear infinite;
}

.brand-mark {
  position: relative;
  overflow: visible;
  isolation: isolate;
  animation: markGlow 4.8s ease-in-out infinite;
}
.brand-mark b {
  position: relative;
  z-index: 1;
  font-weight: 900;
  letter-spacing: -.03em;
}
.mark-ring {
  position: absolute;
  inset: -7px;
  border-radius: 18px;
  border: 1px solid rgba(160, 200, 255, .45);
  animation: orbit 6s linear infinite;
  pointer-events: none;
}
.mark-ring.two {
  inset: -12px;
  border-color: rgba(69, 224, 192, .28);
  animation-duration: 9s;
  animation-direction: reverse;
  opacity: .7;
}
.brand-mark.mini .mark-ring { inset: -5px; border-radius: 14px; }
.brand-mark.mini .mark-ring.two { inset: -9px; }

.send-btn {
  position: relative;
  overflow: hidden;
}
.send-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, .28) 48%, transparent 72%);
  transform: translateX(-120%);
  animation: shine 3.6s ease-in-out infinite;
}
.composer-box:focus-within {
  box-shadow: 0 0 0 4px rgba(110, 168, 255, .12), 0 0 28px rgba(91, 141, 255, .16);
}
.composer-box.drop-hover {
  border-color: rgba(69, 224, 192, .7);
  box-shadow: 0 0 0 4px rgba(69, 224, 192, .16);
}
.composer-box.has-shots { border-color: rgba(110, 168, 255, .45); }

.attach-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 2px 4px;
}
.attach-chip {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(160, 200, 255, .35);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .28);
  animation: pop .28s cubic-bezier(.2, .8, .2, 1) both;
}
.attach-chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.attach-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(8, 12, 24, .78);
  color: #fff;
  font-size: .85rem;
  line-height: 1;
  display: grid;
  place-items: center;
}

.msg-shots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 8px;
}
.msg-shots img {
  max-width: min(220px, 70vw);
  max-height: 160px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .22);
}
.message.user .msg-shots img { border-color: rgba(255, 255, 255, .22); }

.security-card {
  margin: 0 0 4px;
  padding: 12px 13px;
  border-radius: 14px;
  border: 1px solid rgba(69, 224, 192, .22);
  background: linear-gradient(180deg, rgba(69, 224, 192, .08), rgba(8, 14, 26, .35));
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.5;
}
.security-card p { margin: 0 0 8px; color: #d5e4ff; }
.security-card ul { margin: 0; padding-left: 1.1em; }
.security-card li { margin: .2em 0; }

.welcome-chips .chip:last-child {
  border-color: rgba(69, 224, 192, .4);
  background: rgba(69, 224, 192, .12);
  color: #c8ffe9;
}

.login-page .logo {
  position: relative;
  animation: markGlow 4.8s ease-in-out infinite, rise .5s ease both;
}
.login-page .logo::before,
.login-page .logo::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 22px;
  border: 1px solid rgba(160, 200, 255, .4);
  animation: orbit 7s linear infinite;
  pointer-events: none;
}
.login-page .logo::after {
  inset: -14px;
  border-color: rgba(69, 224, 192, .28);
  animation-duration: 11s;
  animation-direction: reverse;
}

@keyframes spark {
  0%, 100% { transform: translateY(0) scale(1); opacity: .2; }
  50% { transform: translateY(-14px) scale(1.4); opacity: .7; }
}
@keyframes meshDrift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-40px, 24px, 0); }
}
@keyframes orbit {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes markGlow {
  0%, 100% { box-shadow: 0 10px 26px rgba(91, 141, 255, .38), inset 0 1px 0 rgba(255, 255, 255, .5); }
  50% { box-shadow: 0 14px 34px rgba(69, 224, 192, .42), inset 0 1px 0 rgba(255, 255, 255, .6); }
}
@keyframes shine {
  0%, 55% { transform: translateX(-120%); }
  75%, 100% { transform: translateX(120%); }
}

@media (prefers-reduced-motion: reduce) {
  .backdrop span, .backdrop i, .backdrop .mesh, .brand-mark, .mark-ring, .send-btn::after, .login-page .logo {
    animation: none !important;
  }
}
