/* DeciNexa Enterprise 403 and 404 Pages */

.dn404 {
  --navy: #07152b;
  --navy-light: #10274a;
  --blue: #2167e8;
  --cyan: #16c7f3;
  --violet: #6549f6;
  --text: #f8fbff;
  --muted: #a9bad5;

  position: relative;
  display: grid;
  min-height: 100vh;
  overflow: hidden;
  color: var(--text);
  background:
    radial-gradient(
      circle at 75% 35%,
      rgba(33, 103, 232, .25),
      transparent 35%
    ),
    radial-gradient(
      circle at 15% 85%,
      rgba(101, 73, 246, .18),
      transparent 32%
    ),
    linear-gradient(
      135deg,
      #040d1e,
      var(--navy) 48%,
      #10163b
    );
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.dn404 *,
.dn404 *::before,
.dn404 *::after {
  box-sizing: border-box;
}

.dn404::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .18;
  background-image:
    linear-gradient(
      rgba(105, 153, 222, .16) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(105, 153, 222, .16) 1px,
      transparent 1px
    );
  background-size: 52px 52px;
  mask-image:
    linear-gradient(
      to bottom,
      transparent,
      #000 25%,
      #000
    );
}

/* Main enterprise frame */

.dn404 .dn404-shell {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: min(1450px, calc(100% - 64px));
  min-height: calc(100vh - 64px);
  margin: 32px auto;
  overflow: hidden;
  border: 1px solid rgba(126, 166, 228, .2);
  border-radius: 24px;
  background: rgba(6, 20, 43, .76);
  box-shadow:
    0 35px 110px rgba(0, 0, 0, .38);
  backdrop-filter: blur(16px);
}

/* Header */

.dn404 .dn404-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 86px;
  padding: 18px 30px;
  border-bottom: 1px solid rgba(126, 166, 228, .16);
}

.dn404 .dn404-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}

.dn404 .dn404-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: #fff;
  border-radius: 14px;
  background:
    linear-gradient(
      145deg,
      var(--cyan),
      var(--blue) 54%,
      var(--violet)
    );
  box-shadow:
    0 12px 28px rgba(33, 103, 232, .36);
  font-size: 22px;
  font-weight: 850;
}

.dn404 .dn404-brand > span:last-child {
  display: grid;
  gap: 2px;
}

.dn404 .dn404-brand strong {
  color: #fff;
  font-size: 19px;
  line-height: 1.1;
}

.dn404 .dn404-brand small {
  color: #b6c7e1;
  font-size: 12px;
}

.dn404 .dn404-online,
.dn404 .dn403-security {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  color: #c7d8ff;
  border: 1px solid rgba(103, 117, 255, .4);
  border-radius: 999px;
  background: rgba(66, 59, 171, .14);
  font-size: 12px;
  font-weight: 650;
}

.dn404 .dn404-online i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #37d49b;
  box-shadow: 0 0 14px #37d49b;
}

/* Main two-column content */

.dn404 .dn404-content {
  display: grid;
  flex: 1;
  grid-template-columns:
    minmax(0, .95fr)
    minmax(430px, 1.05fr);
  align-items: center;
  gap: clamp(35px, 5vw, 80px);
  padding:
    clamp(42px, 6vh, 76px)
    clamp(42px, 6vw, 92px);
}

.dn404 .dn404-copy {
  max-width: 630px;
}

.dn404 .dn404-kicker {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.dn404 .dn404-code {
  margin: 0;
  color: transparent;
  background:
    linear-gradient(
      110deg,
      #ffffff,
      #99e3ff 42%,
      #8a76ff
    );
  background-clip: text;
  -webkit-background-clip: text;
  font-size: clamp(100px, 10vw, 155px);
  font-weight: 850;
  line-height: .9;
  letter-spacing: -.075em;
}

.dn404 .dn404-copy h1 {
  max-width: 620px;
  margin: 22px 0 16px;
  color: #fff;
  font-size: clamp(34px, 3.2vw, 52px);
  font-weight: 760;
  line-height: 1.08;
  letter-spacing: -.04em;
}

.dn404 .dn404-lead {
  max-width: 610px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

/* 404 path */

.dn404 .dn404-path {
  display: grid;
  gap: 7px;
  margin-top: 27px;
  padding: 15px 17px;
  border: 1px solid rgba(126, 166, 228, .22);
  border-radius: 12px;
  background: rgba(2, 11, 27, .5);
}

.dn404 .dn404-path span {
  color: #859bbd;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.dn404 .dn404-path code {
  overflow-wrap: anywhere;
  color: #e1ebff;
  font-family: Consolas, monospace;
  font-size: 13px;
}

/* 403 context cards */

.dn404 .dn403-context {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 28px;
}

.dn404 .dn403-context > div {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 15px;
  border: 1px solid rgba(126, 166, 228, .22);
  border-radius: 12px;
  background: rgba(2, 11, 27, .5);
}

.dn404 .dn403-context span {
  color: #859bbd;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.dn404 .dn403-context strong {
  overflow-wrap: anywhere;
  color: #e8efff;
  font-size: 12px;
}

/* Buttons */

.dn404 .dn404-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.dn404 .dn404-actions a,
.dn404 .dn404-actions button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 0;
  padding: 0 22px;
  color: #dbe7fb;
  border: 1px solid rgba(126, 166, 228, .28);
  border-radius: 10px;
  background: rgba(15, 37, 70, .75);
  box-shadow: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform .15s ease,
    filter .15s ease,
    border-color .15s ease;
}

.dn404 .dn404-actions a:hover,
.dn404 .dn404-actions button:hover {
  color: #fff;
  filter: brightness(1.09);
  transform: translateY(-1px);
}

.dn404 .dn404-actions .dn404-primary {
  color: #fff;
  border-color: transparent;
  background:
    linear-gradient(
      105deg,
      var(--violet),
      var(--blue)
    );
  box-shadow:
    0 14px 32px rgba(33, 103, 232, .26);
}

.dn404 .dn404-actions .dn403-signout {
  color: #ffcbd0;
  border-color: rgba(255, 105, 118, .32);
  background: rgba(117, 27, 39, .26);
}

.dn404 .dn404-help {
  margin: 25px 0 0;
  color: #7f96b9;
  font-size: 12px;
  line-height: 1.5;
}

/* Enterprise visual */

.dn404 .dn404-visual {
  position: relative;
  width: min(520px, 100%);
  aspect-ratio: 1;
  justify-self: center;
}

.dn404 .dn404-orbit {
  position: absolute;
  border: 1px solid rgba(54, 174, 255, .28);
  border-radius: 50%;
  animation: dn-orbit 28s linear infinite;
}

.dn404 .orbit-a {
  inset: 2%;
}

.dn404 .orbit-b {
  inset: 16%;
  border-color: rgba(124, 91, 255, .38);
  animation-duration: 20s;
  animation-direction: reverse;
}

.dn404 .dn404-visual > i {
  position: absolute;
  z-index: 2;
  width: 12px;
  height: 12px;
  border: 2px solid #a2edff;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 25px #35c7ff;
}

.dn404 .node-a {
  top: 13%;
  left: 25%;
}

.dn404 .node-b {
  top: 48%;
  right: 1%;
}

.dn404 .node-c {
  bottom: 9%;
  left: 31%;
}

.dn404 .dn404-cube {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 190px;
  height: 190px;
  place-items: center;
  transform:
    translate(-50%, -50%)
    rotate(30deg)
    skew(-5deg, -5deg);
  border: 1px solid rgba(139, 230, 255, .9);
  border-radius: 27px;
  background:
    linear-gradient(
      145deg,
      rgba(24, 187, 245, .92),
      rgba(38, 91, 231, .94) 48%,
      rgba(105, 63, 241, .9)
    );
  box-shadow:
    0 0 68px rgba(33, 148, 255, .4),
    inset 0 0 40px rgba(255, 255, 255, .18);
}

.dn404 .dn404-cube::before,
.dn404 .dn404-cube::after {
  content: "";
  position: absolute;
  inset: 22px;
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 16px;
}

.dn404 .dn404-cube::after {
  inset: 52px;
}

.dn404 .dn404-cube span {
  color: #fff;
  font-size: 32px;
  font-weight: 850;
  transform:
    skew(5deg, 5deg)
    rotate(-30deg);
}

/* 403 shield */

.dn404 .dn403-shield {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 215px;
  height: 250px;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(132, 225, 255, .88);
  border-radius:
    48% 48% 54% 54% /
    32% 32% 68% 68%;
  background:
    linear-gradient(
      150deg,
      rgba(25, 188, 244, .88),
      rgba(39, 89, 229, .92) 48%,
      rgba(105, 61, 239, .88)
    );
  box-shadow:
    0 0 76px rgba(40, 140, 255, .42),
    inset 0 0 42px rgba(255, 255, 255, .18);
}

.dn404 .dn403-shield::before {
  content: "";
  position: absolute;
  inset: 21px;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: inherit;
}

.dn404 .dn403-lock {
  position: relative;
  width: 68px;
  height: 57px;
  margin-top: 35px;
  border: 4px solid #fff;
  border-radius: 12px;
}

.dn404 .dn403-lock::before {
  content: "";
  position: absolute;
  bottom: 48px;
  left: 12px;
  width: 36px;
  height: 38px;
  border: 4px solid #fff;
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
}

.dn404 .dn403-lock::after {
  content: "";
  position: absolute;
  top: 17px;
  left: 27px;
  width: 7px;
  height: 18px;
  border-radius: 5px;
  background: #fff;
}

/* Visual status card */

.dn404 .dn404-signal {
  position: absolute;
  right: 7%;
  bottom: 5%;
  display: grid;
  gap: 4px;
  padding: 13px 16px;
  border: 1px solid rgba(62, 160, 255, .45);
  border-radius: 11px;
  background: rgba(7, 27, 61, .78);
  box-shadow: 0 15px 34px rgba(0, 0, 0, .2);
  backdrop-filter: blur(9px);
}

.dn404 .dn404-signal strong {
  color: #fff;
  font-size: 13px;
}

.dn404 .dn404-signal small {
  color: #9fb5d7;
  font-size: 10px;
}

/* Footer */

.dn404 .dn404-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  min-height: 54px;
  align-items: center;
  padding: 15px 30px;
  color: #748cac;
  border-top: 1px solid rgba(126, 166, 228, .16);
  font-size: 10px;
  letter-spacing: .03em;
}

@keyframes dn-orbit {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dn404 .dn404-orbit {
    animation: none;
  }
}

@media (max-width: 1050px) {
  .dn404 .dn404-content {
    grid-template-columns: 1fr;
  }

  .dn404 .dn404-visual {
    display: none;
  }

  .dn404 .dn404-copy {
    max-width: 720px;
  }
}

@media (max-width: 680px) {
  .dn404 .dn404-shell {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .dn404 .dn404-header {
    padding: 18px 20px;
  }

  .dn404 .dn404-online,
  .dn404 .dn403-security {
    display: none;
  }

  .dn404 .dn404-content {
    padding: 46px 24px;
  }

  .dn404 .dn403-context {
    grid-template-columns: 1fr;
  }

  .dn404 .dn404-actions {
    display: grid;
  }

  .dn404 .dn404-actions a,
  .dn404 .dn404-actions button {
    width: 100%;
  }

  .dn404 .dn404-footer {
    display: grid;
    padding: 18px 20px;
  }
}

/* AgriTrade static-portal error-page isolation */

html:has(body > .dn404),
body:has(> .dn404) {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: #040d1e;
}

body > main.dn404 {
  position: relative !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  min-height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
}

.dn404 .dn503-security {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  color: #d5deff;
  border: 1px solid rgba(255, 183, 76, .35);
  border-radius: 999px;
  background: rgba(143, 88, 24, .16);
  font-size: 12px;
  font-weight: 650;
}

.dn404 .dn503-security i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffb44c;
  box-shadow: 0 0 14px rgba(255, 180, 76, .8);
}

.dn404 .dn503-code {
  background:
    linear-gradient(
      110deg,
      #ffffff,
      #ffd28a 42%,
      #8a76ff
    );
  background-clip: text;
  -webkit-background-clip: text;
}

/* Prevent AgriTrade dashboard header styles from leaking
   into shared DeciNexa error pages */

.dn404 .dn404-shell > header.dn404-header {
  position: relative !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  width: 100% !important;
  min-height: 86px !important;
  margin: 0 !important;
  padding: 18px 30px !important;
  color: #ffffff !important;
  background: rgba(6, 20, 43, .76) !important;
  border-top: 0 !important;
  border-right: 0 !important;
  border-left: 0 !important;
  border-bottom: 1px solid rgba(126, 166, 228, .16) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.dn404 .dn404-header .dn404-brand,
.dn404 .dn404-header .dn404-brand:hover,
.dn404 .dn404-header .dn404-brand:visited {
  color: #ffffff !important;
  background: transparent !important;
  text-decoration: none !important;
}

.dn404 .dn404-header .dn404-brand strong {
  color: #ffffff !important;
}

.dn404 .dn404-header .dn404-brand small {
  color: #b6c7e1 !important;
}

.dn404 .dn404-header .dn404-online,
.dn404 .dn404-header .dn403-security,
.dn404 .dn404-header .dn503-security {
  width: auto !important;
  margin: 0 !important;
}

@media (max-width: 600px) {
  .dn404 .dn404-shell > header.dn404-header {
    min-height: 74px !important;
    padding: 14px 18px !important;
  }

  .dn404 .dn404-header .dn404-online,
  .dn404 .dn404-header .dn403-security,
  .dn404 .dn404-header .dn503-security {
    display: none !important;
  }
}
