/**
 * Theme-independent protected 404 screen for login security.
 *
 * @package Polanger_Dashboard_Tools
 */

:root {
  --pdt-login-404-primary: #6366f1;
  --pdt-login-404-primary-strong: #4338ca;
  --pdt-login-404-secondary: #8b5cf6;
  --pdt-login-404-surface: #ffffff;
  --pdt-login-404-surface-rgb: 255, 255, 255;
  --pdt-login-404-text: #0f172a;
  --pdt-login-404-muted: #475569;
  --pdt-login-404-shell-bg: linear-gradient(145deg, #0f172a 0%, #312e81 100%);
  --pdt-login-404-border: rgba(255, 255, 255, 0.18);
  --pdt-login-404-shadow: 0 32px 80px rgba(15, 23, 42, 0.28);
  --pdt-login-404-radius: 34px;
}

html {
  min-height: 100%;
  background: #0f172a;
}

body.pdt-login-guard-404-body {
  min-height: 100vh;
  margin: 0;
  background: var(--pdt-login-404-shell-bg);
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

body.pdt-login-guard-404-body::before,
body.pdt-login-guard-404-body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body.pdt-login-guard-404-body::before {
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.16), transparent 26%),
    radial-gradient(circle at 88% 14%, rgba(255, 255, 255, 0.12), transparent 18%),
    radial-gradient(circle at 72% 84%, rgba(99, 102, 241, 0.24), transparent 22%);
}

body.pdt-login-guard-404-body::after {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.05), transparent 24%, transparent 74%, rgba(255, 255, 255, 0.05));
  opacity: 0.6;
}

.pdt-login-guard-404-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 42px;
  box-sizing: border-box;
}

.pdt-login-guard-404-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
  width: min(1180px, 100%);
  background: linear-gradient(145deg, rgba(var(--pdt-login-404-surface-rgb), 0.96), rgba(var(--pdt-login-404-surface-rgb), 0.9));
  border: 1px solid var(--pdt-login-404-border);
  border-radius: var(--pdt-login-404-radius);
  box-shadow: var(--pdt-login-404-shadow);
  overflow: hidden;
  isolation: isolate;
}

.pdt-login-guard-404-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.12), transparent 28%),
    linear-gradient(320deg, rgba(99, 102, 241, 0.06), transparent 34%, rgba(139, 92, 246, 0.08));
  pointer-events: none;
}

.pdt-login-guard-404-visual,
.pdt-login-guard-404-content {
  position: relative;
  z-index: 1;
  padding: 46px;
}

.pdt-login-guard-404-visual {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.22), transparent 34%),
    radial-gradient(circle at 82% 18%, rgba(255, 255, 255, 0.14), transparent 18%),
    linear-gradient(162deg, rgba(99, 102, 241, 0.98), rgba(79, 70, 229, 0.92) 55%, rgba(139, 92, 246, 0.9));
}

.pdt-login-guard-404-visual::after {
  content: "";
  position: absolute;
  left: -4%;
  right: -4%;
  bottom: -12%;
  height: 240px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  filter: blur(8px);
}

.pdt-login-guard-404-brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.pdt-login-guard-404-brand__logo,
.pdt-login-guard-404-brand__icon,
.pdt-login-guard-404-brand__fallback {
  width: 70px;
  height: 70px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 18px 44px rgba(49, 46, 129, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  backdrop-filter: blur(8px);
}

.pdt-login-guard-404-brand__logo,
.pdt-login-guard-404-brand__icon {
  object-fit: contain;
  padding: 12px;
  box-sizing: border-box;
}

.pdt-login-guard-404-brand__fallback {
  font-size: 30px;
  font-weight: 700;
  color: #ffffff;
}

.pdt-login-guard-404-brand__copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.pdt-login-guard-404-brand__eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.74);
}

.pdt-login-guard-404-brand__title {
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.1;
  color: #ffffff;
  word-break: break-word;
}

.pdt-login-guard-404-stage {
  position: relative;
  min-height: 290px;
  margin-top: 12px;
}

.pdt-login-guard-404-cloud {
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  filter: blur(2px);
  animation: pdt-login-404-cloud-drift 8s ease-in-out infinite;
}

.pdt-login-guard-404-cloud--one {
  top: 24px;
  right: 52px;
  width: 118px;
  height: 42px;
}

.pdt-login-guard-404-cloud--one::before,
.pdt-login-guard-404-cloud--one::after,
.pdt-login-guard-404-cloud--two::before,
.pdt-login-guard-404-cloud--two::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: inherit;
}

.pdt-login-guard-404-cloud--one::before {
  width: 42px;
  height: 42px;
  left: 18px;
  top: -18px;
}

.pdt-login-guard-404-cloud--one::after {
  width: 50px;
  height: 50px;
  right: 18px;
  top: -22px;
}

.pdt-login-guard-404-cloud--two {
  top: 104px;
  left: 30px;
  width: 90px;
  height: 32px;
  animation-delay: -2.3s;
}

.pdt-login-guard-404-cloud--two::before {
  width: 34px;
  height: 34px;
  left: 10px;
  top: -14px;
}

.pdt-login-guard-404-cloud--two::after {
  width: 40px;
  height: 40px;
  right: 12px;
  top: -18px;
}

.pdt-login-guard-404-speech {
  position: absolute;
  top: 2px;
  left: 50%;
  width: min(280px, 78%);
  padding: 16px 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 16px 42px rgba(67, 56, 202, 0.22);
  color: #ffffff;
  backdrop-filter: blur(12px);
  transform: translateX(-10%) rotate(-2deg);
  animation: pdt-login-404-bob 4.8s ease-in-out infinite;
}

.pdt-login-guard-404-speech::after {
  content: "";
  position: absolute;
  left: 36px;
  bottom: -14px;
  width: 26px;
  height: 26px;
  background: inherit;
  border-right: 1px solid rgba(255, 255, 255, 0.22);
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  transform: rotate(45deg);
}

.pdt-login-guard-404-speech strong,
.pdt-login-guard-404-speech span {
  display: block;
}

.pdt-login-guard-404-speech strong {
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.pdt-login-guard-404-speech span {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.88);
}

.pdt-login-guard-404-mascot {
  position: absolute;
  left: 42px;
  bottom: 4px;
  width: 205px;
  height: 168px;
}

.pdt-login-guard-404-mascot__shadow {
  position: absolute;
  left: 24px;
  right: 16px;
  bottom: 12px;
  height: 26px;
  border-radius: 999px;
  background: rgba(49, 46, 129, 0.34);
  filter: blur(6px);
  animation: pdt-login-404-shadow 4s ease-in-out infinite;
}

.pdt-login-guard-404-mascot__body {
  position: absolute;
  left: 24px;
  bottom: 28px;
  width: 128px;
  height: 118px;
  border-radius: 44px 44px 38px 38px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(240, 245, 255, 0.9));
  box-shadow: 0 24px 60px rgba(49, 46, 129, 0.26);
  animation: pdt-login-404-float 4s ease-in-out infinite;
}

.pdt-login-guard-404-mascot__body::before,
.pdt-login-guard-404-mascot__body::after {
  content: "";
  position: absolute;
  top: -18px;
  width: 42px;
  height: 42px;
  border-radius: 20px 20px 6px 20px;
  background: rgba(255, 255, 255, 0.94);
}

.pdt-login-guard-404-mascot__body::before {
  left: 14px;
  transform: rotate(-16deg);
}

.pdt-login-guard-404-mascot__body::after {
  right: 14px;
  border-radius: 20px 20px 20px 6px;
  transform: rotate(16deg);
}

.pdt-login-guard-404-mascot__eye {
  position: absolute;
  top: 42px;
  width: 14px;
  height: 18px;
  border-radius: 999px;
  background: #4338ca;
  animation: pdt-login-404-blink 5.6s ease-in-out infinite;
}

.pdt-login-guard-404-mascot__eye--left {
  left: 38px;
}

.pdt-login-guard-404-mascot__eye--right {
  right: 38px;
}

.pdt-login-guard-404-mascot__mouth {
  position: absolute;
  left: 50%;
  bottom: 30px;
  width: 34px;
  height: 16px;
  border-bottom: 4px solid #8b5cf6;
  border-radius: 0 0 18px 18px;
  transform: translateX(-50%);
}

.pdt-login-guard-404-mascot__cheek {
  position: absolute;
  top: 62px;
  width: 14px;
  height: 10px;
  border-radius: 999px;
  background: rgba(236, 72, 153, 0.24);
}

.pdt-login-guard-404-mascot__cheek--left {
  left: 20px;
}

.pdt-login-guard-404-mascot__cheek--right {
  right: 20px;
}

.pdt-login-guard-404-mascot__arm {
  position: absolute;
  bottom: 68px;
  width: 46px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  transform-origin: center center;
}

.pdt-login-guard-404-mascot__arm::after {
  content: "";
  position: absolute;
  top: -4px;
  right: -2px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: inherit;
}

.pdt-login-guard-404-mascot__arm--left {
  left: 0;
  transform: rotate(18deg);
}

.pdt-login-guard-404-mascot__arm--right {
  right: 18px;
  transform: rotate(-22deg);
  animation: pdt-login-404-wave 2.2s ease-in-out infinite;
}

.pdt-login-guard-404-sign {
  position: absolute;
  right: 0;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 132px;
  padding: 18px 14px 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 20px 44px rgba(67, 56, 202, 0.2);
  backdrop-filter: blur(10px);
  transform: rotate(6deg);
  animation: pdt-login-404-sign 5.4s ease-in-out infinite;
}

.pdt-login-guard-404-sign__code {
  font-size: 34px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #ffffff;
}

.pdt-login-guard-404-sign__label {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
  white-space: nowrap;
}

.pdt-login-guard-404-code {
  font-size: clamp(92px, 13vw, 188px);
  line-height: 0.82;
  font-weight: 900;
  letter-spacing: -0.08em;
  color: rgba(255, 255, 255, 0.15);
  text-shadow: 0 16px 32px rgba(15, 23, 42, 0.14);
}

.pdt-login-guard-404-visual__caption {
  max-width: 28rem;
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.84);
}

.pdt-login-guard-404-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--pdt-login-404-text);
}

.pdt-login-guard-404-badge {
  display: inline-flex;
  align-self: flex-start;
  margin-bottom: 18px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.08);
  color: var(--pdt-login-404-primary-strong);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pdt-login-guard-404-title {
  margin: 0 0 16px;
  font-size: clamp(36px, 4.2vw, 58px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  color: var(--pdt-login-404-text);
}

.pdt-login-guard-404-message,
.pdt-login-guard-404-supporting {
  max-width: 36rem;
  margin: 0;
  font-size: 17px;
  line-height: 1.82;
  color: var(--pdt-login-404-muted);
}

.pdt-login-guard-404-supporting {
  margin-top: 12px;
}

.pdt-login-guard-404-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 26px;
}

.pdt-login-guard-404-note {
  padding: 18px 18px 16px;
  border-radius: 20px;
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.08);
}

.pdt-login-guard-404-note strong,
.pdt-login-guard-404-note span {
  display: block;
}

.pdt-login-guard-404-note strong {
  margin-bottom: 6px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--pdt-login-404-text);
}

.pdt-login-guard-404-note span {
  font-size: 14px;
  line-height: 1.7;
  color: var(--pdt-login-404-muted);
}

.pdt-login-guard-404-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.pdt-login-guard-404-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 24px;
  border-radius: 18px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.pdt-login-guard-404-button--primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--pdt-login-404-primary), var(--pdt-login-404-secondary));
  box-shadow: 0 18px 42px rgba(79, 70, 229, 0.24);
}

.pdt-login-guard-404-button--primary:hover,
.pdt-login-guard-404-button--primary:focus {
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 24px 48px rgba(79, 70, 229, 0.3);
}

.pdt-login-guard-404-button:focus {
  outline: 2px solid rgba(99, 102, 241, 0.28);
  outline-offset: 3px;
}

.pdt-login-guard-404-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(2px);
  pointer-events: none;
}

.pdt-login-guard-404-orb--one {
  top: 68px;
  left: max(20px, calc(50% - 600px));
  width: 124px;
  height: 124px;
  background: rgba(255, 255, 255, 0.08);
  animation: pdt-login-404-bob 7s ease-in-out infinite;
}

.pdt-login-guard-404-orb--two {
  right: max(16px, calc(50% - 540px));
  bottom: 72px;
  width: 174px;
  height: 174px;
  background: rgba(99, 102, 241, 0.18);
  animation: pdt-login-404-bob 6.4s ease-in-out infinite reverse;
}

@keyframes pdt-login-404-float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-12px);
  }
}

@keyframes pdt-login-404-shadow {
  0%,
  100% {
    transform: scaleX(1);
    opacity: 0.9;
  }

  50% {
    transform: scaleX(0.88);
    opacity: 0.65;
  }
}

@keyframes pdt-login-404-wave {
  0%,
  100% {
    transform: rotate(-22deg);
  }

  50% {
    transform: rotate(-6deg);
  }
}

@keyframes pdt-login-404-sign {
  0%,
  100% {
    transform: rotate(6deg) translateY(0);
  }

  50% {
    transform: rotate(2deg) translateY(-8px);
  }
}

@keyframes pdt-login-404-bob {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }

  50% {
    transform: translateY(-10px) rotate(-1deg);
  }
}

@keyframes pdt-login-404-cloud-drift {
  0%,
  100% {
    transform: translateX(0);
  }

  50% {
    transform: translateX(10px);
  }
}

@keyframes pdt-login-404-blink {
  0%,
  44%,
  48%,
  100% {
    transform: scaleY(1);
  }

  46% {
    transform: scaleY(0.12);
  }
}

@media (max-width: 980px) {
  .pdt-login-guard-404-shell {
    padding: 28px;
  }

  .pdt-login-guard-404-card {
    grid-template-columns: 1fr;
  }

  .pdt-login-guard-404-visual,
  .pdt-login-guard-404-content {
    padding: 34px 28px;
  }

  .pdt-login-guard-404-stage {
    min-height: 250px;
  }

  .pdt-login-guard-404-notes {
    grid-template-columns: 1fr;
  }

  .pdt-login-guard-404-code {
    font-size: clamp(82px, 22vw, 150px);
  }
}

@media (max-width: 640px) {
  .pdt-login-guard-404-shell {
    padding: 18px;
  }

  .pdt-login-guard-404-visual,
  .pdt-login-guard-404-content {
    padding: 24px 20px;
  }

  .pdt-login-guard-404-brand {
    align-items: flex-start;
  }

  .pdt-login-guard-404-brand__logo,
  .pdt-login-guard-404-brand__icon,
  .pdt-login-guard-404-brand__fallback {
    width: 58px;
    height: 58px;
    border-radius: 18px;
  }

  .pdt-login-guard-404-stage {
    min-height: 280px;
  }

  .pdt-login-guard-404-speech {
    left: 16px;
    right: 16px;
    width: auto;
    transform: rotate(-1deg);
  }

  .pdt-login-guard-404-mascot {
    left: 10px;
    bottom: 0;
    transform: scale(0.88);
    transform-origin: left bottom;
  }

  .pdt-login-guard-404-sign {
    right: 6px;
    bottom: 28px;
    transform: scale(0.92) rotate(5deg);
  }

  .pdt-login-guard-404-message,
  .pdt-login-guard-404-supporting {
    font-size: 16px;
  }

  .pdt-login-guard-404-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pdt-login-guard-404-cloud,
  .pdt-login-guard-404-speech,
  .pdt-login-guard-404-mascot__shadow,
  .pdt-login-guard-404-mascot__body,
  .pdt-login-guard-404-mascot__eye,
  .pdt-login-guard-404-mascot__arm--right,
  .pdt-login-guard-404-sign,
  .pdt-login-guard-404-orb {
    animation: none !important;
  }

  .pdt-login-guard-404-button {
    transition: none;
  }
}
