:root {
  --xsr-logo-bg: #11141a;
  --xsr-logo-cyan: #00f0ff;
  --xsr-logo-text-deep: #021428;
  --xsr-logo-text-mid: #0a1f38;
  --xsr-logo-text-black: #000000;
}

/* ——— الحاوية ——— */
.xsr-brand-logo {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  user-select: none;
  position: relative;
  z-index: 1;
}

.xsr-brand-logo--header {
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
}

/* ——— الأيقونة (تأثيرات سابقة) ——— */
.xsr-brand-logo-emblem {
  --emblem-size: 5.5rem;
  position: relative;
  width: var(--emblem-size);
  height: var(--emblem-size);
  flex-shrink: 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--xsr-logo-bg);
  box-shadow:
    0 12px 28px rgba(15, 23, 42, 0.22),
    0 0 0 1px rgba(0, 240, 255, 0.12),
    0 0 28px rgba(0, 240, 255, 0.14);
  animation:
    xsr-brand-logo-enter 0.65s cubic-bezier(0.22, 1, 0.36, 1) both,
    xsr-logo-emblem-glow 3.2s ease-in-out 0.65s infinite,
    xsr-brand-logo-float 5.5s ease-in-out 0.65s infinite;
}

.xsr-brand-logo-emblem::before {
  content: "";
  position: absolute;
  inset: -18%;
  z-index: 0;
  border-radius: 14px;
  background: radial-gradient(ellipse at center, rgba(0, 240, 255, 0.22) 0%, transparent 68%);
  filter: blur(14px);
  pointer-events: none;
  animation: xsr-logo-aura 3.5s ease-in-out infinite;
}

.xsr-brand-logo-shine {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    transparent 0%,
    transparent 38%,
    rgba(255, 255, 255, 0.07) 46%,
    rgba(0, 240, 255, 0.22) 50%,
    rgba(255, 255, 255, 0.07) 54%,
    transparent 62%,
    transparent 100%
  );
  background-size: 220% 100%;
  background-position: 130% 0;
  animation: xsr-logo-shine-sweep 4.5s ease-in-out infinite;
  mix-blend-mode: screen;
}

.xsr-brand-logo-svg {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
}

.xsr-brand-logo-emblem img.xsr-brand-logo-svg {
  object-fit: contain;
}

.xsr-brand-logo-svg .xsr-logo-node {
  transform-origin: center;
  transform-box: fill-box;
  animation: xsr-logo-node-pulse 2.4s ease-in-out infinite;
}

.xsr-brand-logo-svg .xsr-logo-node:nth-of-type(2) {
  animation-delay: -1.2s;
}

.xsr-brand-logo-svg .xsr-logo-x {
  animation: xsr-logo-x-pulse 2.8s ease-in-out infinite;
}

/* ——— النص XSecRoot — تدرج أزرق غامق → أسود + لمعان سماوي ——— */
.xsr-brand-logo-wordmark {
  text-align: center;
}

.xsr-brand-logo-name {
  display: block;
  font-family: system-ui, "Segoe UI", Tahoma, sans-serif;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.1;
  background-image:
    linear-gradient(
      100deg,
      transparent 0%,
      transparent 30%,
      rgba(0, 240, 255, 0.2) 40%,
      rgba(56, 248, 255, 0.95) 48%,
      #7ffcff 50%,
      rgba(0, 240, 255, 0.95) 52%,
      rgba(0, 220, 255, 0.25) 60%,
      transparent 70%,
      transparent 100%
    ),
    linear-gradient(
      135deg,
      var(--xsr-logo-text-deep) 0%,
      var(--xsr-logo-text-mid) 52%,
      var(--xsr-logo-text-black) 100%
    );
  background-size: 280% 100%, 100% 100%;
  background-position: 130% 50%, 0 50%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: xsr-name-shine 6.5s linear infinite;
}

/* ——— أحجام ——— */
.xsr-brand-logo--landing .xsr-brand-logo-emblem {
  --emblem-size: min(6.25rem, 26vw);
  border-radius: 18px;
}

.xsr-brand-logo--landing .xsr-brand-logo-name {
  font-size: clamp(1.65rem, 4.5vw, 2.15rem);
}

.xsr-brand-logo--auth .xsr-brand-logo-emblem {
  --emblem-size: clamp(5.25rem, 16vw, 6.75rem);
  border-radius: 16px;
}

.xsr-brand-logo--auth .xsr-brand-logo-name {
  font-size: clamp(1.45rem, 3.5vw, 1.85rem);
}

.xsr-brand-logo--header .xsr-brand-logo-emblem {
  --emblem-size: clamp(2.5rem, 7vw, 3rem);
  border-radius: 10px;
}

.xsr-brand-logo--header .xsr-brand-logo-name {
  font-size: clamp(1rem, 2.8vw, 1.2rem);
}

.landing-logo,
.auth-logo-block-hero {
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

/* ——— تمركز اللوجو والنص في showcase (دخول / تسجيل) ——— */
.auth-page-login .auth-showcase,
.auth-page-register .auth-showcase {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.auth-page-login .auth-showcase-inner,
.auth-page-register .auth-showcase-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  margin-inline: auto;
}

.auth-page-login .auth-logo-block,
.auth-page-register .auth-logo-block {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-align: center;
}

.auth-page-login .auth-logo-block-hero,
.auth-page-register .auth-logo-block-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.auth-page-login .auth-showcase-intro,
.auth-page-register .auth-showcase-intro {
  align-items: center;
  width: 100%;
}

.auth-page-login .auth-showcase-problems,
.auth-page-register .auth-showcase-problems {
  align-items: stretch;
  width: 100%;
  max-width: 22rem;
}

/* ——— تفاعل الرأس (الأيقونة فقط) ——— */
.xsr-brand-logo--header .xsr-brand-logo-emblem {
  transition: box-shadow 0.28s ease, transform 0.28s ease;
}

body.xsr-home-page .xsr-home-header-logo:hover .xsr-brand-logo-emblem,
body.xsr-home-page .xsr-home-header-logo:focus-visible .xsr-brand-logo-emblem {
  box-shadow:
    0 14px 32px rgba(15, 23, 42, 0.28),
    0 0 0 1px rgba(0, 240, 255, 0.28),
    0 0 36px rgba(0, 240, 255, 0.35),
    0 0 56px rgba(0, 240, 255, 0.12);
  transform: scale(1.05);
}

body.xsr-home-page .xsr-home-header-logo:hover .xsr-brand-logo-shine,
body.xsr-home-page .xsr-home-header-logo:focus-visible .xsr-brand-logo-shine {
  animation-duration: 2.5s;
}

body.xsr-home-page .xsr-home-header-logo:focus-visible {
  outline: 2px solid rgba(0, 240, 255, 0.45);
  outline-offset: 6px;
  border-radius: 12px;
}

/* ——— حركات الأيقونة ——— */
@keyframes xsr-brand-logo-enter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes xsr-brand-logo-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes xsr-logo-shine-sweep {
  0%,
  28% {
    background-position: 130% 0;
  }
  50% {
    background-position: -30% 0;
  }
  100% {
    background-position: -30% 0;
  }
}

@keyframes xsr-logo-emblem-glow {
  0%,
  100% {
    box-shadow:
      0 12px 28px rgba(15, 23, 42, 0.22),
      0 0 0 1px rgba(0, 240, 255, 0.12),
      0 0 28px rgba(0, 240, 255, 0.14);
  }
  50% {
    box-shadow:
      0 14px 32px rgba(15, 23, 42, 0.24),
      0 0 0 1px rgba(0, 240, 255, 0.22),
      0 0 40px rgba(0, 240, 255, 0.28),
      0 0 60px rgba(0, 240, 255, 0.1);
  }
}

@keyframes xsr-logo-aura {
  0%,
  100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

@keyframes xsr-logo-node-pulse {
  0%,
  100% {
    opacity: 0.85;
  }
  50% {
    opacity: 1;
  }
}

@keyframes xsr-logo-x-pulse {
  0%,
  100% {
    opacity: 0.92;
  }
  50% {
    opacity: 1;
  }
}

@keyframes xsr-name-shine {
  from {
    background-position: 130% 50%, 0 50%;
  }
  to {
    background-position: -30% 50%, 0 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .xsr-brand-logo-emblem,
  .xsr-brand-logo-emblem::before,
  .xsr-brand-logo-shine,
  .xsr-brand-logo-svg .xsr-logo-node,
  .xsr-brand-logo-svg .xsr-logo-x {
    animation: none !important;
  }

  .xsr-brand-logo-name {
    animation: none !important;
    background: linear-gradient(
      135deg,
      var(--xsr-logo-text-deep) 0%,
      var(--xsr-logo-text-mid) 52%,
      var(--xsr-logo-text-black) 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  body.xsr-home-page .xsr-home-header-logo:hover .xsr-brand-logo-emblem,
  body.xsr-home-page .xsr-home-header-logo:focus-visible .xsr-brand-logo-emblem {
    transform: none;
  }
}

@media (max-width: 520px) {
  .xsr-brand-logo--landing .xsr-brand-logo-emblem {
    --emblem-size: min(5.5rem, 32vw);
  }

  .xsr-brand-logo--auth .xsr-brand-logo-emblem {
    --emblem-size: clamp(4.75rem, 28vw, 5.75rem);
  }

  .xsr-brand-logo--header {
    gap: 0.4rem;
  }
}
