/* ── Error Page Layout ── */
.error-page {
  display: flex;
  min-height: 100vh;
}

/* Narrow icon rail on the left to anchor the page to the app shell */
.error-rail {
  width: 56px;
  background: var(--color-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-4) 0;
  flex-shrink: 0;
}

.error-rail-brand {
  width: 32px;
  height: 32px;
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-rail-brand svg {
  width: 22px;
  height: 22px;
}

/* Main content area */
.error-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Minimal topbar */
.error-topbar {
  display: flex;
  align-items: center;
  padding: var(--space-3) var(--space-6);
  background: var(--color-bg-card);
  border-bottom: 1px solid var(--color-border);
}

.error-topbar-brand {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

.error-topbar-sep {
  margin: 0 var(--space-2);
  color: var(--color-accent);
  font-size: var(--text-xs);
}

.error-topbar-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Error content container */
.error-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
}

.error-card {
  max-width: 480px;
  width: 100%;
  animation: fadeUp 400ms var(--ease-default) both;
  animation-delay: 150ms;
}

/* Status code display */
.error-code {
  font-family: var(--font-display);
  font-size: 4.5rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: var(--tracking-tight);
  color: var(--color-border-input);
  margin-bottom: var(--space-2);
}

.error-code.code-error {
  color: rgba(176, 92, 92, 0.25);
}

.error-code.code-warning {
  color: rgba(196, 136, 47, 0.25);
}

.error-code.code-info {
  color: rgba(122, 143, 160, 0.25);
}

/* Error title */
.error-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--color-text);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-3);
}

/* Error description */
.error-description {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-8);
}

/* Divider line */
.error-divider {
  width: 40px;
  height: 2px;
  background: var(--color-border);
  margin-bottom: var(--space-6);
}

.error-divider.divider-error {
  background: rgba(176, 92, 92, 0.3);
}

.error-divider.divider-warning {
  background: rgba(196, 136, 47, 0.3);
}

.error-divider.divider-info {
  background: rgba(122, 143, 160, 0.3);
}

/* Action buttons */
.error-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.error-actions .btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Detail info block (for 500 page) */
.error-detail {
  margin-top: var(--space-6);
  padding: var(--space-4);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.error-detail-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.error-detail-value {
  font-family: 'SF Mono', 'Fira Code', 'Fira Mono', monospace;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  word-break: break-all;
}

/* Status bar (bottom) */
.error-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-6);
  background: var(--color-bg-card);
  border-top: 1px solid var(--color-border);
  font-size: 0.625rem;
  color: var(--color-text-muted);
}

.error-status-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.error-status-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.error-status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.error-status-dot.dot-ok {
  background: var(--color-success);
}

.error-status-dot.dot-error {
  background: var(--color-error);
}

.error-status-dot.dot-warning {
  background: var(--color-warning);
}

/* 503-specific: maintenance progress */
.maintenance-info {
  margin-top: var(--space-6);
  padding: var(--space-4);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.maintenance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.maintenance-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--color-text-muted);
}

.maintenance-eta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.maintenance-bar-track {
  width: 100%;
  height: 3px;
  background: var(--color-border);
  border-radius: 2px;
  overflow: hidden;
}

.maintenance-bar-fill {
  height: 100%;
  background: var(--color-warning);
  border-radius: 2px;
  width: 65%;
  transition: width 1s var(--ease-default);
}

/* Admin login link on 503 page */
.admin-login-link {
  font-size: 0.625rem;
  color: var(--color-text-muted);
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 150ms ease;
}

.admin-login-link:hover {
  opacity: 1;
  text-decoration: underline;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .error-rail {
    display: none;
  }

  .error-content {
    padding: var(--space-6) var(--space-4);
  }

  .error-code {
    font-size: 3.5rem;
  }

  .error-title {
    font-size: var(--text-xl);
  }
}

@media (prefers-reduced-motion: reduce) {
  .error-card {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
  }
}
