/* ─────────────── صفحه خطا — داخل SPA رندر می‌شود ───────────────
   Rendered as a real Inertia page (Pages/Error.tsx), not a Blade view, so the
   links are client-side and the app shell/theme still apply. --err-accent is
   set inline per status code. */

.errpage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 1.5rem;
  background: var(--color-bg-soft);
  overflow: hidden;
}

/* Soft accent bloom behind the card */
.errpage-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(680px, 120vw);
  height: min(680px, 120vw);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--err-accent) 18%, transparent) 0%,
    transparent 68%
  );
  filter: blur(70px);
  pointer-events: none;
}

.errpage-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  padding: 2.5rem 2rem 2rem;
  text-align: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius-lg) + 0.4rem);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.10);
  animation: errpage-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme='dark'] .errpage-card {
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

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

.errpage-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
  opacity: 0.85;
}

.errpage-badge {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--err-accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--err-accent) 28%, transparent);
  color: var(--err-accent);
  font-size: 1.5rem;
}

.errpage-code {
  font-size: clamp(4.5rem, 16vw, 6.5rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -2px;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(
    135deg,
    var(--err-accent) 0%,
    color-mix(in srgb, var(--err-accent) 55%, #000) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme='dark'] .errpage-code {
  background: linear-gradient(
    135deg,
    var(--err-accent) 0%,
    color-mix(in srgb, var(--err-accent) 60%, #fff) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.errpage-rule {
  width: 52px;
  height: 3px;
  margin: 1rem auto 1.25rem;
  border-radius: 2px;
  background: var(--err-accent);
  opacity: 0.9;
}

.errpage-title {
  margin: 0 0 0.5rem;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--color-text);
  text-wrap: balance;
}

.errpage-desc {
  margin: 0 0 1.75rem;
  font-size: 0.925rem;
  line-height: 1.8;
  color: var(--color-text-muted);
  text-wrap: pretty;
}

.errpage-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s, transform 0.18s, box-shadow 0.18s;
}

.errpage-btn:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(14, 166, 120, 0.3);
}

.errpage-btn:active {
  transform: translateY(0);
}

.errpage-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .errpage-card { animation: none; }
  .errpage-btn { transition: none; }
  .errpage-btn:hover { transform: none; }
}
